1
0
mirror of https://github.com/Tygs/0bin.git synced 2023-08-10 21:13:00 +03:00

Moved deployment scripts in a dedicated directory. Added an importable wsgi.py module (app.wsgi works only for Apache, and now imports wsgi.py) and a script for gunicorn. Settings file can now be specified using an environnement variable.

This commit is contained in:
sametmax 2013-07-03 11:12:12 +02:00
parent 9e48029ef9
commit 522bc27f1c
2 changed files with 5 additions and 12 deletions

View File

@ -1,10 +0,0 @@
import os, sys
# make sure the zerobin module is in the PYTHON PATH and importable
ZEROBIN_PARENT_DIR = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, ZEROBIN_PARENT_DIR)
# create the wsgi callable
from zerobin.routes import get_app
settings, application = get_app(compressed_static=True)

View File

@ -148,8 +148,11 @@ def get_app(debug=None, settings_file='',
Return a tuple (settings, app) configured using passed
parameters and/or a setting file.
"""
settings_file = settings_file or os.environ.get('ZEROBIN_SETTINGS_FILE')
if settings_file:
settings.update_with_file(os.path.abspath(settings_file))
settings.update_with_file(os.path.realpath(settings_file))
if settings.PASTE_ID_LENGTH < 4:
raise SettingsValidationError('PASTE_ID_LENGTH cannot be lower than 4')
@ -173,7 +176,7 @@ def get_app(debug=None, settings_file='',
@clize.clize(coerce={'debug': bool, 'compressed_static': bool})
def runserver(host='', port='', debug=None, user='', group='',
settings_file='', compressed_static=None,
version=False, paste_id_length=None):
version=False, paste_id_length=None, server="cherrypy"):
if version:
print '0bin V%s' % settings.VERSION