diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-01-17 16:50:38 +0100 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2015-03-03 22:22:14 +0100 |
commit | 2849c82255b4b889c7342a0a8fa8a4aecfbe599d (patch) | |
tree | 3ad31fd3a0e84bc3f40367cf4963cf8db8c65d06 /pyaggr3g470r/__init__.py | |
parent | adding news fields and migrations scripts (diff) | |
download | newspipe-2849c82255b4b889c7342a0a8fa8a4aecfbe599d.tar.gz newspipe-2849c82255b4b889c7342a0a8fa8a4aecfbe599d.tar.bz2 newspipe-2849c82255b4b889c7342a0a8fa8a4aecfbe599d.zip |
a first big refacto of the existing arch
Diffstat (limited to 'pyaggr3g470r/__init__.py')
-rw-r--r-- | pyaggr3g470r/__init__.py | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/pyaggr3g470r/__init__.py b/pyaggr3g470r/__init__.py index 0138b4d3..e69de29b 100644 --- a/pyaggr3g470r/__init__.py +++ b/pyaggr3g470r/__init__.py @@ -1,49 +0,0 @@ -#! /usr/bin/env python -# -*- coding: utf-8 -*- - -import os -from flask import Flask -from flask.ext.sqlalchemy import SQLAlchemy -from flask.ext.babel import Babel -from flask.ext.babel import format_datetime - -import conf - -# Create Flask application -app = Flask(__name__) -app.debug = conf.WEBSERVER_DEBUG - -# Create dummy secrey key so we can use sessions -app.config['SECRET_KEY'] = getattr(conf, 'WEBSERVER_SECRET', None) -if not app.config['SECRET_KEY']: - app.config['SECRET_KEY'] = os.urandom(12) -app.config['SQLALCHEMY_DATABASE_URI'] = conf.SQLALCHEMY_DATABASE_URI -db = SQLAlchemy(app) - -app.config['RECAPTCHA_USE_SSL'] = True -app.config['RECAPTCHA_PUBLIC_KEY'] = conf.RECAPTCHA_PUBLIC_KEY -app.config['RECAPTCHA_PRIVATE_KEY'] = conf.RECAPTCHA_PRIVATE_KEY - - -if conf.ON_HEROKU: - from flask_sslify import SSLify - sslify = SSLify(app) - -ALLOWED_EXTENSIONS = set(['xml', 'opml', 'json']) - -def allowed_file(filename): - """ - Check if the uploaded file is allowed. - """ - return '.' in filename and \ - filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS - -babel = Babel(app) - -app.jinja_env.filters['datetime'] = format_datetime - -# Views -from flask.ext.restful import Api -api = Api(app) - -from pyaggr3g470r import views |