Please help


This is a copy of my question in stackoverflow, please help.


I am making a django application where it will have 2 apps. When you open it will use from app A, but when you open it will use from app B

This is the from the main project:
    urlpatterns = [
    url(r'^tinymce/', include('tinymce.urls')),
    url(r'^filer/', include('filer.urls')),
    url(r'^ckeditor/', include('ckeditor_uploader.urls')),

I was planning to add something like this to that file:

    if settings.CURRENT_HOST_IP == '':
        urlpatterns += url(r'^', include('webname_id.urls')),
        urlpatterns += url(r'^', include('webname_uk.urls')),

That way, it will simply use the urls from the app that is being used, depending on the current www you are entering the site with.

So my project have 1 backend admin, but multiple front-end templates and urls. The problem is i can't figure out how to set CURRENT_HOST_IP in the,

Usually i use this to get the current IP / host the user is using:

But i can't access the request object in

Guest May 16, 2017, 8:35 a.m. 1 Answer

Answers ( 1 )

  1. May 19, 2017, 1:09 p.m.


    from django.conf.urls import include, url

    url valueshould be stored inside url 


    print url to see what you will get

Warning! You are not logged in.
Your answer will be published as Guest user.

Post your Answer

 Prev question