Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard layout for Python web applications #6

Open
4 tasks
abitrolly opened this issue Jul 15, 2018 · 2 comments
Open
4 tasks

Standard layout for Python web applications #6

abitrolly opened this issue Jul 15, 2018 · 2 comments

Comments

@abitrolly
Copy link
Member

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.

  • .wsgi file with entrypoint to your web application should be at the top
  • .wsgi is named after your app/project (fedora-packages.wsgi)
  • top level static directory with static resources (images, css, ...) and README.md explaining how they are mapped (URL on the webserver) and deployed (CDN, webserver config)
  • top level requirements.txt file or requirements/ dir for automated dependency analysis
@abitrolly
Copy link
Member Author

abitrolly commented Jul 19, 2018

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
Copy link
Member Author

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.

@abitrolly abitrolly transferred this issue from yakshaveinc/tasks Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant