Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

sample wsgi script and virtual host configuration for apache

  • Loading branch information...
commit d15ca9d2be1eff636d6c4d53132d55d87cebf823 1 parent 7b600ee
oguz authored
Showing with 53 additions and 0 deletions.
  1. +34 −0 ovizart/wsgi/apache_django
  2. +19 −0 ovizart/wsgi/django.wsgi
View
34 ovizart/wsgi/apache_django
@@ -0,0 +1,34 @@
+<VirtualHost *:80 *:8000>
+ ServerAdmin oguzy@comu.edu.tr
+ ServerName ow.comu.edu.tr
+ ErrorLog ${APACHE_LOG_DIR}/django-error.log
+ LogLevel warn
+
+ CustomLog ${APACHE_LOG_DIR}/django-access.log combined
+
+ DocumentRoot /home/oguz/git/ovizart/ovizart
+ <Directory /home/oguz/git/ovizart/ovizart>
+ Order allow,deny
+ Allow from all
+ </Directory>
+
+ Alias /site_media/ /home/oguz/git/ovizart/ovizart/media/
+ <Directory /home/oguz/git/ovizart/ovizart/media/>
+ Order deny,allow
+ Options Indexes
+ Allow from all
+ IndexOptions FancyIndexing
+ </Directory>
+
+ WSGIDaemonProcess ovizart display-name=%{GROUP} user=www-data group=www-data threads=25
+ WSGIProcessGroup ovizart
+ WSGIScriptAlias / /home/oguz/git/ovizart/ovizart/wsgi/django.wsgi
+
+ <Directory /home/oguz/git/ovizart/ovizart/wsgi/>
+ Order deny,allow
+ Options Indexes
+ Allow from all
+ IndexOptions FancyIndexing
+ </Directory>
+
+</VirtualHost>
View
19 ovizart/wsgi/django.wsgi
@@ -0,0 +1,19 @@
+import os, sys
+
+project_path = "/home/oguz/git/ovizart"
+project_app_path = "/home/oguz/git/ovizart/ovizart"
+
+if project_path not in sys.path:
+ sys.path.append(project_path)
+if project_app_path not in sys.path:
+ sys.path.append(project_app_path)
+
+os.environ['DJANGO_SETTINGS_MODULE'] = 'ovizart.settings'
+
+import django.core.handlers.wsgi
+
+_application = django.core.handlers.wsgi.WSGIHandler()
+
+def application(environ, start_response):
+ environ['PATH_INFO'] = environ['SCRIPT_NAME'] + environ['PATH_INFO']
+ return _application(environ, start_response)
Please sign in to comment.
Something went wrong with that request. Please try again.