0

Here is my set-up: Django 1.7; Python 3.4, mod_wsgi, virtualenv, apache2. Django and other pakages are installed after activating the virtualenv.

Need .htaccess file for redirects. I am new to deployment world, so please bear with me.

Here is what I have done so far:

In the virtualhost, I call the wsgi.py file after specifying the path to site-package path for Django. This works fine, however I have 2 questions:

1) I saw a lot of sites which were calling the file.wsgi file from the virtualhost config, and in the .wsgi file they were calling the exec to activate the env and call django app. The Django guide however has a different approach (https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/modwsgi/) and this is the one I implemented. Do I need a file.wsgi if I want to have htaccess deal with the request and then forward it to Django urls.py?

2) If the set-up that I have is ok for deployment, where do i place the .htaccess file and ensure that apache sends the request to htaccess which in turn sends it to Django app?

Thanks

tkansara
  • 534
  • 1
  • 4
  • 21
  • You might find [this question](http://stackoverflow.com/questions/2922545/django-and-htaccess-rewrites-redirects-is-this-possible) helpful. – Alasdair May 27 '15 at 21:14
  • 1
    Why do the redirections have to be in a .htaccess file? Why can't they be added in the VirtualHost of the main Apache configuration? Having them in a .htaccess file will complicate things. – Graham Dumpleton May 27 '15 at 23:25

0 Answers0