Closed balkantechnologies closed 8 years ago
@balkantechnologies this should be already fixed on master branch
EDIT: I downgraded the packages ans registrations is working smoothly.
@mateusz-sikora I'm getting the same problem, can't register users, it was working fine but I upgraded my pip packages, specifically: Django==1.8.6 (from 1.8.5) django-allauth==0.24.1 (from 0.23.0) djangorestframework==3.3.1 (from 3.2.4) python3-openid==3.0.9 (from 3.0.7)
Can't really tell what broke it, I just get a:
[17/Nov/2015 11:13:35] ERROR [django.request:256] Internal Server Error: /rest-auth/registration/ Traceback (most recent call last): File "/home/javebratt/Development/MLMEvents/venv/lib/python3.4/site-packages/django/core/handlers/base.py", line 132, in get_response response = wrapped_callback(request, _callback_args, _callback_kwargs) File "/home/javebratt/Development/MLMEvents/venv/lib/python3.4/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view return view_func(_args, _kwargs) File "/home/javebratt/Development/MLMEvents/venv/lib/python3.4/site-packages/django/views/generic/base.py", line 71, in view return self.dispatch(request, _args, _kwargs) File "/home/javebratt/Development/MLMEvents/venv/lib/python3.4/site-packages/rest_framework/views.py", line 466, in dispatch response = self.handle_exception(exc) File "/home/javebratt/Development/MLMEvents/venv/lib/python3.4/site-packages/rest_framework/views.py", line 463, in dispatch response = handler(request, _args, _kwargs) File "/home/javebratt/Development/MLMEvents/venv/lib/python3.4/site-packages/rest_auth/registration/views.py", line 54, in post self.request.POST = self.request.data.copy() AttributeError: can't set attribute
I got the same error if I use pip install django-rest-auth.
@javebratt, clone the master and install locally did fix the issue.
@ZachLiuGIS Actually for me it wasn't that, django-rest-auth is working, the problem was my version of django-allauth, version 0.24.1 didn't work, but with 0.23.0 it works
+1
Today I upgraded to DRF 3.3.1 (from 3.2.3, that the registration was working fine) and got same issue as @balkantechnologies mentions it. Tried to locate where it breaks and the line that fails is this (in rest_auth/registration/views.py Line 54):
self.request.POST = self.request.data.copy()
If you take a look into the Release Notes for DRF here: http://www.django-rest-framework.org/topics/release-notes/#33x-series
There was a change regarding accessing .POST method in DRF 3.3.1
So I am wondering if this issue has occurred because of this change in 3.3.1 DRF (this specific change was related to this bug so I made my question there as well):
https://github.com/tomchristie/django-rest-framework/pull/3592
ok missed the comment from @mateusz-sikora removed rest-auth with pip uninstall and cloned the updated source
now it works smoothly :)
One question only, will there be this fix to default rest-auth package as installed with pip? Current rest-auth 0.5.0 is the buggy version..
Thanks anyway :)
+1 Please update the version I am installing via pip
0.6.0 has been released. Closing.
When trying to register a new user, the following error occurs:
Here is the log:
AttributeError at /api/auth/registration/ can't set attribute Request Method: POST Request URL: http://127.0.0.1:8000/api/auth/registration/ Django Version: 1.8.6 Exception Type: AttributeError Exception Value: can't set attribute Exception Location: /Users/bt/Development/Python/env/vremind/lib/python2.7/site-packages/rest_auth/registration/views.py in post, line 54 Python Executable: /Users/bt/Development/Python/env/vremind/bin/python Python Version: 2.7.10 Python Path: ['/Users/bt/Development/Python/projects/vremind', '/Users/bt/Development/Python/env/vremind/lib/python27.zip', '/Users/bt/Development/Python/env/vremind/lib/python2.7', '/Users/bt/Development/Python/env/vremind/lib/python2.7/plat-darwin', '/Users/bt/Development/Python/env/vremind/lib/python2.7/plat-mac', '/Users/bt/Development/Python/env/vremind/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/bt/Development/Python/env/vremind/Extras/lib/python', '/Users/bt/Development/Python/env/vremind/lib/python2.7/lib-tk', '/Users/bt/Development/Python/env/vremind/lib/python2.7/lib-old', '/Users/bt/Development/Python/env/vremind/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/bt/Development/Python/env/vremind/lib/python2.7/site-packages'] Server time: Tue, 10 Nov 2015 12:52:47 +0000 Traceback Switch to copy-and-paste view /Users/bt/Development/Python/env/vremind/lib/python2.7/site-packages/django/core/handlers/base.py in get_response
If the view raised an exception, run it through exception
middleware, and if the exception middleware returns a
response, use that. Otherwise, reraise the exception.
We could just do view_func.csrf_exempt = True, but decorators
are nicer if they don't have side-effects, so we return a new
function.
take name and docstring from class
and possible attributes set by decorators
like csrf_exempt from dispatch
Get the appropriate handler method
Request information GET No GET data POST No POST data FILES No FILES data COOKIES No cookie data META Variable Value wsgi.version (1, 0) wsgi.multiprocess False RUN_MAIN 'true' HTTP_REFERER 'http://127.0.0.1:9000/' VERSIONER_PYTHON_PREFER_32_BIT 'no' SERVER_SOFTWARE 'WSGIServer/0.1 Python/2.7.10' LC_CTYPE 'UTF-8' TERM_PROGRAM_VERSION '361' REQUEST_METHOD 'POST' LOGNAME 'bt' USER 'bt' HTTP_ORIGIN 'http://127.0.0.1:9000' PATH '/Users/bt/Development/Python/env/vremind/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' QUERY_STRING '' HOME '/Users/bt' PS1 '(vremind)\h:\W \u\$ ' wsgi.errors <open file '', mode 'w' at 0x10821b1e0>
TERM_PROGRAM
'Apple_Terminal'
CONTENT_LENGTH
'90'
TERM
'xterm-256color'
SHELL
'/bin/bash'
TZ
'UTC'
SERVER_NAME
'arjans-macbook-pro.local'
VERSIONER_PYTHON_VERSION
'2.7'
SHLVL
'1'
SECURITYSESSIONID
'186ef'
XPC_FLAGS
'0x0'
wsgi.urlscheme
'http'
'./manage.py'
SERVER_PORT
'8000'
PATH_INFO
u'/api/auth/registration/'
TERM_SESSION_ID
'5A515916-B6DD-444F-BC1E-2437D91FAA6A'
SSH_AUTH_SOCK
'/private/tmp/com.apple.launchd.i6vX1PgOaQ/Listeners'
XPC_SERVICE_NAME
'0'
VIRTUAL_ENV
'/Users/bt/Development/Python/env/vremind'
wsgi.input
<socket._fileobject object at 0x109336e50>
Apple_PubSub_Socket_Render
'/private/tmp/com.apple.launchd.iMKDGiE1AR/Render'
HTTP_HOST
'127.0.0.1:8000'
SCRIPT_NAME
u''
wsgi.multithread
True
HTTP_CONNECTION
'keep-alive'
TMPDIR
'/var/folders/mj/wn1t2_0d6kx8vyvm_5175_l00000gp/T/'
HTTPACCEPT
'application/json, text/plain, /_'
NVM_IOJS_ORG_MIRROR
'https://iojs.org/dist'
HTTP_USER_AGENT
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36'
GATEWAY_INTERFACE
'CGI/1.1'
wsgi.run_once
False
CSRF_COOKIE
u'fyGGuiDUy1ZLZLu3epk9owOTiqxe0UHb'
OLDPWD
'/Users/bt/Development/Python/projects'
REMOTE_ADDR
'127.0.0.1'
HTTP_ACCEPT_LANGUAGE
'en-US,en;q=0.8'
__CF_USER_TEXT_ENCODING
'0x1F6:0x0:0x0'
PWD
'/Users/bt/Development/Python/projects/vremind'
SERVER_PROTOCOL
'HTTP/1.1'
DJANGO_SETTINGS_MODULE
'vremind.settings'
CONTENT_TYPE
'application/json;charset=UTF-8'
wsgi.file_wrapper
''
REMOTE_HOST
''
HTTP_ACCEPT_ENCODING
'gzip, deflate'
NVM_RC_VERSION
''
NVM_NODEJS_ORG_MIRROR
'https://nodejs.org/dist'
Settings
Using settings module vremind.settings
Setting
Value
SECURE_BROWSER_XSS_FILTER
False
USE_THOUSAND_SEPARATOR
False
ACCOUNT_AUTHENTICATION_METHOD
'email'
CSRF_COOKIE_SECURE
False
LANGUAGE_CODE
'en-us'
ROOT_URLCONF
'vremind.urls'
MANAGERS
()
BASE_DIR
'/Users/bt/Development/Python/projects/vremind'
SILENCED_SYSTEM_CHECKS
[]
DEFAULT_CHARSET
'utf-8'
SESSION_SERIALIZER
'django.contrib.sessions.serializers.JSONSerializer'
ACCOUNT_EMAIL_REQUIRED
True
ALLOWED_HOSTS
[]
MESSAGE_STORAGE
'django.contrib.messages.storage.fallback.FallbackStorage'
EMAIL_SUBJECT_PREFIX
'[Django] '
SERVER_EMAIL
'root@localhost'
SECURE_HSTS_SECONDS
0
STATICFILES_FINDERS
('django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder')
SESSION_CACHE_ALIAS
'default'
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_NAME
'sessionid'
TIME_INPUT_FORMATS
('%H:%M:%S', '%H:%M:%S.%f', '%H:%M')
SECURE_REDIRECT_EXEMPT
[]
DATABASES
{'default': {'ATOMIC_REQUESTS': False,
'AUTOCOMMIT': True,
'CONN_MAXAGE': 0,
'ENGINE': 'django.db.backends.sqlite3',
'HOST': '',
'NAME': '/Users/bt/Development/Python/projects/vremind/db.sqlite3',
'OPTIONS': {},
'PASSWORD': u'***',
'PORT': '',
'TEST': {'CHARSET': None,
'COLLATION': None,
'MIRROR': None,
'NAME': None},
'TIME_ZONE': 'UTC',
'USER': ''}}
EMAIL_SSLKEYFILE
u'******_'
FILE_UPLOAD_DIRECTORY_PERMISSIONS
None
FILE_UPLOAD_PERMISSIONS
None
FILE_UPLOAD_HANDLERS
('django.core.files.uploadhandler.MemoryFileUploadHandler',
'django.core.files.uploadhandler.TemporaryFileUploadHandler')
TEMPLATE_CONTEXT_PROCESSORS
('django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages')
DEFAULT_CONTENT_TYPE
'text/html'
ACCOUNT_EMAIL_VERIFICATION
'mandatory'
APPEND_SLASH
True
LOCALE_PATHS
()
DATABASE_ROUTERS
[]
DEFAULT_TABLESPACE
''
YEAR_MONTH_FORMAT
'F Y'
STATICFILES_STORAGE
'django.contrib.staticfiles.storage.StaticFilesStorage'
CACHES
{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
SESSION_COOKIE_PATH
'/'
SECURE_CONTENT_TYPE_NOSNIFF
False
MIDDLEWARE_CLASSES
('corsheaders.middleware.CorsMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware')
USE_I18N
True
THOUSAND_SEPARATOR
','
SECRETKEY
u'******_'
LANGUAGE_COOKIE_NAME
'django_language'
DEFAULT_INDEX_TABLESPACE
''
LOGGING_CONFIG
'logging.config.dictConfig'
TEMPLATE_LOADERS
('django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader')
FIRST_DAY_OF_WEEK
0
WSGI_APPLICATION
'vremind.wsgi.application'
TEMPLATE_DEBUG
False
X_FRAME_OPTIONS
'SAMEORIGIN'
CSRF_COOKIE_NAME
'csrftoken'
FORCE_SCRIPT_NAME
None
USE_X_FORWARDED_HOST
False
EMAIL_TIMEOUT
None
SECURE_SSL_HOST
None
SIGNING_BACKEND
'django.core.signing.TimestampSigner'
SESSION_COOKIE_SECURE
False
CSRF_COOKIE_DOMAIN
None
FILE_CHARSET
'utf-8'
DEBUG
True
LANGUAGE_COOKIE_DOMAIN
None
DEFAULT_FILE_STORAGE
'django.core.files.storage.FileSystemStorage'
INSTALLED_APPS
('modeltranslation',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'rest_framework.authtoken',
'rest_auth',
'allauth',
'allauth.account',
'rest_auth.registration',
'corsheaders',
'companies')
LANGUAGES
(('en', 'English'), ('nl', 'Dutch'))
USE_L10N
True
STATIC_ROOT
None
SECURE_HSTS_INCLUDE_SUBDOMAINS
False
STATICFILES_DIRS
()
PREPEND_WWW
False
SECURE_PROXY_SSL_HEADER
None
LANGUAGE_COOKIE_AGE
None
SESSION_COOKIE_HTTPONLY
True
DEBUG_PROPAGATE_EXCEPTIONS
False
CSRF_COOKIE_AGE
31449600
MONTH_DAY_FORMAT
'F j'
LOGIN_URL
'/accounts/login/'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
TIME_FORMAT
'P'
AUTH_USER_MODEL
'auth.User'
DATE_INPUT_FORMATS
('%Y-%m-%d',
'%m/%d/%Y',
'%m/%d/%y',
'%b %d %Y',
'%b %d, %Y',
'%d %b %Y',
'%d %b, %Y',
'%B %d %Y',
'%B %d, %Y',
'%d %B %Y',
'%d %B, %Y')
AUTHENTICATION_BACKENDS
('django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend')
EMAIL_HOSTPASSWORD
u'******_'
PASSWORD_RESET_TIMEOUTDAYS
u'******_'
SESSION_FILE_PATH
None
CACHE_MIDDLEWARE_ALIAS
'default'
SESSION_SAVE_EVERY_REQUEST
False
NUMBER_GROUPING
0
SESSION_ENGINE
'django.contrib.sessions.backends.db'
CSRF_FAILURE_VIEW
'django.views.csrf.csrf_failure'
CSRF_COOKIE_PATH
'/'
LOGIN_REDIRECT_URL
'/accounts/profile/'
DECIMAL_SEPARATOR
'.'
IGNORABLE_404_URLS
()
MIGRATION_MODULES
{}
PASSWORDHASHERS
u'******_'
TEMPLATE_STRING_IF_INVALID
''
LOGOUT_URL
'/accounts/logout/'
EMAIL_USE_TLS
True
FIXTURE_DIRS
()
EMAIL_HOST
'mail.vertinum.eu'
DATE_FORMAT
'N j, Y'
MEDIA_ROOT
''
DEFAULT_EXCEPTION_REPORTER_FILTER
'django.views.debug.SafeExceptionReporterFilter'
ADMINS
()
FORMAT_MODULE_PATH
None
DEFAULT_FROM_EMAIL
'noreply@vertinum.eu'
REST_FRAMEWORK
{'DEFAULT_AUTHENTICATION_CLASSES': ('rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication'),
'DEFAULT_PERMISSION_CLASSES': ['rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly']}
MEDIA_URL
''
DATETIME_FORMAT
'N j, Y, P'
TEMPLATE_DIRS
()
SITE_ID
1
DISALLOWED_USER_AGENTS
()
ALLOWED_INCLUDE_ROOTS
()
LOGGING
{}
SHORT_DATE_FORMAT
'm/d/Y'
TEMPLATES
[{'APP_DIRS': True,
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'OPTIONS': {'context_processors': ['django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages']}}]
TEST_RUNNER
'django.test.runner.DiscoverRunner'
CACHE_MIDDLEWARE_KEYPREFIX
u'*******'
SECURE_SSL_REDIRECT
False
TIME_ZONE
'UTC'
CORS_ORIGIN_ALLOW_ALL
True
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
EMAIL_BACKEND
'django.core.mail.backends.console.EmailBackend'
EMAIL_USE_SSL
False
CRISPY_TEMPLATE_PACK
'bootstrap3'
REST_AUTH_SERIALIZERS
{'USER_DETAILS_SERIALIZER': 'companies.serializers.UserSerializer'}
SESSION_COOKIE_AGE
1209600
SETTINGS_MODULE
'vremind.settings'
USE_ETAGS
False
LANGUAGES_BIDI
('he', 'ar', 'fa', 'ur')
FILE_UPLOAD_TEMP_DIR
None
INTERNAL_IPS
()
STATIC_URL
'/static/'
EMAIL_PORT
587
USE_TZ
True
SHORT_DATETIME_FORMAT
'm/d/Y P'
TEST_NON_SERIALIZED_APPS
[]
MODELTRANSLATION_DEFAULT_LANGUAGE
'en'
ABSOLUTE_URL_OVERRIDES
{}
LANGUAGE_COOKIE_PATH
'/'
CACHE_MIDDLEWARE_SECONDS
600
EMAIL_SSL_CERTFILE
None
CSRF_COOKIE_HTTPONLY
False
DATETIME_INPUT_FORMATS
('%Y-%m-%d %H:%M:%S',
'%Y-%m-%d %H:%M:%S.%f',
'%Y-%m-%d %H:%M',
'%Y-%m-%d',
'%m/%d/%Y %H:%M:%S',
'%m/%d/%Y %H:%M:%S.%f',
'%m/%d/%Y %H:%M',
'%m/%d/%Y',
'%m/%d/%y %H:%M:%S',
'%m/%d/%y %H:%M:%S.%f',
'%m/%d/%y %H:%M',
'%m/%d/%y')
EMAIL_HOST_USER
'vreminders'
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.