pop off old website_dir before setting one
This commit is contained in:
parent
a021840b59
commit
381d8c28ef
3
app.py
3
app.py
|
@ -16,6 +16,7 @@ WEBSITE_DIRS = [name for name in os.listdir(ROOT_DIR) if not name.startswith('.'
|
||||||
# Site choosing logic
|
# Site choosing logic
|
||||||
website_dir = None
|
website_dir = None
|
||||||
def current_website_dir():
|
def current_website_dir():
|
||||||
|
session.pop('website_dir', None)
|
||||||
if session['requests'] % 5 == 0:
|
if session['requests'] % 5 == 0:
|
||||||
session['website_dir'] = str(ROOT_DIR+"/Marvel")
|
session['website_dir'] = str(ROOT_DIR+"/Marvel")
|
||||||
elif session['requests'] % 6 == 0:
|
elif session['requests'] % 6 == 0:
|
||||||
|
@ -46,4 +47,4 @@ def index():
|
||||||
return send_from_directory(session['website_dir'], 'index.html')
|
return send_from_directory(session['website_dir'], 'index.html')
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(debug=True)
|
app.run()
|
||||||
|
|
Loading…
Reference in New Issue