Ejemplo n.º 1
0
 def setUp(self):
     app.testing = True
     app.config['CSRF_ENABLED'] = False
     self.client = app.test_client()
     Paste.init_table()
     User.init_table()
Ejemplo n.º 2
0
    except:
        return None

app = Flask(__name__)
app.config.from_pyfile('config.py')
app.config['VERSION'] = get_version()

if app.config.get('SENTRY_DSN'):
    from raven.contrib.flask import Sentry
    sentry = Sentry(app)


from PyPaste.models.pastes import Paste
from PyPaste.models.users import User

Paste.init_table()
User.init_table()

from PyPaste.views.errors import errors
from PyPaste.views.pastes import pastes
from PyPaste.views.admin import admin
from PyPaste.views import api

app.register_blueprint(errors)
app.register_blueprint(pastes)
app.register_blueprint(admin)
app.register_blueprint(api.legacy)
app.register_blueprint(api.v1)


# This allows us to enforce the FORCE_SSL config option
Ejemplo n.º 3
0
 def setUp(self):
     app.testing = True
     app.config['CSRF_ENABLED'] = False
     self.client = app.test_client()
     Paste.init_table()
     User.init_table()
Ejemplo n.º 4
0
    except:
        return None


app = Flask(__name__)
app.config.from_pyfile('config.py')
app.config['VERSION'] = get_version()

if app.config.get('SENTRY_DSN'):
    from raven.contrib.flask import Sentry
    sentry = Sentry(app)

from PyPaste.models.pastes import Paste
from PyPaste.models.users import User

Paste.init_table()
User.init_table()

from PyPaste.views.errors import errors
from PyPaste.views.pastes import pastes
from PyPaste.views.admin import admin
from PyPaste.views import api

app.register_blueprint(errors)
app.register_blueprint(pastes)
app.register_blueprint(admin)
app.register_blueprint(api.legacy)
app.register_blueprint(api.v1)

# This allows us to enforce the FORCE_SSL config option
# Any redirection should be done at the httpd level