File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 14
14
app .config .from_object ('config.Config' )
15
15
db = SQLAlchemy (app )
16
16
migrate = Migrate (app , db )
17
-
18
- cache = Cache (config = {'CACHE_TYPE' : 'SimpleCache' , 'CACHE_DEFAULT_TIMEOUT' : 300 })
19
- cache .init_app (app )
17
+ cache = Cache (app )
20
18
21
19
class UserModel (db .Model ):
22
20
id = db .Column (db .Integer , primary_key = True )
@@ -76,7 +74,7 @@ def get(self, user_id):
76
74
class Users (Resource ):
77
75
@app .route ("/" )
78
76
def index ():
79
- return redirect ('/users' )
77
+ return redirect ('/users' )
80
78
81
79
@cache .cached (query_string = True )
82
80
@marshal_with (resource_fields )
Original file line number Diff line number Diff line change @@ -16,3 +16,6 @@ class Config:
16
16
SQLALCHEMY_TABLE = 'migrations'
17
17
SQLALCHEMY_DB_SCHEMA = 'public'
18
18
SQLALCHEMY_TRACK_MODIFICATIONS = False
19
+
20
+ CACHE_TYPE = 'SimpleCache'
21
+ CACHE_DEFAULT_TIMEOUT = 300
You can’t perform that action at this time.
0 commit comments