Re:Ask HN: Fastest/easiest framework to build a web applicat...
by DangitBobby on Tuesday January 28, 2020 @04:01AM
(#22167675)
You run collectstatic to get all of your static assets in one folder, use gunicorn (python package, there are other options as well such as uwsgi) to serve your wsgi server, and have nginx in front of gunicorn to intercept anything with /static/* to pull from your static assets folder. This is all 3 or 4 lines of config in nginx.
Your first try might take a couple of hours to get right. If you want HTTPS (you should) Caddy might be a better route than nginx. It's certainly easier.
Re:Ask HN: Fastest/easiest framework to build a web applicat...
by franga2000 on Monday January 27, 2020 @05:06PM
(#22164334)
For Apache, the easiest is just using mod_wsgi and pointing it at your source folder. It takes 3 trivial lines of Apache configs if you're using system-wide Python and 2 additional slightly longer ones to use a virtualenv instead (recommended) - all nice and copy-pastable from the official docs.
Nginx has a similar module, but I haven't used it personally.
I know PHP is super easy but wasn't sure how it was for Python frameworks?