File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 1
1
from flask import Flask
2
2
app = Flask (__name__ )
3
- app .config .from_envvar ('TANUKI_CONFIG' , silent = False )
4
- app .debug = app .config ["DEBUG" ]
5
-
6
3
import tanuki .views
7
4
8
5
# this package wants something external to run app
Original file line number Diff line number Diff line change
1
+ class DefaultConfig :
2
+ DEBUG = True
3
+
4
+ class ProductionConfig :
5
+ DEBUG = False
6
+
Original file line number Diff line number Diff line change
1
+ import os
2
+
1
3
from flask import request , redirect , url_for
2
4
from flask .ext .bower import Bower
3
5
from lib import Tanuki
4
- from tanuki import app
6
+ from tanuki import app , settings
5
7
6
8
__author__ = "siznax"
7
9
__date__ = "Jan 2015"
8
10
9
- app .config .from_envvar ('TANUKI_CONFIG' , silent = False )
10
- Bower (app )
11
+ app .config .from_object (settings .DefaultConfig )
12
+ if '/var/www/' in os .getcwd ():
13
+ app .config .from_object (settings .ProductionConfig )
11
14
15
+ Bower (app )
12
16
applib = Tanuki (app .config )
13
17
14
18
You can’t perform that action at this time.
0 commit comments