简单的todolist Bradtraversy下限错误

时间:2018-04-12 22:42:47

标签: python django linux raspbian raspberry-pi2

我正在尝试在我的覆盆子pi上运行bradtraversy simple todo list django代码并遇到以下错误。我遇到了以下追溯:

Environment:


Request Method: GET
Request URL: HIDDEN

Django Version: 1.11.11
Python Version: 2.7.13
Installed Applications:
['todos.apps.TodosConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback:

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/usr/local/lib/python2.7/dist-packages/django/utils/deprecation.py" in __call__
  138.             response = self.process_request(request)

File "/usr/local/lib/python2.7/dist-packages/django/middleware/common.py" in process_request
  57.         host = request.get_host()

File "/usr/local/lib/python2.7/dist-packages/django/http/request.py" in get_host
  105.         if domain and validate_host(domain, allowed_hosts):

File "/usr/local/lib/python2.7/dist-packages/django/http/request.py" in validate_host
  579.         if pattern == '*' or is_same_domain(host, pattern):

File "/usr/local/lib/python2.7/dist-packages/django/utils/http.py" in is_same_domain
  291.     pattern = pattern.lower()

Exception Type: AttributeError at /
Exception Value: 'list' object has no attribute 'lower'

我对Django很新,但我认为我做了所有正确的调整以符合我的系统细节。我更新了设置文件以匹配我允许的主机和数据库设置,并使用了" python manage.py migrate"命令带来迁移。

任何想法或帮助将不胜感激。谢谢

0 个答案:

没有答案