I'm starting to use multitenant but I haven't been able to progress because I get this error:
I have not changed anything in the URLs, I share my distribution of files:
The main urls.py file of the project (testtenant) 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
admin.autodiscover()
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(admin.site.urls)),
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 urls.py 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 urls.py 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"),
)
Diana, the problem is not your URLs, the problem is in your
settings.py
, if you are using the sites framework (as shown in the error image), you have to define theSITE_ID
in your configuration:This should be enough for your app to work. If you don't intend to use it, be sure to remove it or comment it out in your
INSTALLED_APPS
: