· 8 years ago · Nov 17, 2017, 04:08 PM
1Environment:
2
3
4Request Method: GET
5Request URL: http://localhost:8000/admin/login/?next=/admin/
6
7Django Version: 1.11.4
8Python Version: 3.6.2
9Installed Applications:
10['ad_app.apps.AdAppConfig',
11 'django.contrib.admin',
12 'django.contrib.auth',
13 'django.contrib.contenttypes',
14 'django.contrib.sessions',
15 'django.contrib.messages',
16 'django.contrib.staticfiles']
17Installed Middleware:
18['django.middleware.security.SecurityMiddleware',
19 'django.contrib.sessions.middleware.SessionMiddleware',
20 'django.middleware.common.CommonMiddleware',
21 'django.middleware.csrf.CsrfViewMiddleware',
22 'django.contrib.auth.middleware.AuthenticationMiddleware',
23 'django.contrib.messages.middleware.MessageMiddleware',
24 'django.middleware.clickjacking.XFrameOptionsMiddleware']
25
26
27
28Traceback:
29
30File "C:UsersJamesAppDataLocalProgramsPythonPython36-32libsite-packagesdjangocorehandlersexception.py" in inner
31 41. response = get_response(request)
32
33File "C:UsersJamesAppDataLocalProgramsPythonPython36-32libsite-packagesdjangocorehandlersbase.py" in _get_response
34 217. response = self.process_exception_by_middleware(e, request)
35
36File "C:UsersJamesAppDataLocalProgramsPythonPython36-32libsite-packagesdjangocorehandlersbase.py" in _get_response
37 215. response = response.render()
38
39File "C:UsersJamesAppDataLocalProgramsPythonPython36-32libsite-packagesdjangotemplateresponse.py" in render
40 107. self.content = self.rendered_content
41
42File "C:UsersJamesAppDataLocalProgramsPythonPython36-32libsite-packagesdjangotemplateresponse.py" in rendered_content
43 84. content = template.render(context, self._request)
44
45File "C:UsersJamesAppDataLocalProgramsPythonPython36-32libsite-packagesdjangotemplatebackendsdjango.py" in render
46 66. return self.template.render(context)
47
48File "C:UsersJamesAppDataLocalProgramsPythonPython36-32libsite-packagesdjangotemplatebase.py" in render
49 205. with context.bind_template(self):
50
51File "C:UsersJamesAppDataLocalProgramsPythonPython36-32libcontextlib.py" in __enter__
52 81. return next(self.gen)
53
54File "C:UsersJamesAppDataLocalProgramsPythonPython36-32libsite-packagesdjangotemplatecontext.py" in bind_template
55 263. updates.update(processor(self.request))
56
57Exception Type: ValueError at /admin/login/
58Exception Value: dictionary update sequence element #0 has length 0; 2 is required
59
60import os
61
62# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
63BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
64
65
66# Quick-start development settings - unsuitable for production
67# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
68
69# SECURITY WARNING: keep the secret key used in production secret!
70SECRET_KEY = '***'
71
72# SECURITY WARNING: don't run with debug turned on in production!
73DEBUG = True
74
75LOGIN_URL = '/welcome'
76AUTHENTICATION_BACKENDS = ['ad_app.authentication.EmailBackend']
77
78ALLOWED_HOSTS = []
79
80# Application definition
81
82INSTALLED_APPS = [
83 'ad_app.apps.AdAppConfig',
84 'django.contrib.admin',
85 'django.contrib.auth',
86 'django.contrib.contenttypes',
87 'django.contrib.sessions',
88 'django.contrib.messages',
89 'django.contrib.staticfiles',
90]
91
92MIDDLEWARE = [
93 'django.middleware.security.SecurityMiddleware',
94 'django.contrib.sessions.middleware.SessionMiddleware',
95 'django.middleware.common.CommonMiddleware',
96 'django.middleware.csrf.CsrfViewMiddleware',
97 'django.contrib.auth.middleware.AuthenticationMiddleware',
98 'django.contrib.messages.middleware.MessageMiddleware',
99 'django.middleware.clickjacking.XFrameOptionsMiddleware',
100]
101
102ROOT_URLCONF = 'ad_project.urls'
103
104TEMPLATES = [
105 {
106 'BACKEND': 'django.template.backends.django.DjangoTemplates',
107 'DIRS': [],
108 'APP_DIRS': True,
109 'OPTIONS': {
110 'context_processors': [
111 'django.template.context_processors.debug',
112 'django.template.context_processors.request',
113 'django.contrib.auth.context_processors.auth',
114 'django.contrib.messages.context_processors.messages',
115 'ad_app.views.wallet',
116 ],
117 },
118 },
119]
120
121WSGI_APPLICATION = 'ad_project.wsgi.application'
122
123
124# Database
125# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
126
127DATABASES = {
128 'default': {
129 'ENGINE': 'django.db.backends.sqlite3',
130 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
131 }
132}
133
134
135# Password validation
136# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
137
138AUTH_PASSWORD_VALIDATORS = [
139 {
140 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
141 },
142 {
143 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
144 },
145 {
146 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
147 },
148 {
149 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
150 },
151]
152
153# Internationalization
154# https://docs.djangoproject.com/en/1.11/topics/i18n/
155
156LANGUAGE_CODE = 'en-us'
157
158TIME_ZONE = 'UTC'
159
160USE_I18N = True
161
162USE_L10N = False
163
164USE_TZ = True
165
166
167# Static files (CSS, JavaScript, Images)
168# https://docs.djangoproject.com/en/1.11/howto/static-files/
169
170STATIC_URL = '/static/'
171
172# TEMPLATE_DIRS = (os.path.join(BASE_DIR, 'templates'),)