Python在设置Django站点时迁移问题

时间:2018-03-13 18:30:43

标签: python django python-3.x

我正在尝试学习Django,但是当我跑步时

python manage.py runserver

我得到了

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/home/devopsguy/djangogirls/myvenv/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/home/devopsguy/djangogirls/myvenv/lib/python3.6/site-packages/django/core/management/__init__.py", line 308, in execute
    settings.INSTALLED_APPS
  File "/home/devopsguy/djangogirls/myvenv/lib/python3.6/site-packages/django/conf/__init__.py", line 56, in __getattr__
    self._setup(name)
  File "/home/devopsguy/djangogirls/myvenv/lib/python3.6/site-packages/django/conf/__init__.py", line 41, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/devopsguy/djangogirls/myvenv/lib/python3.6/site-packages/django/conf/__init__.py", line 110, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 674, in exec_module
  File "<frozen importlib._bootstrap_external>", line 781, in get_code
  File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/devopsguy/djangogirls/mysite/settings.py", line 108
    TIME_ZONE = "Asia/Calcutta'
                              ^
SyntaxError: EOL while scanning string literal

我是Django和python的新手,所以对于我所破坏的东西一无所知。 任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

转到descendantFocusability

找到settings.py属性,并将双引号修改为

TIME_ZONE