Django Web开发服务器不工作

时间:2015-07-22 14:20:52

标签: python django python-3.x django-admin web-development-server

我正在尝试使用Django并且刚刚开始使用它并且坦率地说我在这方面非常初学。现在我最近遇到了一个与我想的一些设置相关的问题,但是我无法理解并解决这个问题。每当我写

python manage.py runserver

在命令行上,我收到以下错误。

    Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\contrib\auth\p
assword_validation.py", line 162, in __init__
    common_passwords_lines = gzip.open(password_list_path).read().decode('utf-8'
).splitlines()
  File "C:\Python34\lib\gzip.py", line 52, in open
    binary_file = GzipFile(filename, gz_mode, compresslevel)
  File "C:\Python34\lib\gzip.py", line 181, in __init__
    fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Python34\\lib\\site
-packages\\django-1.9-py3.4.egg\\django\\contrib\\auth\\common-passwords.txt.gz'


During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "manage.py", line 10, in <module>
        execute_from_command_line(sys.argv)
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\core\managemen
    t\__init__.py", line 331, in execute_from_command_line
        utility.execute()
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\core\managemen
    t\__init__.py", line 305, in execute
        django.setup()
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\__init__.py",
    line 18, in setup
        apps.populate(settings.INSTALLED_APPS)
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\apps\registry.
    py", line 115, in populate
        app_config.ready()
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\contrib\admin\
    apps.py", line 22, in ready
        self.module.autodiscover()
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\contrib\admin\
    __init__.py", line 26, in autodiscover
        autodiscover_modules('admin', register_to=site)
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\utils\module_l
    oading.py", line 50, in autodiscover_modules
        import_module('%s.%s' % (app_config.name, module_to_search))
      File "C:\Python34\lib\importlib\__init__.py", line 109, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
      File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
      File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
      File "<frozen importlib._bootstrap>", line 1129, in _exec
      File "<frozen importlib._bootstrap>", line 1471, in exec_module
      File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\contrib\auth\a
    dmin.py", line 7, in <module>
        from django.contrib.auth.forms import (
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\contrib\auth\f
    orms.py", line 261, in <module>
        class SetPasswordForm(forms.Form):
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\contrib\auth\f
    orms.py", line 271, in SetPasswordForm
        help_text=password_validation.password_validators_help_text_html())
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\contrib\auth\p
    assword_validation.py", line 85, in password_validators_help_text_html
        help_texts = password_validators_help_texts(password_validators)
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\contrib\auth\p
    assword_validation.py", line 74, in password_validators_help_texts
        password_validators = get_default_password_validators()
      File "C:\Python34\lib\functools.py", line 434, in wrapper
        result = user_function(*args, **kwds)
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\contrib\auth\p
    assword_validation.py", line 21, in get_default_password_validators
        return get_password_validators(settings.AUTH_PASSWORD_VALIDATORS)
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\contrib\auth\p
    assword_validation.py", line 32, in get_password_validators
        validators.append(klass(**validator.get('OPTIONS', {})))
      File "C:\Python34\lib\site-packages\django-1.9-py3.4.egg\django\contrib\auth\p
    assword_validation.py", line 164, in __init__
        with open(password_list_path) as f:
    FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Python34\\lib\\site
    -packages\\django-1.9-py3.4.egg\\django\\contrib\\auth\\common-passwords.txt.gz'

我已经尝试过解决环境变量和各种各样的事情,但这个问题没有结束。请帮忙!!!

1 个答案:

答案 0 :(得分:1)

Django 1.9尚未发布。如果您不熟悉Django,请使用最新版本,目前为1.8.3