Django: error at / bad character in group name - django

I was following Apress - Practical Django Project by James Bennet and I got this nasty error out of the blue. Could you help me?
Here it goes:
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.2.5
Python Version: 2.5.4
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.flatpages',
'cms.search',
'coltrane',
'tagging']
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 "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response
91. request.path_info)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/urlresolvers.py" in resolve
215. for pattern in self.url_patterns:
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/urlresolvers.py" in _get_url_patterns
244. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/urlresolvers.py" in _get_urlconf_module
239. self._urlconf_module = import_module(self.urlconf_name)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/utils/importlib.py" in import_module
35. __import__(name)
File "/Users/danielcorreia/Sites/test_Django/cms/../cms/urls.py" in <module>
21. (r'', include('django.contrib.flatpages.urls')),
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/conf/urls/defaults.py" in patterns
24. t = url(prefix=prefix, *t)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/conf/urls/defaults.py" in url
41. return RegexURLPattern(regex, view, kwargs, name)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/urlresolvers.py" in __init__
89. self.regex = re.compile(regex, re.UNICODE)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/re.py" in compile
188. return _compile(pattern, flags)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/re.py" in _compile
241. raise error, v # invalid expression
Exception Type: error at /
Exception Value: bad character in group name
Oh! I'm a newbie to Django. Please be gentle :)
Here's the urls.py:
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^cms/', include('cms.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
(r'tiny_mce/(?P<path>.*)$', 'django.views.static.serve', { 'document_root': '/Users/danielcorreia/Sites/tinymce/jscripts/tiny_mce' }),
(r'^search/$', 'cms.search.views.search'),
(r'^weblog/$', 'coltrane.views.entries_index'),
(r'^weblog/(?P<year\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(P?<slug>[-\w]+)/$', 'coltrane.views.entry_detail'),
(r'', include('django.contrib.flatpages.urls')),
)

(r'^weblog/(?P<year\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(P?<slug>[-\w]+)/$', 'coltrane.views.entry_detail'),
Change to:
(r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(P?<slug>[-\w]+)/$', 'coltrane.views.entry_detail'),
Note the closing angle bracket for the year group.

Related

Django shortcuts.redirect NoReverseMatch

I'm getting NoReverseMatch from the below view:
from django.shortcuts import render, redirect
def new_room(request):
label="test"
return redirect(chat_room, label=label)
# this didn't work either:
# return redirect('chat_room', label=label)
def chat_room(request, label):
...
My urls.py looks like this:
from django.conf.urls import url, include
from messaging import views
app_name="messaging"
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^new/$', views.new_room, name='new_room'),
url(r'^(?P<label>[\w-]{,50})/', views.chat_room, name='chat_room'),
]
Going straight to messaging/test/ will load the page correctly. It's only the redirect that is causing the issue.
Full stacktrace:
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/messages/new/
Django Version: 1.10.5
Python Version: 3.5.2
Installed Applications:
['messaging',
'dal',
'dal_select2',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',,
'channels']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'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 "g:\Python\lib\site-packages\django\core\handlers\exception.py" in inner
39. response = get_response(request)
File "g:\Python\lib\site-packages\django\core\handlers\base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "g:\Python\lib\site-packages\channels\handler.py" in process_exception_by_middleware
240. return super(AsgiHandler, self).process_exception_by_middleware(exception, request)
File "g:\Python\lib\site-packages\django\core\handlers\base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "g:\Git\Jam\messaging\views.py" in new_room
26. return redirect('chat_room', label=label)
File "g:\Python\lib\site-packages\django\shortcuts.py" in redirect
56. return redirect_class(resolve_url(to, *args, **kwargs))
File "g:\Python\lib\site-packages\django\shortcuts.py" in resolve_url
147. return reverse(to, args=args, kwargs=kwargs)
File "g:\Python\lib\site-packages\django\urls\base.py" in reverse
91. return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))
File "g:\Python\lib\site-packages\django\urls\resolvers.py" in _reverse_with_prefix
392. (lookup_view_s, args, kwargs, len(patterns), patterns)
Exception Type: NoReverseMatch at /messages/new/
Exception Value: Reverse for 'chat_room' with arguments '()' and keyword arguments '{'label': 'test'}' not found. 0 pattern(s) tried: []
That's because you're using namespacing for your chat_room app.
Change to:
return redirect('messaging:chat_room', label=label)
Check here for namespacing and also here too.

why do I get a base_name attribute error when I include my view in a django Mongoengine web service url.py file?

I am trying to use django-rest-framework-mongoengine to build a webservice using Django and mongodb.
I have an error when I include a url that lists my objects of type Document.
My model file is
class Job(Document):
title = StringField(required=True)
state = StringField(required=True)
My view is
class JobViewSet(GenericAPIView):
queryset = Job.objects.all()
serializer_class = JobSerializer
My url file is
router = routers.MongoSimpleRouter()
router.register(r'jobs', views.JobViewSet)
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]
my serializer is
class JobSerializer(DocumentSerializer):
class Meta:
model = Job
fields = ('title', 'state')
I get the following error when I do runserver
`base_name` argument not specified, and could not automatically determine the name from the viewset, as it does not have a `.model` attribute.
I tried different view type but all the same error. Any help is greatly appreciated....
I am using
python 2.7.9
Django==1.7.7
django-rest-framework-mongoengine==2.0.2
mongoengine==0.9.0
here is the full stack
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.7.7
Python Version: 2.7.9
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'romeo',
'mongoengine.django.mongo_auth',
'jobs',
'rest_framework',
'rest_framework_mongoengine')
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')
Traceback:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
98. resolver_match = resolver.resolve(request.path_info)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/urlresolvers.py" in resolve
343. for pattern in self.url_patterns:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/urlresolvers.py" in url_patterns
372. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/urlresolvers.py" in urlconf_module
366. self._urlconf_module = import_module(self.urlconf_name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py" in import_module
37. __import__(name)
File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_imps/_pydev_pluginbase.py" in plugin_import
452. fromlist, level)
File "/Users/amer/Workspace/Repository/romeo/romeo/urls.py" in <module>
6. router.register(r'jobs', views.JobViewSet)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rest_framework/routers.py" in register
60. base_name = self.get_default_base_name(viewset)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rest_framework_mongoengine/routers.py" in get_default_base_name
11. assert model_cls, '`base_name` argument not specified, and could ' \
Exception Type: AssertionError at /
Exception Value: `base_name` argument not specified, and could not automatically determine the name from the viewset, as it does not have a `.model` attribute.
You need to add the base_name param to make it work:
router = routers.MongoSimpleRouter()
router.register(r'jobs', views.JobViewSet, 'job-view')
I try this (from Geo Jacob answer) but it doesn't work:
router.register(r'jobs', views.JobViewSet, base_name='job-view')
Note: note the difference between base_name='job-view' and 'job-view'
Try to add a base_name in router register.
router = routers.MongoSimpleRouter()
router.register(r'jobs', views.JobViewSet, base_name='job-view')

Django ImportError: cannot import name get_permission_codename

I am doing the tango with django tutorial. I am up to chapter 5 on working with models and I am setting up the admin website. I get this strange error:
ImportError: cannot import name get_permission_codename
This seems to go away when I remove the
admin.autodiscover()
from my project/urls.py. But I am concerned that I will need this down the road.
Here is the Traceback I get when I run the development server:
Environment:
Request Method: GET Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.5.4 Python Version: 2.7.3 Installed Applications:
('django.contrib.auth', 'django.contrib.contenttypes',
'django.contrib.sessions', 'django.contrib.sites',
'django.contrib.messages', 'django.contrib.staticfiles',
'django.contrib.admin', 'rango') 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
"/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py"
in get_response
103. resolver_match = resolver.resolve(request.path_info) File
"/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py"
in resolve
319. for pattern in self.url_patterns: File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py"
in url_patterns
347. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File
"/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py"
in urlconf_module
342. self._urlconf_module = import_module(self.urlconf_name) File
"/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py" in
import_module
35. import(name) File "/home/gpanterov/MyProjects/django/tango_with_django_project/tango_with_django_project/urls.py"
in
6. admin.autodiscover() File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/init.py"
in autodiscover
29. import_module('%s.admin' % app) File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py" in
import_module
35. import(name) File "/usr/local/lib/python2.7/dist-packages/django/contrib/contenttypes/admin.py"
in
5. from django.contrib.admin.checks import InlineModelAdminChecks File
"/usr/local/lib/python2.7/dist-packages/django/contrib/admin/checks.py"
in
6. from django.contrib.admin.utils import get_fields_from_path, NotRelationField, flatten File
"/usr/local/lib/python2.7/dist-packages/django/contrib/admin/utils.py"
in
6. from django.contrib.auth import get_permission_codename
Exception Type: ImportError at /admin/ Exception Value: cannot import
name get_permission_codename
When I remove the admin.autodiscover() line, the development server runs and I am able to get to the admin panel, but when I log in with the superuser password I created earlier, I get the message "You don't have permission to edit anything." and I don't see any of the categories I created.
I got this error when downgrading django from latest version (1.8) to an old version (1.4) for testing.
The problem here is that git doesn't delete .pyc files when switching branches (because they are .gitignore'ed) and python only regenerates them when the corresponding .py file is newer than the .pyc file (see this question for details).
The solution is to delete all *.pyc files in django/contrib/admin and django/contrib/contenttypes directories.
cannot import name get_permission_codename
Make sure u have not install all the version of django in your system.
if there then remove all and install fresh django

Custom password_reset_form returning: unhashable type: 'dict'

I am trying to override the form for password_reset_form but it keep resulting in following error:
unhashable type: 'dict'
I interpret this error as password_reset_form does not exist for some reason?
My urls.py:
from rest_framework.routers import DefaultRouter
from django.conf.urls import patterns, url, include
from web import views
from web.forms import MyLoginForm, MyPasswordResetForm
urlpatterns = patterns('',
#url(r'^', views.IndexView.as_view(), name='index'),
url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'authentication_form': MyLoginForm}),
url(r'^accounts/logout/$', 'django.contrib.auth.views.logout', name='logout'),
url(r'^accounts/password/reset/$',
'django.contrib.auth.views.password_reset',
{'password_reset_form': MyPasswordResetForm},
{'post_reset_redirect' : '/user/password/reset/done/'}),
(r'^accounts/password/reset/done/$',
'django.contrib.auth.views.password_reset_done'),
(r'^accounts/password/reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
'django.contrib.auth.views.password_reset_confirm',
{'post_reset_redirect' : '/user/password/done/'}),
(r'^accounts/password/done/$',
'django.contrib.auth.views.password_reset_complete'),
)
My forms.py:
from django import forms
from django.forms import ModelForm
from django.contrib.auth.models import User
from django.contrib.auth.forms import AuthenticationForm, PasswordResetForm
class MyLoginForm(AuthenticationForm):
username = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control','placeholder':'Brugernavn'}))
password = forms.CharField(widget=forms.PasswordInput(attrs={'class':'form-control','placeholder':'Password'}))
class MyPasswordResetForm(PasswordResetForm):
username = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control','placeholder':'Brugernavn'}))
Full stacktrace:
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/accounts/password/reset/
Django Version: 1.6.1
Python Version: 2.7.5
Installed Applications:
('django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'web',
'api',
'django.contrib.admin',
'rest_framework.authtoken',
'corsheaders',
'django.contrib.auth')
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',
'corsheaders.middleware.CorsMiddleware')
Traceback:
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response
114. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Library/Python/2.7/site-packages/django/utils/decorators.py" in _wrapped_view
99. response = view_func(request, *args, **kwargs)
File "/Library/Python/2.7/site-packages/django/contrib/auth/views.py" in password_reset
142. post_reset_redirect = reverse('password_reset_done')
File "/Library/Python/2.7/site-packages/django/core/urlresolvers.py" in reverse
509. return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
File "/Library/Python/2.7/site-packages/django/core/urlresolvers.py" in _reverse_with_prefix
387. possibilities = self.reverse_dict.getlist(lookup_view)
File "/Library/Python/2.7/site-packages/django/core/urlresolvers.py" in reverse_dict
296. self._populate()
File "/Library/Python/2.7/site-packages/django/core/urlresolvers.py" in _populate
273. for name in pattern.reverse_dict:
File "/Library/Python/2.7/site-packages/django/core/urlresolvers.py" in reverse_dict
296. self._populate()
File "/Library/Python/2.7/site-packages/django/core/urlresolvers.py" in _populate
287. lookups.appendlist(pattern.name, (bits, p_pattern, pattern.default_args))
File "/Library/Python/2.7/site-packages/django/utils/datastructures.py" in appendlist
383. self.setlistdefault(key).append(value)
File "/Library/Python/2.7/site-packages/django/utils/datastructures.py" in setlistdefault
373. if key not in self:
Exception Type: TypeError at /accounts/password/reset/
Exception Value: unhashable type: 'dict'
Your arguments for url isn't right. Should be one dictionary
url(r'^accounts/password/reset/$',
'django.contrib.auth.views.password_reset',
{'password_reset_form': MyPasswordResetForm,
'post_reset_redirect': '/user/password/reset/done/'}),

TypeError at /admin/

Please help, my admin interface was working fine before but now when I check it,it gives me the :
TypeError at /admin/
Unhashable type: 'dict'
I don't know what I did to mess it up.
I have admin.autodiscover() in my urls, I have ran syncdb, and I have the contrib.admin in my INSTALLED APPS.
my url : url(r'^admin/', include(admin.site.urls)),
EDIT :
> Environment:
>
>
> Request Method: GET Request URL: http://127.0.0.1:8000/admin/
>
> Django Version: 1.4.5 Python Version: 2.7.3 Installed Applications:
> ('django.contrib.auth', 'django.contrib.contenttypes',
> 'django.contrib.sessions', 'django.contrib.sites',
> 'django.contrib.admin', 'django.contrib.comments',
> 'django.contrib.messages', 'django.contrib.staticfiles', 'haystack',
> 'bookmarks') 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.middleware.clickjacking.XFrameOptionsMiddleware')
>
>
> Traceback: File
> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py"
> in get_response
> 111. response = callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py"
> in wrapper
> 213. return self.admin_view(view, cacheable)(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py" in
> _wrapped_view
> 91. response = view_func(request, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py"
> in _wrapped_view_func
> 89. response = view_func(request, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py"
> in inner
> 192. current_app=self.name): File
> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py"
> in reverse
> 447. app_list = resolver.app_dict[ns] File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py"
> in app_dict
> 290. self._populate() File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py"
> in _populate
> 265. lookups.appendlist(pattern.callback, (bits, p_pattern, pattern.default_args)) File
> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py"
> in callback
> 216. self._callback = get_callable(self._callback_str) File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py" in
> wrapper
> 25. if mem_args in cache:
>
> Exception Type: TypeError at /admin/ Exception Value: unhashable type:
> 'dict'
EDIT:
urls.py:
import os.path
from django.conf.urls import patterns, url, include
from bookmarks.views import *
from bookmarks.feeds import LatestEntriesFeed
from django.views.static import *
from django.conf import settings
from django.views.generic.simple import direct_to_template
from django.contrib.comments.models import Comment
site_media = os.path.join(
os.path.dirname(__file__), 'site_media'
)
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Uncomment the admin/doc line below to enable admin documentation:
#url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Feeds
(r'^latest/feed/$', LatestEntriesFeed()),
#Admin interface
url(r'^admin/', include(admin.site.urls)),
# Comments
(r'^comments/', direct_to_template,
{'template':'comments/posted.html'}),
#social_auth
url(r'',include('social_auth.urls')),
#email invite friend
(r'^friend/invite/$',friend_invite),
(r'^friend/accept/(\w+)/$', friend_accept),
#Browsing
(r'^$', main_page),
(r'^popular/$', popular_page),
(r'^user/(\w+)/$', user_page),
(r'^tag/([^\s]+)/$', tag_page),
(r'^bookmark/(\d+)/$', bookmark_page),
#Session management
(r'^login/$', 'django.contrib.auth.views.login'),
(r'^logout/$', logout_page),
(r'^media/ (?P<path>.*)', #'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
(r'^register/$', register_page),
(r'^register/success/$', direct_to_template,
{ 'template': 'registration/register_success.html' }),
#Account management
(r'^save/$', bookmark_save_page),
(r'^tag/$', tag_cloud_page),
(r'^search/$', search_page),
(r'^vote/$', bookmark_vote_page),
#insights
(r'^insights/$', insights_page),
#media for static files
#(r'^media/(/P<path>.*)$','django.views.static.serve',{'document_root':settings.MEDIA_ROOT}),
# Ajax
(r'^ajax/tag/autocomplete/$', ajax_tag_autocomplete),
#static url
(r'^static/(?P<path>.*)$','django.views.static.serve', {'document_root': 'Home/django_bookmarks/static'})
#(r'^django_bookmarks/', include('django_bookmarks.foo.urls')),
)
I'm on Django 1.11, but I got a similar error unhashable type: 'list' by trying to give models.CharField() a choices argument like this:
[(['FIT_FOR_USE', 'NOT_CHECKED', 'TO_BE_CHECKED', 'BLACKLISTED'],
"['Fit For Use', 'Not Checked', 'To Be Checked', 'Blacklisted']")]
So my guess is you've done something like this:
models.CharField(...., choices=[({}, 'aaa')])