Skip to content
Browse files

apache conf and wsgi configured for a staging environment

  • Loading branch information...
1 parent 8059faf commit 496c13a0b0f11cdee27ab8852de93a27c0e9a674 @calebsmith committed Jul 19, 2011
Showing with 54 additions and 0 deletions.
  1. +31 −0 apache/staging.conf
  2. +23 −0 apache/staging.wsgi
  3. BIN pastey.sqlite3
View
31 apache/staging.conf
@@ -0,0 +1,31 @@
+<VirtualHost:*80>
+ WSGIScriptReloading On
+ WSGIReloadMechanism Process
+ WSGIDaemonProcess pypastebin-staging
+ WSGIProcessGroup pypastebin-staging
+ WSGIApplicationGroup pypastebin-staging
+ WSGIPassAuthorization On
+
+ WSGIScriptAlias / /home/caktus/www/staging/paste/apache/staging.wsgi/
+
+ <Location "/">
+ Order Allow,Deny
+ Allow from all
+ </Location>
+
+ <Location "/media">
+ SetHandler None
+ </Location>
+
+ Alias /media /home/caktus/www/staging/paste/media
+
+ <Location "/admin-media">
+ SetHandler None
+ </Location>
+
+ Alias /admin-media /home/caktus/www/staging/paste/media/admin
+
+ ErrorLog /home/caktus/www/log/error.log
+ LogLevel info
+ CustomLog /home/caktus/www/log/access.log combined
+</VirtualHost:*80>
View
23 apache/staging.wsgi
@@ -0,0 +1,23 @@
+import os, sys
+import site
+
+#project root is 3 parent directories from this file
+PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
+#find the version of python
+PYTHON_VERSION = "python" + str(sys.version_info.major) + "." + str(sys.version_info.minor)
+#determine the site packages in the environment
+SITE_PACKAGES = os.path.join(PROJECT_ROOT, 'env/lib/', PYTHON_VERSION ,'/site-packages')
+
+#add project root to
+sys.path.insert(0, PROJECT_ROOT)
+site.addsitedir(os.path.abspath(site_packages))
+
+os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+os.environ['CELERY_LOADER'] = "django"
+
+import django.core.handlers.wsgi
+application = django.core.handlers.wsgi.WSGIHandler()
+
+
+
+
View
BIN pastey.sqlite3
Binary file not shown.

0 comments on commit 496c13a

Please sign in to comment.
Something went wrong with that request. Please try again.