T
T
ThemeZV2014-10-09 17:16:57
Django
ThemeZV, 2014-10-09 17:16:57

How to configure an Apache2 virtual host to work with Django 1.7 (mod_wsgi)?

I don't have enough knowledge to configure an Apache2 virtual host for Django 1.7. Created a project in directory:
/home/artem/atheme
---manage.py
/home/artem/atheme/mysite
---__init__.py
---settings.py
---urls.py
---wsgi.py
Like configure?
How to check if the setting is correct?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stasyanz, 2014-10-09
@ThemeZ

/etc/apache2/sites-available/api.conf:
WSGIScriptAlias ​​/ /var/www/api/api.wsgi
ServerName develop-api.dev
Alias ​​/static /var/www/api/static
DocumentRoot /var/www/api
Order allow,deny
Allow from all
api.wsgi itself:
/var/www/api/api.wsgi
import os
import sys
sys.path = ['/var/www/api/'] + sys.path
os.environ['DJANGO_SETTINGS_MODULE '] = 'api.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

P
pvgdrk, 2014-10-10
@pvgdrk

https://code.google.com/p/modwsgi/wiki/Integration...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question