Django ImproperlyConfigured at


I am starting to use multitenant but I have not been able to move forward because I get this error:

I have not changed anything in the URLs, I share my distribution of files:

The main file of the project (pruebatenant) is:

from django.conf.urls import patterns, include, url
from django.views.generic.base import TemplateView
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static


urlpatterns = static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # solo en servidor de desarrollo

urlpatterns = patterns('',
    url(r'^select2/', include('django_select2.urls')),

    url(r'^login/$', 'django.contrib.auth.views.login', {'template_name':'login.html'}, name='login'),
    url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page':'login'}, name='logout'),
    url(r'^cambiar-pass/$', 'django.contrib.auth.views.password_change', {'template_name':'cambiar-pass.html', 'post_change_redirect':'login'}, name='cambiar_pass'),

    url(r'^admin/', include(,

    url(r'^$', TemplateView.as_view(template_name='publico/index.html'), name='home'),

    url(r'^publico/', include('publico.urls')),
    url(r'^personas/', include('personas.urls')),

) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

The of people is:      from django.conf.urls import patterns, include, url

urlpatterns = patterns('personas.views.persona',
    url(r'^nueva_persona$', 'nueva_persona', name="nueva_persona"),

and the public is:      from django.conf.urls import patterns, include, url

urlpatterns = patterns('publico.views.principal',
    url(r'^inicio$', 'inicio', name="inicio"),

urlpatterns += patterns('publico.views.empresas',
    url(r'^nueva_empresa$', 'nueva_empresa', name="nueva_empresa"),
asked by Diana Carolina Hernandez 13.01.2016 в 18:03

1 answer


Diana, the problem is not your URLs, the problem is in your , if you are using the sites framework (as shown in the image error), you have to define the SITE_ID in your configuration:


This should be enough for your application to work. If you do not intend to use it, be sure to remove it or comment on your INSTALLED_APPS :

    # 'django.contrib.sites'
answered by 13.01.2016 / 18:07