A
A
Artemiy Vereshchinskiy2018-03-28 12:05:49
Flask
Artemiy Vereshchinskiy, 2018-03-28 12:05:49

How to resolve static and generated site urls at the same level using flask(python)?

Colleagues, tell me how to implement the structure of urls like Instagram, for example?
How does their back understands that you need to open a static page at the URL https://www.instagram.com/developer/ and get content from one source, and at the URL https://www.instagram.com/username123/ from another? The mechanism of checking for a user-non-user is interesting. Writing the question led me to the idea that they have a database with reserved urls, and when opening any url, their back first checks it, then, if it doesn’t find it, it goes through the database with users, and if it’s empty, will it return 404? Is this how it's done or is there a smarter way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2018-03-28
@opium

What prevents you from distinguishing static pages from usernames, you know both

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question