Update app.py

Added removal of escape template if not Nth page load
This commit is contained in:
Eric Lay 2024-03-27 11:24:52 -05:00 committed by GitHub
parent 574c66db5e
commit 7d373b8cf4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

6
app.py
View File

@ -13,7 +13,6 @@ unique_requests = set()
# OR change the ROOT_DIR path below :)
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
WEBSITE_DIRS = [name for name in os.listdir(ROOT_DIR) if not name.startswith('.') and os.path.isdir(os.path.join(ROOT_DIR, name))]
print(ROOT_DIR)
# Site choosing logic
website_dir = None
@ -24,6 +23,11 @@ def current_website_dir():
global website_dir
website_dir = str(ROOT_DIR+"/Marvel")
else:
global WEBSITE_DIRS
try:
WEBSITE_DIRS.remove('Marvel')
except ValueError:
pass
website_dir = random.choice(WEBSITE_DIRS)
# Make static files available