Open diegovargasf opened 6 years ago
Disregard, I just had to add: "django.contrib.auth.backends.ModelBackend" to my authentication backends
I'm fairly sure this should still be open, as its a bug that does need to be fixed with the template.
I hit this as well on a project; I'm wondering if https://django-user-accounts.readthedocs.io/en/latest/usage.html#using-email-address-for-authentication needs to be updated to ensure that we are adding additional backends to AUTHENTICATION_BACKENDS
, rather than overwriting the default setting (which has django.contrib.auth.backends.ModelBackend
)
Hello, I followed the instructions here:http://pinaxproject.com/pinax/quick_start/ mainly: pip install virtualenv virtualenv mysiteenv source mysiteenv/bin/activate pip install pinax-cli pinax start account mysite
cd mysite npm install pip install -r requirements.txt ./manage.py migrate ./manage.py loaddata sites npm run dev
And when I tried to sign up a new user, after sending the form, I received this error: Exception Type: AttributeError at /account/signup/ Exception Value: 'AnonymousUser' object has no attribute '_meta'
---------------------------------STACKTRACE COPY------------------------------------- Environment: Request Method: POST Request URL: //localhost:3000/account/signup/
Django Version: 2.1.1 Python Version: 3.6.2 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.messages', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.staticfiles', 'bootstrapform', 'pinax.templates', 'account', 'pinax.eventlog', 'pinax.webanalytics', 'mysite'] Installed Middleware: ['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 "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/django/views/generic/base.py" in view
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/django/utils/decorators.py" in _wrapper
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/django/views/decorators/debug.py" in sensitive_post_parameters_wrapper
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/django/utils/decorators.py" in _wrapper
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/django/utils/decorators.py" in _wrapped_view
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/django/utils/decorators.py" in _wrapper
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/account/views.py" in dispatch
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/django/views/generic/base.py" in dispatch
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/account/views.py" in post
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/django/views/generic/edit.py" in post
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/account/views.py" in form_valid
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/account/views.py" in login_user
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/django/contrib/auth/init.py" in login
File "/Users/diegovargas/myproject/mysiteenv/lib/python3.6/site-packages/django/utils/functional.py" in inner
Exception Type: AttributeError at /account/signup/ Exception Value: 'AnonymousUser' object has no attribute '_meta' ---------------------------------STACKTRACE COPY END-------------------------------------
Am I missing something?