[Django]-Django url rewrite without redirect

0👍

I don’t really understand you question, but maybe some fiddling with request.urlconf and custom middleware is the solution?
https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.urlconf

👤aherok

0👍

The Django sites framework does provide some tools to deal with multiple domains, but they all assume you have a different SITE_ID for each deployment.

That said. You can probably write up a middleware that checks request.META['HTTP_HOST'] and then passes that information off to your view in whatever way you wish.

At that point you can just follow the Django docs on using a site custom manager for your models.

0👍

Have you run apache, I think this kind of request can be handle via APACHE’s rewrite engine

👤James

Leave a comment