Modern Python Projects Transcripts
Chapter: Managing Python project
Lecture: Advanced projects
0:00 As your project grows bigger, you might need to create even more files.
0:04 And to organize those files, you will need to create even more sub folders.
0:08 So this time, let's take a look at the real world example.
0:11 Here we have an example, Flask project from the flask
0:14 Documentation. Don't worry if you don't know what flask is,
0:17 it's a Web framework, just like Django.
0:20 We don't need to know how flask works to understand its file structure.
0:23 As you can see, we still have a folder with tests.
0:26 We still have some top level files like Manifest.in or setup.py,
0:31 just like we had requirements.txt and read me file before.
0:36 The main difference is that flask are, so the main folder with our application now contains
0:41 sub folders. But again, it's nothing magical.
0:45 We simply put files that belong together
0:47 inside folders. We have a folder called templates,
0:51 where we put HTML files for different Web pages of our application.
0:55 Every HTML file related to blog it's located inside blog folder, and every HTML file related
1:02 to authentication is stored inside the auth folder.
1:05 Also, all the static files are stored in the static folder.
1:09 That's a good structure that can take a long way.
1:12 But of course, it's not the only possibility.
1:14 If you feel that you don't like it and it actually gets in your way instead
1:18 of helping you, you might want to structure your project differently.
1:22 Those three projects that I showed you, so the simple one,
1:25 the medium size and this advanced one, are a typical progression of a python project
1:31 as it grows, some cookie cutter templates might use a different structure,
1:35 and you might like it better.
1:36 So, before you start writing code,
1:38 take a moment to think and plan how different parts of your application will interact with each other.