Search code examples
djangodjango-registration

Problems with redirect() calls in django-registration


I have a Django 1.4 project that makes use of django-registration which calls a redirect('registration_complete', (), {}) after a user registers successfully. This works great on the django development server which runs at http://127.0.0.1:8000/.

My staging site sits at a non-root location on an Apache server. Something like http://example.com/mysite. So when a user registers there, this leads to a page not found error as the django-registration redirect call doesn't reverse the url correctly -- it leaves off the site root (mysite/).

I'm trying to decide how to fix this. Here is what I am considering:

1) Write a custom django-registration backend to handle the registration workflow differently.

2) Patch the django-registration default backend to handle the redirects differently.

3) ?

What is the best way to fix this?


Solution

  • The best solution was that provided by ilvar -- avoid using subdirectories and run the project on a separate subdomain. I'd also suggest putting that subdomain under a different path in the filesystem. Thanks ilvar!