Commits

Tyler Butler  committed cdcf554

Fixed wsgi config path problems.

  • Participants
  • Parent commits 1508351

Comments (0)

Files changed (4)

File PROJECT_ROOT/wsgi/development.wsgi

-from wsgi_common import start
+import site, os, sys
 
 __author__ = 'tyler@tylerbutler.com'
 
-# Tell wsgi to add the Python site-packages to it's path.
+# Tell wsgi to add the virtualenvs Python site-packages to its path.
 #site.addsitedir('/home/tylerbutler/.virtualenvs/tylerbutlercom/lib/python2.7/site-packages')
 
-start('settings.development')
+# Append the current dir to the path so we can import wsgi_common
+sys.path.append(os.path.dirname(__file__))
+import wsgi_common
+
+application = wsgi_common.start('settings.development')

File PROJECT_ROOT/wsgi/production.wsgi

-from wsgi_common import start
+import site, os, sys
 
 __author__ = 'tyler@tylerbutler.com'
 
-# Tell wsgi to add the Python site-packages to it's path.
+# Tell wsgi to add the virtualenvs Python site-packages to its path.
 #site.addsitedir('/home/tylerbutler/.virtualenvs/tylerbutlercom/lib/python2.7/site-packages')
 
-start('settings.production')
+# Append the current dir to the path so we can import wsgi_common
+sys.path.append(os.path.dirname(__file__))
+import wsgi_common
+
+application = wsgi_common.start('settings.production')

File PROJECT_ROOT/wsgi/staging.wsgi

-from wsgi_common import start
+import site, os, sys
 
 __author__ = 'tyler@tylerbutler.com'
 
-# Tell wsgi to add the Python site-packages to it's path.
+# Tell wsgi to add the virtualenvs Python site-packages to its path.
 #site.addsitedir('/home/tylerbutler/.virtualenvs/tylerbutlercom/lib/python2.7/site-packages')
 
-start('settings.staging')
+# Append the current dir to the path so we can import wsgi_common
+sys.path.append(os.path.dirname(__file__))
+import wsgi_common
+
+application = wsgi_common.start('settings.staging')

File PROJECT_ROOT/wsgi/wsgi_common.py

     except:
         pass
 
+    return application
 #def setup(filename):
 #	project_root = os.sep.join(filename.split(os.sep)[:-2])
 #	project_dir = None