Spaces:
Configuration error
Configuration error
Upload credentials.py
Browse files- Data/credentials.py +42 -0
Data/credentials.py
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# -*- coding: utf-8 -*-
|
2 |
+
"""
|
3 |
+
Created on Fri Feb 11 21:08:28 2022
|
4 |
+
|
5 |
+
@author: bullm
|
6 |
+
"""
|
7 |
+
|
8 |
+
import os
|
9 |
+
import streamlit as st
|
10 |
+
|
11 |
+
try:
|
12 |
+
credentials_s3 = {
|
13 |
+
"S3_BUCKET": st.secrets['S3_BUCKET'],
|
14 |
+
"S3_KEY_ID": st.secrets['S3_KEY_ID'],
|
15 |
+
"S3_SECRET_KEY": st.secrets["S3_SECRET_KEY"]
|
16 |
+
}
|
17 |
+
except Exception:
|
18 |
+
credentials_s3 = {
|
19 |
+
"S3_BUCKET": os.environ.get('S3_BUCKET'),
|
20 |
+
"S3_KEY_ID": os.environ.get('S3_KEY_ID'),
|
21 |
+
"S3_SECRET_KEY": os.environ.get("S3_SECRET_KEY")
|
22 |
+
}
|
23 |
+
|
24 |
+
try:
|
25 |
+
credentials_postgresql = {
|
26 |
+
"POSTGRESQL": st.secrets["HEROKU_POSTGRESQL_COBALT_URL"]
|
27 |
+
}
|
28 |
+
except Exception:
|
29 |
+
credentials_postgresql = {
|
30 |
+
"POSTGRESQL": os.environ.get("HEROKU_POSTGRESQL_COBALT_URL")
|
31 |
+
}
|
32 |
+
|
33 |
+
try:
|
34 |
+
credentials_mailer = {
|
35 |
+
"EMAILPASS": st.secrets["EMAIL_PASSWORD"],
|
36 |
+
"EMAILSENDER": st.secrets["EMAIL_SENDER"]
|
37 |
+
}
|
38 |
+
except Exception:
|
39 |
+
credentials_mailer = {
|
40 |
+
"EMAILPASS": os.environ.get("EMAIL_PASSWORD"),
|
41 |
+
"EMAILSENDER": os.environ.get("EMAIL_SENDER")
|
42 |
+
}
|