import sys import os.path sys.path.insert(0, os.path.dirname(__file__)) from hgapp import app as application, init_for init_for('production')
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from hgapp import app, init_for init_for('dev') try: port = int(sys.argv[1]) except (IndexError, ValueError): port = 8000 app.run('0.0.0.0', port=port, debug=True)
from urlparse import urlparse from hgapp import init_for, app init_for('production') REDIS_URL = app.config.get('REDIS_URL', 'redis://localhost:6379/0') # REDIS_URL is not taken by setup_default_arguments function of rq/scripts/__init__.py # so, parse that into pieces and give it r = urlparse(REDIS_URL) REDIS_HOST = r.hostname REDIS_PORT = r.port REDIS_PASSWORD = r.password REDIS_DB = 0