File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change
1
+ import os
2
+
1
3
from flask import Flask
2
4
from flask_sqlalchemy import SQLAlchemy
3
5
from flask_admin import Admin
@@ -17,6 +19,12 @@ def create_app():
17
19
app .config ['SQLALCHEMY_DATABASE_URI' ] = \
18
20
'postgresql+psycopg2://localhost:5432/test'
19
21
22
+ # Flask-ImageAlchemy config
23
+ app .config ['AWS_ACCESS_KEY_ID' ] = os .environ .get ('AWS_ACCESS_KEY_ID' )
24
+ app .config ['AWS_SECRET_ACCESS_KEY' ] = os .environ .get ('AWS_SECRET_ACCESS_KEY' )
25
+ app .config ['AWS_REGION_NAME' ] = os .environ .get ('AWS_REGION_NAME' , 'eu-central-1' )
26
+ app .config ['S3_BUCKET_NAME' ] = os .environ .get ('AWS_REGION_NAME' , 'haraka-local' )
27
+
20
28
# init extensions
21
29
db .init_app (app )
22
30
admin .init_app (app )
Original file line number Diff line number Diff line change
1
+ import os
2
+
1
3
from flask import Flask
2
4
from flask import render_template
3
5
from flask_sqlalchemy import SQLAlchemy
@@ -21,6 +23,12 @@ def create_app():
21
23
app .config ['SQLALCHEMY_DATABASE_URI' ] = \
22
24
'postgresql+psycopg2://localhost:5432/test'
23
25
26
+ # Flask-ImageAlchemy config
27
+ app .config ['AWS_ACCESS_KEY_ID' ] = os .environ .get ('AWS_ACCESS_KEY_ID' )
28
+ app .config ['AWS_SECRET_ACCESS_KEY' ] = os .environ .get ('AWS_SECRET_ACCESS_KEY' )
29
+ app .config ['AWS_REGION_NAME' ] = os .environ .get ('AWS_REGION_NAME' , 'eu-central-1' )
30
+ app .config ['S3_BUCKET_NAME' ] = os .environ .get ('AWS_REGION_NAME' , 'haraka-local' )
31
+
24
32
# init extensions
25
33
db .init_app (app )
26
34
admin .init_app (app )
You can’t perform that action at this time.
0 commit comments