Hi,
When confirming the email address after sign-up, I get this error:
--8<---------------cut here---------------start------------->8--- ERROR 2018-01-31 09:31:57,143 28537 django.request Internal Server Error: /accounts/confirm-email/Ng:1egno5:_T5eipR8TTan-zWjLK8EhYuetjQ/ Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.7/site-packages/django/views/generic/base.py", line 71, in view return self.dispatch(request, *args, **kwargs) File "/usr/lib/python2.7/site-packages/django/views/generic/base.py", line 89, in dispatch return handler(request, *args, **kwargs) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/views.py", line 283, in post resp = self.login_on_confirm(confirmation) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/views.py", line 332, in login_on_confirm redirect_url=self.get_redirect_url) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/utils.py", line 157, in perform_login get_login_redirect_url(request, redirect_url)) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/utils.py", line 50, in get_login_redirect_url url = url() File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/views.py", line 362, in get_redirect_url self.request) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/adapter.py", line 176, in get_email_confirmation_redirect_url return self.get_login_redirect_url(request) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/adapter.py", line 156, in get_login_redirect_url return resolve_url(url) File "/usr/lib/python2.7/site-packages/django/shortcuts.py", line 205, in resolve_url return urlresolvers.reverse(to, args=args, kwargs=kwargs) File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py", line 579, in reverse return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))) File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py", line 496, in _reverse_with_prefix (lookup_view_s, args, kwargs, len(patterns), patterns)) NoReverseMatch: Reverse for '' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] ERROR 2018-01-31 09:31:57,143 28537 django.request Internal Server Error: /accounts/confirm-email/Ng:1egno5:_T5eipR8TTan-zWjLK8EhYuetjQ/ Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.7/site-packages/django/views/generic/base.py", line 71, in view return self.dispatch(request, *args, **kwargs) File "/usr/lib/python2.7/site-packages/django/views/generic/base.py", line 89, in dispatch return handler(request, *args, **kwargs) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/views.py", line 283, in post resp = self.login_on_confirm(confirmation) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/views.py", line 332, in login_on_confirm redirect_url=self.get_redirect_url) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/utils.py", line 157, in perform_login get_login_redirect_url(request, redirect_url)) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/utils.py", line 50, in get_login_redirect_url url = url() File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/views.py", line 362, in get_redirect_url self.request) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/adapter.py", line 176, in get_email_confirmation_redirect_url return self.get_login_redirect_url(request) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/adapter.py", line 156, in get_login_redirect_url return resolve_url(url) File "/usr/lib/python2.7/site-packages/django/shortcuts.py", line 205, in resolve_url return urlresolvers.reverse(to, args=args, kwargs=kwargs) File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py", line 579, in reverse return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))) File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py", line 496, in _reverse_with_prefix (lookup_view_s, args, kwargs, len(patterns), patterns)) NoReverseMatch: Reverse for '' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] --8<---------------cut here---------------end--------------->8---
What could be the reason, and how could I solve this issue please?
Since it's perhaps related, here is my urls.py:
--8<---------------cut here---------------start------------->8--- from django.conf.urls import include, url from django.contrib import admin from postorius.views.list import list_index
urlpatterns = [ url(r'^postorius/', include('postorius.urls')), url(r'^archives/', include('hyperkitty.urls')), url(r'', include('django_mailman3.urls')), url(r'^accounts/', include('allauth.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^$', list_index, name='list_index'), ] --8<---------------cut here---------------end--------------->8---
TIA for any help,
Peter
ERROR 2018-01-31 09:31:57,143 28537 django.request Internal Server Error: /accounts/confirm-email/Ng:1egno5:_T5eipR8TTan-zWjLK8EhYuetjQ/ Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.7/site-packages/django/views/generic/base.py", line 71, in view return self.dispatch(request, *args, **kwargs) File "/usr/lib/python2.7/site-packages/django/views/generic/base.py", line 89, in dispatch return handler(request, *args, **kwargs) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/views.py", line 283, in post resp = self.login_on_confirm(confirmation) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/views.py", line 332, in login_on_confirm redirect_url=self.get_redirect_url) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/utils.py", line 157, in perform_login get_login_redirect_url(request, redirect_url)) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/utils.py", line 50, in get_login_redirect_url url = url() File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/views.py", line 362, in get_redirect_url self.request) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/adapter.py", line 176, in get_email_confirmation_redirect_url return self.get_login_redirect_url(request) File "/usr/lib/python2.7/site-packages/django_allauth-0.34.0-py2.7.egg/allauth/account/adapter.py", line 156, in get_login_redirect_url return resolve_url(url) File "/usr/lib/python2.7/site-packages/django/shortcuts.py", line 205, in resolve_url return urlresolvers.reverse(to, args=args, kwargs=kwargs) File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py", line 579, in reverse return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))) File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py", line 496, in _reverse_with_prefix (lookup_view_s, args, kwargs, len(patterns), patterns)) NoReverseMatch: Reverse for '' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] It's complaining about an empty url used for reversing. Do you mind sharing your settings.py file? we don't need the secret key and logins for stuff, so you can mask those. the rest should be ok to make public.
On Wed, Jan 31 2018, Simon Hanna wrote:
It's complaining about an empty url used for reversing. Do you mind sharing your settings.py file? we don't need the secret key and logins for stuff, so you can mask those. the rest should be ok to make public.
Ok, here are the settings (mainly from mailman-suite):
--8<---------------cut here---------------start------------->8--- import os BASE_DIR = os.path.dirname(os.path.abspath(__file__)) SECRET_KEY = 'xxx' DEBUG = False ADMINS = ( ('Mailman Suite Admin', 'root@localhost'), ) ALLOWED_HOSTS = [ "localhost", # Archiving API from Mailman, keep it. "x1", "x2", ] MAILMAN_REST_API_URL = 'http://localhost:8001' MAILMAN_REST_API_USER = 'x' MAILMAN_REST_API_PASS = 'y' MAILMAN_ARCHIVER_KEY = 'z' MAILMAN_ARCHIVER_FROM = ('127.0.0.1')
INSTALLED_APPS = ( 'hyperkitty', 'postorius', 'django_mailman3', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'paintstore', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount', )
MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'django_mailman3.middleware.TimezoneMiddleware', 'postorius.middleware.PostoriusMiddleware', )
ROOT_URLCONF = 'urls'
TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ '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.template.context_processors.csrf', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'django_mailman3.context_processors.common', 'hyperkitty.context_processors.common', 'postorius.context_processors.postorius', ], }, }, ]
WSGI_APPLICATION = 'wsgi.application'
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db/mailman.db'), } }
AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ]
LANGUAGE_CODE = 'fr' TIME_ZONE = 'Europe/Paris' USE_I18N = True USE_L10N = True USE_TZ = True STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATIC_URL = '/static/' STATICFILES_DIRS = ( ) STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'compressor.finders.CompressorFinder', )
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer' LOGIN_URL = 'account_login' LOGIN_REDIRECT_URL = '' LOGOUT_URL = 'account_logout' DEFAULT_FROM_EMAIL = 'abc' SERVER_EMAIL = 'abc' from django.contrib.messages import constants as messages # flake8: noqa MESSAGE_TAGS = { messages.ERROR: 'danger' } AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', 'allauth.account.auth_backends.AuthenticationBackend', ) ACCOUNT_AUTHENTICATION_METHOD = "username_email" ACCOUNT_EMAIL_REQUIRED = True ACCOUNT_EMAIL_VERIFICATION = "mandatory" ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION = True ACCOUNT_LOGIN_ON_PASSWORD_RESET = True ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https" ACCOUNT_UNIQUE_EMAIL = True
SOCIALACCOUNT_PROVIDERS = { 'openid': { 'SERVERS': [ dict(id='yahoo', name='Yahoo', openid_url='http://me.yahoo.com'), ], }, 'google': { 'SCOPE': ['profile', 'email'], 'AUTH_PARAMS': {'access_type': 'online'}, }, 'facebook': { 'METHOD': 'oauth2', 'SCOPE': ['email'], 'FIELDS': [ 'email', 'name', 'first_name', 'last_name', 'locale', 'timezone', ], 'VERSION': 'v2.4', }, } COMPRESS_PRECOMPILERS = ( ('text/less', 'lessc {infile} {outfile}'), ('text/x-scss', 'sassc -t compressed {infile} {outfile}'), ('text/x-sass', 'sassc -t compressed {infile} {outfile}'), ) COMPRESS_OFFLINE = True HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', 'PATH': os.path.join(BASE_DIR, "fulltext_index"), }, } REST_FRAMEWORK = { 'DEFAULT_FILTER_BACKENDS': ( 'rest_framework.filters.OrderingFilter', ), } Q_CLUSTER = { 'timeout': 300, 'save_limit': 100, 'orm': 'default', } LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'filters': { 'require_debug_false': { '()': 'django.utils.log.RequireDebugFalse' } }, 'handlers': { 'mail_admins': { 'level': 'ERROR', 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler' }, 'file':{ 'level': 'INFO', #'class': 'logging.handlers.RotatingFileHandler', 'class': 'logging.handlers.WatchedFileHandler', 'filename': os.path.join(BASE_DIR, 'logs', 'mailman.log'), 'formatter': 'verbose', }, 'console': { 'class': 'logging.StreamHandler', 'formatter': 'simple', }, }, 'loggers': { 'django.request': { 'handlers': ['mail_admins', 'file'], 'level': 'ERROR', 'propagate': True, }, 'django': { 'handlers': ['file'], 'level': 'ERROR', 'propagate': True, }, 'hyperkitty': { 'handlers': ['file'], 'level': 'DEBUG', 'propagate': True, }, 'postorius': { 'handlers': ['console', 'file'], 'level': 'INFO', }, }, 'formatters': { 'verbose': { 'format': '%(levelname)s %(asctime)s %(process)d %(name)s %(message)s' }, 'simple': { 'format': '%(levelname)s %(message)s' }, }, } if DEBUG == True: EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend' EMAIL_FILE_PATH = os.path.join(BASE_DIR, 'emails')
FILTER_VHOST = True
try: from settings_local import * except ImportError: pass --8<---------------cut here---------------end--------------->8---
-- Peter
On 01/31/2018 11:59 AM, Peter Münster wrote:
On Wed, Jan 31 2018, Simon Hanna wrote:
It's complaining about an empty url used for reversing. Do you mind sharing your settings.py file? we don't need the secret key and logins for stuff, so you can mask those. the rest should be ok to make public. Ok, here are the settings (mainly from mailman-suite):
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer' LOGIN_URL = 'account_login' LOGIN_REDIRECT_URL = '' LOGOUT_URL = 'account_logout' I guess that's the issue. Try using something else for LOGIN_REDIRECT_URL
It should either be a valid path so "/postorius/" for instance or a valid view name like "list_index"
On Wed, Jan 31 2018, Simon Hanna wrote:
LOGIN_REDIRECT_URL = ''
I guess that's the issue. Try using something else for LOGIN_REDIRECT_URL
Indeed, you're right, thank you!
It should either be a valid path so "/postorius/" for instance or a valid view name like "list_index"
'/' works well for me.
-- Peter
participants (2)
-
Peter Münster
-
Simon Hanna