yakshaveinc / python

Shaving Python Yaks
https://yakshaveinc.github.io/python/
The Unlicense
0 stars 0 forks source link

Standard layout for Python web applications #6

Open abitrolly opened 6 years ago

abitrolly commented 6 years ago

How many hours did you spend trying to figure out how your new open source project works? Looking through Vagrant and Docker files, learning Ansible and setup.py... What if there was a single entrypoint and a set of conventions, so that your editor can detect and quickly give you all clues that are necessary to run and debug your project as if it was in production? Let's try to define some of those yak shaving conventions.

abitrolly commented 6 years ago

This is good - http://exploreflask.com/en/latest/organizing.html - start with simple project and upgrade to modular later. The bad thing is that config is potentially executable .py file.

abitrolly commented 6 years ago

Having just single app.wsgi is more simple than calculating repository name. Maybe the "standard layout" is better be replaced with detection algorithm.

FT-01-A: Use app.wsgi no matter what is present. FT-01-B: Just use any .wsgi is there is one file.

The standard layout, it appears, only makes sense if there are multiple .wsgi files. Also if .wsgi doesn't work out of the box and it is useless to run/detect it automatically. Therefore, use app.wsgi when application can be run from repository, and choose package name when complicated setup is still required.