簡體   English   中英

Django Web應用程序激活錯誤

[英]error in activation of django web application

我創建了一個虛擬環境,並將其命名為“ f”。 直到昨天給我一個錯誤時,它一直運行良好。

代碼是:

import _imp  # Just the builtin component, NOT the full Python module
import sys

try:
    import _frozen_importlib as _bootstrap
except ImportError:
    from . import _bootstrap
    _bootstrap._setup(sys, _imp)
else:
    # importlib._bootstrap is the built-in import, ensure we don't create
    # a second copy of the module.
    _bootstrap.__name__ = 'importlib._bootstrap'
    _bootstrap.__package__ = 'importlib'
    try:python manage.py makemigrations

        _bootstrap.__file__ = __file__.replace('__init__.py', '_bootstrap.py')
    except NameError:
        # __file__ is not guaranteed to be defined, e.g. if this code gets
        # frozen by a tool like cx_Freeze.
        pass
    sys.modules['importlib._bootstrap'] = _bootstrap

python manage.py運行服務器的結果是:

File "C:\Users\hp\AppData\Local\Programs\Python\Python36\dj\f\lib\importlib\__init__.py", line 25
    try:python manage.py makemigrations
                    ^
SyntaxError: invalid syntax

有人可以幫助您解決該錯誤嗎?

您粘貼了(偶然?)

python manage.py makemigrations

try:后在該文件中try:

刪除它,您應該會變得很黃金–無論如何,您應該始終可以從頭開始重新創建您的virtualenv。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM