0

Both django-hosts and this solution (Django: Overwrite ROOT_URLCONF with request.urlconf in middleware), advises to use Middleware to override the URLConf by specifying the path for the urlconf.

However, that would require a file with the variable "urlpatterns".

Instead, what I'm trying to do is that, loading the urlpatterns based on the subdomain/project. So I'm looking for someway to do it without generating a file everytime someone update the pages' URL and writing it to a file "urls_subdomain.py".

Here's the reference to the request middleware by django: https://docs.djangoproject.com/en/2.1/topics/http/urls/#how-django-processes-a-request

Mickey Cheong
  • 2,980
  • 6
  • 38
  • 50

0 Answers0