Modern Python Projects Transcripts
Chapter: Managing Python project
Lecture: Advanced projects

Login or purchase this course to watch this video and the rest of the course contents.
0:00 As your project grows bigger, you might need to create even more files. And to organize those files, you will need to create even more sub folders.
0:09 So this time, let's take a look at the real world example. Here we have an example, Flask project from the flask
0:15 Documentation. Don't worry if you don't know what flask is, it's a Web framework, just like Django.
0:21 We don't need to know how flask works to understand its file structure. As you can see, we still have a folder with tests.
0:27 We still have some top level files like or, just like we had requirements.txt and read me file before.
0:37 The main difference is that flask are, so the main folder with our application now contains sub folders. But again, it's nothing magical.
0:46 We simply put files that belong together inside folders. We have a folder called templates,
0:52 where we put HTML files for different Web pages of our application.
0:56 Every HTML file related to blog it's located inside blog folder, and every HTML file related to authentication is stored inside the auth folder.
1:06 Also, all the static files are stored in the static folder. That's a good structure that can take a long way.
1:13 But of course, it's not the only possibility. If you feel that you don't like it and it actually gets in your way instead
1:19 of helping you, you might want to structure your project differently. Those three projects that I showed you, so the simple one,
1:26 the medium size and this advanced one, are a typical progression of a Python project
1:32 as it grows, some cookie cutter templates might use a different structure, and you might like it better. So, before you start writing code,
1:39 take a moment to think and plan how different parts of your application will interact with each other.

Talk Python's Mastodon Michael Kennedy's Mastodon