aboutsummaryrefslogtreecommitdiffstats
path: root/server.py
diff options
context:
space:
mode:
authormjfernez <mjfernez@gmail.com>2021-08-25 20:05:00 -0400
committermjfernez <mjfernez@gmail.com>2021-08-25 20:05:00 -0400
commit6ddd97e1c39f55fe60fca093ca4fe610eca6d462 (patch)
treeb735576a0d7fa08364ea56b131e3ae47e7178d74 /server.py
parent4972877f8ef0e0e3664d3dd0edd651107ddc026f (diff)
downloadezcms-6ddd97e1c39f55fe60fca093ca4fe610eca6d462.tar.gz
Clarify siteconfig
This clarifies what the MAIN_SITE_DIRS option means since one might read it to mean you can put your directories anywhere. Not so, you can only pick which dirs are displayed with that option. Also recommends to not use the secret key unless needed (for what reason, I don't know).
Diffstat (limited to 'server.py')
-rw-r--r--server.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/server.py b/server.py
index ea04690..1908ad3 100644
--- a/server.py
+++ b/server.py
@@ -6,6 +6,7 @@ app = Flask(__name__)
from views import *
+
def setup():
"""
setup - sets up the app according to the settings specified (or not
@@ -20,21 +21,18 @@ def setup():
if siteconfig.MAIN_SITE_DIRS:
app.config.update({'MAIN_SITE_DIRS': siteconfig.MAIN_SITE_DIRS})
else:
- s = './templates/site/'
+ s = "./templates/site/"
top_dirs = [
x for x in os.listdir(s) \
- if os.path.isdir(s + x) and not x.startswith('.')
+ if os.path.isdir(s + x) and not x.startswith(".")
]
- app.config.update(
- {
- 'MAIN_SITE_DIRS': sorted(top_dirs)
- }
- )
+ app.config.update({'MAIN_SITE_DIRS': sorted(top_dirs)})
app.config.update({'DOMAIN': siteconfig.DOMAIN})
app.config.update({'HOME_TITLE': siteconfig.HOME_TITLE})
+
# Setup needs to come first to be compatible with wsgi
setup()
-if __name__ == '__main__':
+if __name__ == "__main__":
app.run()