please add flask in "Structuring Your Project"
Writing Great Python Code ---- Structuring Your Project ----------Regarding Django Applications
Structure of Code is Key, it is true. In this paragraph, someone writes about Django, but I must say Flask is a big problem, because when you use django shell to create a project, it will always as it designed, if you use Flask... project structure will be different with everyone. For this reason, I think flask is not safe for human consumption at all. 😆 If anyone can create an example project ?
What about cookiecutter templates? https://github.com/sloria/cookiecutter-flask https://github.com/candidtim/cookiecutter-flask-minimal https://github.com/karec/cookiecutter-flask-restful
In my opinion there is no perfect project structure. It also applies to Django and any other python web framework.
@Yensan I agree w/ you that structuring Flask projects is more open-ended than Django.
Rather than pulling Flask into the guide, however, I think the section entitled 'Regarding Django Applications' should be edited to 'Avoid Repetitive Paths'.
I've written a blog post about this problem, a lot of Python projects in addition to Django make this mistake.
@Yensan I agree w/ you that structuring Flask projects is more open-ended than Django.
Rather than pulling Flask into the guide, however, I think the section entitled 'Regarding Django Applications' should be edited to 'Avoid Repetitive Paths'.
I've written a blog post about this problem, a lot of Python projects in addition to Django make this mistake.
@zachvalenta However, for me, 'Repetitive Paths' is not a problem at all. Some weeks ago, I took over a flask project that just like spaghetti, I almost want to kill myself. Then, I made a fake Django from Flask, and fake django-rest-framework is on the way.
@zachvalenta sorry, but I have to say, that your blog post is totally wrong. Please take a look at https://docs.python-guide.org/writing/structure/#sample-repository for an correct example.
Some more words to clarify .. correct me if I'am wrong:
-
The problem named in chapter "-Regarding Django Applications" is. that django creates
<repo-foo>/<src-foo>/<py-pkg-foo>where all folders are named foo. -
The correct form from the example is
<repo-foo>/<py-pkg-foo> -
In your blog post you recommend
<repo-foo>/src
BTW: in your blog post the flask example is not true (anymore) and in your 'hope' section you say:
here are exceptions. pytest and Pillow both put their source code in, well, src."
.. please double check the projects you refer. E.g. pillow uses the src folder for C-sources and Py-sources, which is not common use case. There are so many bugs your blog post, confusing beginners .. please drop it.
.. please double check the projects you refer. E.g. pillow uses the src folder for C-sources and Py-sources, which is not common use case. There are so many bugs your blog post, confusing beginners .. please drop it.
@return42 Thank you. He just a nice guy and want to help... 'drop it' have some tone. Every one can keep his opinion.
@kedod
thank you. But I build an fake django with Flask. Welcome to commit!!!
https://github.com/Yensan/Schurz