Answer the question
In order to leave comments, you need to log in
How to force Django to include multiple modules when loading the main page?
Perhaps I didn't formulate the problem too tactfully. I'll explain now. A Django site consists of more than 3 modules. In urls.py I connect all of them as it should be through Include, I assign a name. And here's the problem, I need to load several modules at once when loading the main page of the site. Now the work looks like this, for example, I connect the "news" module, where I did not assign any link and, accordingly, when the main page is loaded, it will launch its method, and the "loginapp" user interface module will not work. Authorization and all other necessary functions do not work.
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^loginapp/', include("loginapp.urls", namespace='loginapp')),
url(r'^publications/', include("publications.urls", namespace='publications')),
url(r'^', include("news.urls", namespace='news')),
]
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^publications/', include("publications.urls", namespace='publications')),
url(r'^', include("loginapp.urls", namespace='loginapp')),
url(r'^', include("news.urls", namespace='news')),
]
def main(request):
return render_to_response('main.html')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question