Spaces:
Sleeping
Sleeping
nastasiasnk
commited on
Commit
•
c1b14f2
1
Parent(s):
fe29f9c
Update app.py
Browse files
app.py
CHANGED
@@ -14,16 +14,24 @@ from RECODE_speckle_utils import speckle_utils # Importing from the modified sy
|
|
14 |
"""
|
15 |
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
from config import landuseDatabaseId , subdomainAttributesDatabaseId
|
18 |
from imports_utils import fetch_all_database_pages
|
19 |
|
20 |
-
if notionToken:
|
21 |
-
notion = client_notion(auth=userdata.get(notionToken))
|
22 |
-
landuse_attributes = fetch_all_database_pages(notion, landuseDatabaseId)
|
23 |
-
livability_attributes = fetch_all_database_pages(notion, subdomainAttributesDatabaseId)
|
24 |
-
else:
|
25 |
-
print ("Notion token is not provided")
|
26 |
|
|
|
|
|
|
|
27 |
|
28 |
|
29 |
|
|
|
14 |
"""
|
15 |
|
16 |
|
17 |
+
import os
|
18 |
+
|
19 |
+
# Accessing the secret variable
|
20 |
+
notionToken = os.getenv('notionToken')
|
21 |
+
|
22 |
+
if notionToken is None:
|
23 |
+
raise Exception("Secret token not found. Please check the environment variables.")
|
24 |
+
else:
|
25 |
+
print("Secret token found successfully!")
|
26 |
+
|
27 |
+
|
28 |
from config import landuseDatabaseId , subdomainAttributesDatabaseId
|
29 |
from imports_utils import fetch_all_database_pages
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
+
notion = client_notion(auth=userdata.get(notionToken))
|
33 |
+
landuse_attributes = fetch_all_database_pages(notion, landuseDatabaseId)
|
34 |
+
livability_attributes = fetch_all_database_pages(notion, subdomainAttributesDatabaseId)
|
35 |
|
36 |
|
37 |
|