def configure_settings(format): settings.configure( backend='setman.backends.filebased', filename=SETTINGS_DATA_FILE % {'format': format}, format=format, settings_file=SETTINGS_FILE, settings_files=SETTINGS_FILES )
def configure_settings(format): settings.configure(backend='setman.backends.filebased', filename=SETTINGS_DATA_FILE % {'format': format}, format=format, settings_file=SETTINGS_FILE, settings_files=SETTINGS_FILES)
logging.basicConfig(level=logging.INFO) DIRNAME = os.path.abspath(os.path.dirname(__file__)) rel = lambda *parts: os.path.abspath(os.path.join(DIRNAME, *parts)) SETMAN_ADDITIONAL_TYPES = ('testapp.utils.IPAddressSetting', ) SETMAN_SETTINGS_FILES = {'namespace': rel('namespace.cfg')} app = Flask(__name__) app.config.from_object(__name__) app.secret_key = 't:\xc6\x1d\xcd\x86\xb7_\x11\x1e\xfe\xc1AD\x9f>' app.static_folder = rel('..', '..', 'testproject-django', 'media') settings.configure(framework='setman.frameworks.flask_setman', app=app, backend='setman.backends.filebased', filename=rel('..', 'settings.json'), format='json') @app.route('/docs') @app.route('/docs/<path>') def docs(path=None): """ View instructions on how to build documentation. """ dirname = rel('..', '..') docs_dirname = rel('..', '..', 'docs', '_build', 'html') if not os.path.isdir(docs_dirname): return render_template('docs.html', dirname=dirname)