Browse Source

rewriting redirects

pull/30/head
manetta 3 years ago
parent
commit
f7105a30bf
  1. 4
      octomode.py

4
octomode.py

@ -108,13 +108,13 @@ def index():
exts = ['.md', '.css'] exts = ['.md', '.css']
for ext in exts: for ext in exts:
create_pad_on_first_run(name, ext) create_pad_on_first_run(name, ext)
return redirect(url_for('pad', name=name)) return redirect(f'{ APP.config["APPLICATION_ROOT"] }{ name }/pad/')
else: else:
return render_template('start.html', application_root=APP.config["APPLICATION_ROOT"]) return render_template('start.html', application_root=APP.config["APPLICATION_ROOT"])
@APP.route('/<name>/') @APP.route('/<name>/')
def main(name): def main(name):
return redirect(url_for('pad', name=name)) return redirect(f'{ APP.config["APPLICATION_ROOT"] }{ name }/pad/')
@APP.route('/<name>/pad/') @APP.route('/<name>/pad/')
def pad(name): def pad(name):

Loading…
Cancel
Save