51👍
✅
You forgot the ‘url
‘
url(r'^admin/', include(admin.site.urls)),
url(r'^tinymce/', include('tinymce.urls')),
urlpatterns should be a list of url() instances
url
returns RegexURLPattern
but instead a tuple is found in your list.
https://docs.djangoproject.com/en/1.8/_modules/django/conf/urls/#url
4👍
I know it’s not absolutely related to the question, but sometimes this error can be a little deeper than directly in a urls.py file.
I got this error and the cause of the problem wasn’t in the error stack trace.
I had this problem while browsing the Admin with a custom Admin Class, and the problem was with the method get_urls() of this class, which was returning something like:
def get_urls(self):
from django.conf.urls import patterns
return ['',
(r'^(\d+)/password/$',
self.admin_site.admin_view(self.user_change_password))] + super(CompanyUserAdmin, self).get_urls()
To fix it:
def get_urls(self):
from django.conf.urls import patterns
return [
url(r'^(\d+)/password/$',
self.admin_site.admin_view(self.user_change_password))] + \
super(CompanyUserAdmin, self).get_urls()
Don’t forget the import of ‘url’:
from django.conf.urls import url
- Registered models do not show up in admin
- Django's {{ csrf_token }} is outputting the token value only, without the hidden input markup
- Celery – No module named five
- How can I make a fixture out of QuerySet in django?
- How to create custom groups in django from group
Source:stackexchange.com