How to get hostname or IP in settings.py so that i can use it to decide which app's urls to use
I am making a django application where it will have 2 apps. When you open www.webName.co.id it will use urls.py from app A, but when you open webName.co.uk it will use urls.py from app B This is the urls.py from the main project: urlpatterns = [ url(r'^tinymce/', include('tinymce.urls')), url(r'^filer/', include('filer.urls')), url(r'^ckeditor/', include('ckeditor_uploader.urls')), url(r'^admin/', admin.site.urls), ] I was planning to add something like this to that file: if settings.CURRENT_HOST_IP == 'www.webname.co.id': urlpatterns += url(r'^', include('webname_id.urls')), else: urlpatterns