Hi Jason,
Thank !
This is the error I get with amusement.
How to change the old import? I suppose this is the way. Because the admin is imported from django.
Using settings module
"""Defines URL patterns for users"""
from django.conf.urls import url
from . import views
# from django.contrib.auth import login
from django.contrib.auth.views import LoginView
app_name='users'
urlpatterns = [
# Login page
url('login/', LoginView, {'template_name': 'users/login.html'}, name='login'),
# Logout page
url('logout/', views.logout_view, name='logout'),
]
TypeError at /users/login/
__init__() takes 1 positional argument but 2 were given
Request Method: | GET |
---|---|
Request URL: | http://localhost:8000/users/login/ |
Django Version: | 2.0.7 |
Exception Type: | TypeError |
Exception Value: | __init__() takes 1 positional argument but 2 were given |
Exception Location: | /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/base.py in _get_response, line 126 |
Python Executable: | /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 |
Python Version: | 3.6.5 |
Python Path: | ['/Users/timvogt/Software_projects/learning_log', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload', '/Users/timvogt/Library/Python/3.6/lib/python/site-packages', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages'] |
Server time: | Mon, 27 Aug 2018 15:26:32 +0000 |
Traceback Switch to copy-and-paste view
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/exception.py
ininner
response = get_response(request)
...
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/base.py
in_get_response
response = self.process_exception_by_middleware(e, request)
...
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/base.py
in_get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
...
Request information
USER
AnonymousUser
GET
No GET data
POST
No POST data
FILES
No FILES data
COOKIES
Variable | Value |
---|---|
csrftoken | |
snipcart_order_token | |
_xsrf | |
username-localhost-8888 | |
_ga | |
pretix_csrftoken | |
__stripe_mid | |
Pycharm-77c83f85 |
META
Variable | Value |
---|---|
Apple_PubSub_Socket_Render | |
CONTENT_LENGTH | |
CONTENT_TYPE | |
CSRF_COOKIE | |
DISPLAY | |
DJANGO_SETTINGS_MODULE | |
GATEWAY_INTERFACE | |
HOME | |
HTTP_ACCEPT | |
HTTP_ACCEPT_ENCODING | |
HTTP_ACCEPT_LANGUAGE | |
HTTP_CONNECTION | |
HTTP_COOKIE | |
HTTP_HOST | |
HTTP_REFERER | |
HTTP_UPGRADE_INSECURE_REQUESTS | |
HTTP_USER_AGENT | |
LANG | |
LOGNAME | |
PATH | |
PATH_INFO | |
PWD | |
QUERY_STRING | |
REMOTE_ADDR | |
REMOTE_HOST | |
REQUEST_METHOD | |
RUN_MAIN | |
SCRIPT_NAME | |
SECURITYSESSIONID | |
SERVER_NAME | |
SERVER_PORT | |
SERVER_PROTOCOL | |
SERVER_SOFTWARE | |
SHELL | |
SHLVL | |
SSH_AUTH_SOCK | |
TERM | |
TERM_PROGRAM | |
TERM_PROGRAM_VERSION | |
TERM_SESSION_ID | |
TMPDIR | |
TZ | |
USER | |
VIRTUALENVWRAPPER_HOOK_DIR | |
VIRTUALENVWRAPPER_PROJECT_FILENAME | |
VIRTUALENVWRAPPER_SCRIPT | |
VIRTUALENVWRAPPER_WORKON_CD | |
WORKON_HOME | |
XPC_FLAGS | |
XPC_SERVICE_NAME | |
_ | |
__CF_USER_TEXT_ENCODING | |
__PYVENV_LAUNCHER__ | |
wsgi.errors | |
wsgi.file_wrapper | |
wsgi.input | |
wsgi.multiprocess | |
wsgi.multithread | |
wsgi.run_once | |
wsgi.url_scheme | |
wsgi.version |
Settings
Using settings module learning_log.settings
Setting | Value |
---|---|
ABSOLUTE_URL_OVERRIDES | |
ADMINS | |
ALLOWED_HOSTS | |
APPEND_SLASH | |
AUTHENTICATION_BACKENDS | |
AUTH_PASSWORD_VALIDATORS | |
AUTH_USER_MODEL | |
BASE_DIR | |
CACHES | |
CACHE_MIDDLEWARE_ALIAS | |
CACHE_MIDDLEWARE_KEY_PREFIX | |
CACHE_MIDDLEWARE_SECONDS | |
CSRF_COOKIE_AGE | |
CSRF_COOKIE_DOMAIN | |
CSRF_COOKIE_HTTPONLY | |
CSRF_COOKIE_NAME | |
CSRF_COOKIE_PATH | |
CSRF_COOKIE_SECURE | |
CSRF_FAILURE_VIEW | |
CSRF_HEADER_NAME | |
CSRF_TRUSTED_ORIGINS | |
CSRF_USE_SESSIONS | |
DATABASES | |
DATABASE_ROUTERS | |
DATA_UPLOAD_MAX_MEMORY_SIZE | |
DATA_UPLOAD_MAX_NUMBER_FIELDS | |
DATETIME_FORMAT | |
DATETIME_INPUT_FORMATS | |
DATE_FORMAT | |
DATE_INPUT_FORMATS | |
DEBUG | |
DEBUG_PROPAGATE_EXCEPTIONS | |
DECIMAL_SEPARATOR | |
DEFAULT_CHARSET | |
DEFAULT_CONTENT_TYPE | |
DEFAULT_EXCEPTION_REPORTER_FILTER | |
DEFAULT_FILE_STORAGE | |
DEFAULT_FROM_EMAIL | |
DEFAULT_INDEX_TABLESPACE | |
DEFAULT_TABLESPACE | |
DISALLOWED_USER_AGENTS | |
EMAIL_BACKEND | |
EMAIL_HOST | |
EMAIL_HOST_PASSWORD | |
EMAIL_HOST_USER | |
EMAIL_PORT | |
EMAIL_SSL_CERTFILE | |
EMAIL_SSL_KEYFILE | |
EMAIL_SUBJECT_PREFIX | |
EMAIL_TIMEOUT | |
EMAIL_USE_LOCALTIME | |
EMAIL_USE_SSL | |
EMAIL_USE_TLS | |
FILE_CHARSET | |
FILE_UPLOAD_DIRECTORY_PERMISSIONS | |
FILE_UPLOAD_HANDLERS | |
FILE_UPLOAD_MAX_MEMORY_SIZE | |
FILE_UPLOAD_PERMISSIONS | |
FILE_UPLOAD_TEMP_DIR | |
FIRST_DAY_OF_WEEK | |
FIXTURE_DIRS | |
FORCE_SCRIPT_NAME | |
FORMAT_MODULE_PATH | |
FORM_RENDERER | |
IGNORABLE_404_URLS | |
INSTALLED_APPS | |
INTERNAL_IPS | |
LANGUAGES | |
LANGUAGES_BIDI | |
LANGUAGE_CODE | |
LANGUAGE_COOKIE_AGE | |
LANGUAGE_COOKIE_DOMAIN | |
LANGUAGE_COOKIE_NAME | |
LANGUAGE_COOKIE_PATH | |
LOCALE_PATHS | |
LOGGING | |
LOGGING_CONFIG | |
LOGIN_REDIRECT_URL | |
LOGIN_URL | |
LOGOUT_REDIRECT_URL | |
MANAGERS | |
MEDIA_ROOT | |
MEDIA_URL | |
MESSAGE_STORAGE | |
MIDDLEWARE | |
MIGRATION_MODULES | |
MONTH_DAY_FORMAT | |
NUMBER_GROUPING | |
PASSWORD_HASHERS | |
PASSWORD_RESET_TIMEOUT_DAYS | |
PREPEND_WWW | |
ROOT_URLCONF | |
SECRET_KEY | |
SECURE_BROWSER_XSS_FILTER | |
SECURE_CONTENT_TYPE_NOSNIFF | |
SECURE_HSTS_INCLUDE_SUBDOMAINS | |
SECURE_HSTS_PRELOAD | |
SECURE_HSTS_SECONDS | |
SECURE_PROXY_SSL_HEADER | |
SECURE_REDIRECT_EXEMPT | |
SECURE_SSL_HOST | |
SECURE_SSL_REDIRECT | |
SERVER_EMAIL | |
SESSION_CACHE_ALIAS | |
SESSION_COOKIE_AGE | |
SESSION_COOKIE_DOMAIN | |
SESSION_COOKIE_HTTPONLY | |
SESSION_COOKIE_NAME | |
SESSION_COOKIE_PATH | |
SESSION_COOKIE_SECURE | |
SESSION_ENGINE | |
SESSION_EXPIRE_AT_BROWSER_CLOSE | |
SESSION_FILE_PATH | |
SESSION_SAVE_EVERY_REQUEST | |
SESSION_SERIALIZER | |
SETTINGS_MODULE | |
SHORT_DATETIME_FORMAT | |
SHORT_DATE_FORMAT | |
SIGNING_BACKEND | |
SILENCED_SYSTEM_CHECKS | |
STATICFILES_DIRS | |
STATICFILES_FINDERS | |
STATICFILES_STORAGE | |
STATIC_ROOT | |
STATIC_URL | |
TEMPLATES | |
TEST_NON_SERIALIZED_APPS | |
TEST_RUNNER | |
THOUSAND_SEPARATOR | |
TIME_FORMAT | |
TIME_INPUT_FORMATS | |
TIME_ZONE | |
USE_ETAGS | |
USE_I18N | |
USE_L10N | |
USE_THOUSAND_SEPARATOR | |
USE_TZ | |
USE_X_FORWARDED_HOST | |
USE_X_FORWARDED_PORT | |
WSGI_APPLICATION | |
X_FRAME_OPTIONS | |
YEAR_MONTH_FORMAT |
You're seeing this error because you have
DEBUG = True
in your Django settings file. Change that to False
, and Django will display a standard page generated by the handler for this status code.Op 27 aug. 2018, om 17:18 heeft Jason <jjohns98684@gmail.com> het volgende geschreven:from django.contrib.auth.views import LoginView
No comments:
Post a Comment