forked from docusign/code-examples-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
22 lines (17 loc) · 656 Bytes
/
__init__.py
File metadata and controls
22 lines (17 loc) · 656 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
from app import ds_config
from flask import Flask
from flask_wtf.csrf import CSRFProtect
session_path = "/tmp/python_recipe_sessions"
app = Flask(__name__)
app.config.from_pyfile("config.py")
app.secret_key = ds_config.DS_CONFIG["session_secret"]
csrf = CSRFProtect(app) # See https://flask-wtf.readthedocs.io/en/stable/csrf.html
if "DYNO" in os.environ: # On Heroku?
import logging
stream_handler = logging.StreamHandler()
app.logger.addHandler(stream_handler)
app.logger.setLevel(logging.INFO)
app.logger.info("Recipe example startup")
app.config.update(dict(PREFERRED_URL_SCHEME = "https"))
from app import views