A
A
Alexander Karpenko2019-01-28 10:15:12
Python
Alexander Karpenko, 2019-01-28 10:15:12

How to organize an automatic transition to the address '/home' when the user accesses the address '/'?

Here is a screenshot of the project:
5c4eabc378a79329660749.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2019-01-28
@selfAlex

@webApp.route('/')
def root_page():
    return redirect(url_for('main_page'))
@webApp.route('/home')
def main_page() -> str:
   return 'Welcome'

A
alternativshik, 2019-01-28
@alternativshik

If normal, then by means of nginx which will stand before the flag. If hunting on a flask - then give a redirect. If you need the same answer for 2 urls, then write 2 decorators with urls side by side, one under one...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question