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
61 lines (54 loc) · 1.91 KB
/
Copy path__init__.py
File metadata and controls
61 lines (54 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import os
from flask import Flask
from flask_wtf.csrf import CSRFProtect
from . import examples
from .docusign.views import ds
from .views import core
session_path = "/tmp/python_recipe_sessions"
app = Flask(__name__)
app.config.from_pyfile("config.py")
# See https://flask-wtf.readthedocs.io/en/stable/csrf.html
csrf = CSRFProtect(app)
# Register home page
app.register_blueprint(core)
# Register OAuth
app.register_blueprint(ds)
# Register examples
app.register_blueprint(examples.eg001)
app.register_blueprint(examples.eg002)
app.register_blueprint(examples.eg003)
app.register_blueprint(examples.eg004)
app.register_blueprint(examples.eg005)
app.register_blueprint(examples.eg006)
app.register_blueprint(examples.eg007)
app.register_blueprint(examples.eg008)
app.register_blueprint(examples.eg009)
app.register_blueprint(examples.eg010)
app.register_blueprint(examples.eg011)
app.register_blueprint(examples.eg012)
app.register_blueprint(examples.eg013)
app.register_blueprint(examples.eg014)
app.register_blueprint(examples.eg015)
app.register_blueprint(examples.eg016)
app.register_blueprint(examples.eg017)
app.register_blueprint(examples.eg018)
app.register_blueprint(examples.eg019)
app.register_blueprint(examples.eg020)
app.register_blueprint(examples.eg021)
app.register_blueprint(examples.eg022)
app.register_blueprint(examples.eg023)
app.register_blueprint(examples.eg024)
app.register_blueprint(examples.eg025)
app.register_blueprint(examples.eg026)
app.register_blueprint(examples.eg027)
app.register_blueprint(examples.eg028)
app.register_blueprint(examples.eg029)
app.register_blueprint(examples.eg030)
app.register_blueprint(examples.eg031)
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"))