I want to deploy my django app in a Ubuntu server with Apache and mod_wsgi. I am following this tutorial
http://thecodeship.com/deployment/deploy-django-apache-virtualenv-and-mod_wsgi/
in my site file I have
<VirtualHost *:80>
ServerAdmin webmaster@mydomain.com
ServerName mydomain.com
ServerAlias www.mydomain.com
WSGIScriptAlias / var/www/index.wsgi
Alias /static/ /var/www/static/
<Location "/static/">
Options -Indexes
</Location >
</VirtualHost >
Don't mind the generic mydomain.com entries. The site is for progress display only so I can discuss it with my friend.
in /var/www/index.wsgi I have this
import os
import sys
import site
# Add the site-packages of the chosen virtualenv to work with
site.addsitedir('/home/voger/venvs/ssite/local/lib/python2.7/site-packages')
# Add the app's directory to the PYTHONPATH
sys.path.append('/home/voger/projects/ssite')
sys.path.append('/home/voger/projects/ssite/ssite')
os.environ['DJANGO_SETTINGS_MODULE'] = 'ssite.settings'
# Activate your virtual env
activate_env=os.path.expanduser("/home/voger/venvs/ssite/bin/activate_this.py")
execfile(activate_env, dict(__file__=activate_env))
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
in my settings.py I have two lines for redirecting after login and logout. These are not prepended with index.wsgi
LOGIN_REDIRECT_URL = '/login_redirect'
ACCOUNT_LOGOUT_REDIRECT_URL = "/logout_redirect"
When these urls are requested it returns 404
Reverse for 'login_redirect' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
In my html I have 4 links
<a id="logout" style="display: inline-block;" href="/index.wsgi/accounts/logout/">Logout</a>
<a id="profile" style="display: inline-block;" href="/accounts/profile">My Account</a>
<a id="signup" style="display: none;" href="/index.wsgi/accounts/signup/">Sign Up</a>
<a id="login" style="display: none;" href="/index.wsgi/accounts/login/">Sign In</a>
and as you can see 3 entries that are inserted with {% url %} are prepended automatically with /index.wsgi while the only one who is hardcoded it is not prepended. But still they work as expected.
Why do I have this /index.wsgi prepended and how can I remove it? In my development machine using django's built in server everything works fine.
I don't know if it is related but the login, logout and signup urls are provided by django-allauth.
Thank you for any answer or comment