Modularizing your flask app

For complex and larger flask project, you probably want to structure you application well.

for example,



---> /tour

---> /user

For me, i rather put my starter code into instead of so clearly my intention are clearly shown.

Sample of my looks like this. This is where i reference my other controllers and hooked up into flask blueprint. Flask blueprint allow us to modularize our app.

Sample of my looks as follow :-

From line 10 and 11, you can see that i am importing my controllers and modularizing it.

My controllers typically looks like this :-

Now you can go and browse http://localhost:port/tour


Popular posts from this blog

PySpark - Working with JDBC Sqlite database