I have installed django-avatar and django-notification (django-avatar uses django-notification, if the latter is installed, in order to send necessary messages to user).
However when I upload/change/delete my avatar I get this error:
Request Method: POST
Request URL: http://localhost:8000/avatar/change/
Django Version: 1.3
Python Version: 2.6.4
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'grappelli',
'filebrowser',
'tinymce',
'south',
'avatar',
'django.contrib.admin',
'notification',
'tipleaders.main']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "C:\Tools\Python26\lib\site-packages\django\core\handlers\base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "C:\Tools\Python26\lib\site-packages\django\contrib\auth\decorators.py" in _wrapped_view
23. return view_func(request, *args, **kwargs)
File "C:\Tools\Python26\lib\site-packages\django_avatar-1.0.5-py2.6.egg\avatar\views.py" in change
77. notification.send([request.user], "avatar_updated", {"user": request.user, "avatar": avatar})
File "C:\Tools\Python26\lib\site-packages\django_notification-0.2-py2.6.egg\notification\models.py" in send
351. return send_now(*args, **kwargs)
File "C:\Tools\Python26\lib\site-packages\django_notification-0.2-py2.6.egg\notification\models.py" in send_now
276. reverse("notification_notices"),
File "C:\Tools\Python26\lib\site-packages\django\core\urlresolvers.py" in reverse
391. *args, **kwargs)))
File "C:\Tools\Python26\lib\site-packages\django\core\urlresolvers.py" in reverse
337. "arguments '%s' not found." % (lookup_view_s, args, kwargs))
Exception Type: NoReverseMatch at /avatar/change/
Exception Value: Reverse for 'notification_notices' with arguments '()' and keyword arguments '{}' not found.
django-avatar worked neatly just before django-notification was installed.
What went wrong?
URL notification_notices does not exist. Install django-notification urls, add to urls.py:
url('notification/', include('notification.urls')),
I recommend that you review your installation of django-notification.
Related
I am trying to display a two line error message to a user. All attempts I have made have failed and I cannot figure this out, despite searching SO & google.
The error I am getting is:
Exception Type: IndexError
Exception Value: tuple index out of range
The issue seems to be the use of the format_html() with the string_concat().
Here is my python code:
from django.utils import translation
from django.utils.html import format_html
from django.utils.translation import string_concat
from django.utils.translation import ugettext_lazy as _
....
if not request.user.is_staff and language_versions_num_enabled > max_languages:
error_message = format_html(
string_concat(
_(u'You are only permitted <b>{}</b> <u>enabled</u> Language Versions for the selected <b>{}</b> subscription plan.'),
' <icon class="fa fa-frown-o icon_size26 icon_padding"></icon>',
'<br /><br />',
_(u'Either select a different subscription plan or disable <b>{}</b> of your <b>{}</b> <u>enabled</u> Language Versions.'.format(max_languages, stripe_plan['title'], language_versions_num_enabled-max_languages, language_versions_num_enabled))
)
)
messages.add_message(request, messages.ERROR, error_message)
else:
I am really hoping someone can point out what I am doing wrong here.
EDIT
I am using django 1.10 and python 3.5.2.
Here is the stack trace:
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/subscription/subscription/
Django Version: 1.10.5
Python Version: 3.5.2
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.humanize',
'django.contrib.messages',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'admin_honeypot',
'axes',
'rest_framework',
'rest_framework.authtoken',
'captcha',
'my_app.contact',
'djstripe',
'my_app.common',
'my_app.users',
'my_app.core',
'imagekit',
'parsley',
'registration',
'templatetag_handlebars',
'settings_context_processor',
'crispy_forms',
'lockdown',
'rosetta',
'raven.contrib.django.raven_compat')
Installed Middleware:
('raven.contrib.django.middleware.SentryMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'my_app.users.middleware.LocaleOverrideMiddleware',
'django.middleware.locale.LocaleMiddleware',
'my_app.users.middleware.AdminLocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'lockdown.middleware.LockdownMiddleware')
Traceback:
File "C:\Users\laptop\desktop\my_app\env3\lib\site-packages\django\core\handlers\exception.py" in inner
39. response = get_response(request)
File "C:\Users\laptop\desktop\my_app\env3\lib\site-packages\django\core\handlers\base.py" in _legacy_get_response
249. response = self._get_response(request)
File "C:\Users\laptop\desktop\my_app\env3\lib\site-packages\django\core\handlers\base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "C:\Users\laptop\desktop\my_app\env3\lib\site-packages\django\core\handlers\base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\laptop\desktop\my_app\env3\lib\site-packages\django\contrib\auth\decorators.py" in _wrapped_view
23. return view_func(request, *args, **kwargs)
File "C:\Users\laptop\desktop\my_app\env3\lib\site-packages\django\views\decorators\http.py" in inner
40. return func(request, *args, **kwargs)
File "C:\Users\laptop\desktop\my_app\my_app\core\decorators.py" in wrapper
21. return f(request, *args, **kwargs)
File "C:\Users\laptop\desktop\my_app\my_app\core\views\user_settings_views.py" in subscription
402. _(u'Either select a different subscription plan or disable <b>{}</b> of your <b>{}</b> <u>enabled</u> Language Versions.'.format(max_languages, stripe_plan['title'], language_versions_num_enabled-max_languages, language_versions_num_enabled))
File "C:\Users\laptop\desktop\my_app\env3\lib\site-packages\django\utils\html.py" in format_html
106. return mark_safe(format_string.format(*args_safe, **kwargs_safe))
File "C:\Users\laptop\desktop\my_app\env3\lib\site-packages\django\utils\functional.py" in __wrapper__
112. return getattr(res, method_name)(*args, **kw)
Exception Type: IndexError at /subscription/subscription/
Exception Value: tuple index out of range
You put format in the wrong place. Try this:
error_message = format_html(
string_concat(
_(u'You are only permitted <b>{}</b> <u>enabled</u> Language Versions for the selected <b>{}</b> subscription plan.'),
' <icon class="fa fa-frown-o icon_size26 icon_padding"></icon>',
'<br /><br />',
_(u'Either select a different subscription plan or disable <b>{}</b> of your <b>{}</b> <u>enabled</u> Language Versions.')
).format(max_languages, stripe_plan['title'], language_versions_num_enabled-max_languages, language_versions_num_enabled)
)
ive just upgraded Django from 1.9 to 1.10. i run 1.10 in my test environment and ironed out any upgrade issues to make sure it all worked.
however when ive gone to do it on my live site and gone to load the home page i get the errors below
Environment:
Request Method: GET
Request URL: http://it.local.com/
Django Version: 1.10.5
Python Version: 2.7.5
Installed Applications:
('home.apps.HomeConfig',
'oncall.apps.OncallConfig',
'tools.apps.ToolsConfig',
'sites.apps.SitesConfig',
'maintenance.apps.MaintenanceConfig',
'service.apps.ServiceConfig',
'management.apps.ManagementConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'bootstrap_pagination',
'easy_thumbnails')
Installed Middleware:
('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',
'debug_toolbar.middleware.DebugToolbarMiddleware')
Traceback:
File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
39. response = get_response(request)
File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response
249. response = self._get_response(request)
File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/var/www/infternal/home/views.py" in index
13. return render(request, 'home/index.html', {"user": user})
File "/usr/lib/python2.7/site-packages/django/shortcuts/__init__.py" in render
49. context_instance = RequestContext(request, current_app=current_app)
Exception Type: TypeError at /
Exception Value: __init__() got an unexpected keyword argument 'current_app'
It looks like you haven't installed Django 1.10 properly. The line from the traceback context_instance = RequestContext(request, current_app=current_app) does not exist in Django 1.10. I would try uninstalling and reinstalling Django, and then restarting the server.
My Geocode application which is based on Django is no longer serving properly, and I am getting the error detailed as follows:
Environment:
Request Method: GET
Request URL: http://52.36.3.179/
Django Version: 1.6.11
Python Version: 2.7.6
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'django.contrib.messages',
'django.contrib.humanize',
'django.contrib.gis',
'pagination',
'taggit',
'friendlytagloader',
'geoexplorer',
'leaflet',
'django_extensions',
'autocomplete_light',
'mptt',
'modeltranslation',
'djcelery',
'pinax_theme_bootstrap_account',
'pinax_theme_bootstrap',
'django_forms_bootstrap',
'account',
'avatar',
'dialogos',
'agon_ratings',
'announcements',
'actstream',
'user_messages',
'tastypie',
'polymorphic',
'guardian',
'geonode.people',
'geonode.base',
'geonode.layers',
'geonode.maps',
'geonode.proxy',
'geonode.security',
'geonode.social',
'geonode.catalogue',
'geonode.documents',
'geonode.api',
'geonode.groups',
'geonode.services',
'geonode.geoserver',
'geonode.upload',
'geonode.tasks')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'pagination.middleware.PaginationMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')
Traceback:
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
137. response = response.render()
File "/usr/lib/python2.7/dist-packages/django/template/response.py" in render
105. self.content = self.rendered_content
File "/usr/lib/python2.7/dist-packages/django/template/response.py" in rendered_content
81. context = self.resolve_context(self.context_data)
File "/usr/lib/python2.7/dist-packages/django/template/response.py" in resolve_context
159. return RequestContext(self._request, context, current_app=self._current_app)
File "/usr/lib/python2.7/dist-packages/django/template/context.py" in __init__
169. self.update(processor(request))
File "/usr/local/lib/python2.7/dist-packages/geonode/context_processors.py" in resource_urls
28. site = Site.objects.get_current()
File "/usr/lib/python2.7/dist-packages/django/contrib/sites/models.py" in get_current
47. current_site = self.get(pk=sid)
File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py" in get
151. return self.get_queryset().get(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/db/models/query.py" in get
310. self.model._meta.object_name)
Exception Type: DoesNotExist at /
Exception Value: Site matching query does not exist.
I can provide more configuration settings if need be. Please don't hesitate to ask. I am trying to not have to reinstall the application. This problem happened after I reloaded the server in order to update the correct URL.
I upgraded django and all apps I was using to the recent version but because of the huge changes made between djangorestframework 0.4.0 and 3.3.0 I've returned to 0.4.0 and opted to fix the simpler issue it had importing json from django.utils and edited it to import json now I'm getting an error templatedoesnotexist
Environment:
Request Method: GET
Request URL: http://kbuzz.webfactional.com/rest/movies/?device=browser
Django Version: 1.7.10
Python Version: 2.7.9
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.redirects',
'django.contrib.humanize',
'autocomplete_light',
'rest_framework',
'haystack',
'lamusoftware.generic',
'mptt',
'bootstrapform',
'sorl.thumbnail',
'oauth2client',
'articles',
'banners',
'common',
'directory',
'events',
'galleries',
'marketplace',
'movies',
'pages',
'profiles',
'search',
'stats',
'minidetector',
'mobile',
'reports',
'favorites',
'braces',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.facebook',
'widget_tweaks',
'wordofmouth',
'ckeditor',
'django_mobile',
'debug_toolbar',
'markup_deprecated')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
'minidetector.Middleware',
'mobileesp.middleware.MobileDetectionMiddleware',
'kb.middleware.log_ip_middleware.SetRemoteAddrFromForwardedFor',
'kb.middleware.log_ip_middleware.RedirectMovie')
Template Loader Error:
Django tried loading these templates, in this order:
Using loader django_mobile.loader.Loader:
Using loader django.template.loaders.filesystem.Loader:
/home/kbuzz/webapps/kenyabuzz/kb/kb/templates/djangorestframework/api.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/home/kbuzz/webapps/kenyabuzz/lib/python2.7/Django-1.7.10-py2.7.egg/django/contrib/auth/templates/djangorestframework/api.html (File does not exist)
/home/kbuzz/webapps/kenyabuzz/lib/python2.7/Django-1.7.10-py2.7.egg/django/contrib/sitemaps/templates/djangorestframework/api.html (File does not exist)
/home/kbuzz/webapps/kenyabuzz/lib/python2.7/Django-1.7.10-py2.7.egg/django/contrib/admin/templates/djangorestframework/api.html (File does not exist)
/home/kbuzz/webapps/django/lib/python2.7/autocomplete_light/templates/djangorestframework/api.html (File does not exist)
/home/kbuzz/webapps/django/lib/python2.7/rest_framework/templates/djangorestframework/api.html (File does not exist)
/home/kbuzz/lib/python2.7/haystack/templates/djangorestframework/api.html (File does not exist)
/home/kbuzz/webapps/django/lib/python2.7/mptt/templates/djangorestframework/api.html (File does not exist)
/home/kbuzz/lib/python2.7/bootstrapform/templates/djangorestframework/api.html (File does not exist)
/home/kbuzz/webapps/kenyabuzz/kb/reports/templates/djangorestframework/api.html (File does not exist)
/home/kbuzz/webapps/kenyabuzz/kb/favorites/templates/djangorestframework/api.html (File does not exist)
/home/kbuzz/webapps/django/lib/python2.7/allauth/templates/djangorestframework/api.html (File does not exist)
/home/kbuzz/webapps/django/lib/python2.7/allauth/socialaccount/providers/facebook/templates/djangorestframework/api.html (File does not exist)
/home/kbuzz/webapps/kenyabuzz/kb/wordofmouth/templates/djangorestframework/api.html (File does not exist)
/home/kbuzz/lib/python2.7/ckeditor/templates/djangorestframework/api.html (File does not exist)
/home/kbuzz/webapps/django/lib/python2.7/debug_toolbar/templates/djangorestframework/api.html (File does not exist)
Traceback:
File "/home/kbuzz/webapps/kenyabuzz/lib/python2.7/Django-1.7.10-py2.7.egg/django/core/handlers/base.py" in get_response
111. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/kbuzz/webapps/kenyabuzz/lib/python2.7/Django-1.7.10-py2.7.egg/django/views/generic/base.py" in view
69. return self.dispatch(request, *args, **kwargs)
File "/home/kbuzz/webapps/kenyabuzz/lib/python2.7/Django-1.7.10-py2.7.egg/django/views/decorators/csrf.py" in wrapped_view
57. return view_func(*args, **kwargs)
File "/home/kbuzz/lib/python2.7/djangorestframework/views.py" in dispatch
246. return self.final(request, response, *args, **kwargs)
File "/home/kbuzz/lib/python2.7/djangorestframework/views.py" in final
199. return self.render(response)
File "/home/kbuzz/lib/python2.7/djangorestframework/mixins.py" in render
251. content = renderer.render(response.cleaned_content, media_type)
File "/home/kbuzz/lib/python2.7/djangorestframework/renderers.py" in render
342. template = loader.get_template(self.template)
File "/home/kbuzz/webapps/kenyabuzz/lib/python2.7/Django-1.7.10-py2.7.egg/django/template/loader.py" in get_template
144. template, origin = find_template(template_name, dirs)
File "/home/kbuzz/webapps/kenyabuzz/lib/python2.7/Django-1.7.10-py2.7.egg/django/template/loader.py" in find_template
136. raise TemplateDoesNotExist(name)
Exception Type: TemplateDoesNotExist at /rest/movies/
Exception Value: djangorestframework/api.html
UPDATE
I edited settings file from rest_framework to djangorestframework now getting this error mimetype must have been removed for httpresponse.
Environment:
Request Method: GET
Request URL: http://kbuzz.webfactional.com/rest/movies/categories/?device=browser
Django Version: 1.7.10
Python Version: 2.7.9
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.redirects',
'django.contrib.humanize',
'autocomplete_light',
'djangorestframework',
'haystack',
'lamusoftware.generic',
'mptt',
'bootstrapform',
'sorl.thumbnail',
'oauth2client',
'articles',
'banners',
'common',
'directory',
'events',
'galleries',
'marketplace',
'movies',
'pages',
'profiles',
'search',
'stats',
'minidetector',
'mobile',
'reports',
'favorites',
'braces',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.facebook',
'widget_tweaks',
'wordofmouth',
'ckeditor',
'django_mobile',
'debug_toolbar',
'markup_deprecated')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
'minidetector.Middleware',
'mobileesp.middleware.MobileDetectionMiddleware',
'kb.middleware.log_ip_middleware.SetRemoteAddrFromForwardedFor',
'kb.middleware.log_ip_middleware.RedirectMovie')
Traceback:
File "/home/kbuzz/webapps/kenyabuzz/lib/python2.7/Django-1.7.10-py2.7.egg/django/core/handlers/base.py" in get_response
111. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/kbuzz/webapps/kenyabuzz/lib/python2.7/Django-1.7.10-py2.7.egg/django/views/generic/base.py" in view
69. return self.dispatch(request, *args, **kwargs)
File "/home/kbuzz/webapps/kenyabuzz/lib/python2.7/Django-1.7.10-py2.7.egg/django/views/decorators/csrf.py" in wrapped_view
57. return view_func(*args, **kwargs)
File "/home/kbuzz/lib/python2.7/djangorestframework/views.py" in dispatch
246. return self.final(request, response, *args, **kwargs)
File "/home/kbuzz/lib/python2.7/djangorestframework/views.py" in final
199. return self.render(response)
File "/home/kbuzz/lib/python2.7/djangorestframework/mixins.py" in render
256. resp = HttpResponse(content, mimetype=response.media_type, status=response.status)
File "/home/kbuzz/webapps/kenyabuzz/lib/python2.7/Django-1.7.10-py2.7.egg/django/http/response.py" in __init__
318. super(HttpResponse, self).__init__(*args, **kwargs)
Exception Type: TypeError at /rest/movies/categories/
Exception Value: __init__() got an unexpected keyword argument 'mimetype'
If you have switched back to rest framwork 0.4.0, you should change the value in your INSTALLED_APPS from rest_framework back to djangorestframework.
Then the app template loader should find the template in the djangorestframework/templates directory.
I am working on getting the "add another" popup to work with django-autocomplete_light.
Following along in the docs:
http://django-autocomplete-light.readthedocs.org/en/latest/addanother.html
I have set up my URLs:
import autocomplete_light.shortcuts as al
from AlmondKing.FinancialLogs import models
from AlmondKing.FinancialLogs import forms
urlpatterns = [
url(r'^branches/autocreate/$', al.CreateView.as_view(
model=models.CompanyBranch, form_class=forms.CompanyBranch),
name='branch_autocreate'),
]
and my autocomplete_light_registry.py
al.register(CompanyBranch,
search_fields=['^branch_name'],
attrs={
'placeholder': 'Branch',
'data-autocomplete-minimum-characters': 1,
},
widget_attrs={
'data-widget-maximum-values': 1,
'class': 'modern-style',
},
add_another_url_name='company:branch_autocreate',
)
However, when I click the plus sign to add a new related object, I get the following error:
TypeError at /company/branches/autocreate/
'initial' is an invalid keyword argument for this function
I've been trying to find a way to do this for a while and I'm so close!
Now, I am hoping someone can read the traceback and help me understand what went wrong:
Environment:
Request Method: GET
Request URL: http://localhost:8000/company/branches/autocreate/?_popup=1&winName=id_branch
Django Version: 1.8.2
Python Version: 3.4.3
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'AlmondKing.InventoryLogs',
'AlmondKing.FinancialLogs',
'AlmondKing.AKGenius',
'autocomplete_light')
Installed Middleware:
('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',
'AlmondKing.AKGenius.middleware.RequireLoginMiddleware')
Traceback:
File "C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\core\handlers\base.py" in get_response
132. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\views\generic\base.py" in view
71. return self.dispatch(request, *args, **kwargs)
File "C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\views\generic\base.py" in dispatch
89. return handler(request, *args, **kwargs)
File "C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\views\generic\edit.py" in get
245. return super(BaseCreateView, self).get(request, *args, **kwargs)
File "C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\views\generic\edit.py" in get
205. form = self.get_form()
File "C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\views\generic\edit.py" in get_form
74. return form_class(**self.get_form_kwargs())
File "C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\db\models\base.py" in __init__
480. raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
Exception Type: TypeError at /company/branches/autocreate/
Exception Value: 'initial' is an invalid keyword argument for this function
Try this:
add_another_url_name='company:branch_autocreate',
add_another_url_name='branch_autocreate',