Django Web开发服务器不工作

2024-04-20 04:03:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试我的手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'

我尝试过解决环境变量和各种各样的问题,但没有结束这个问题。请帮忙!!!你知道吗


Tags: djangoinpyauthegglibpackagesline