From 85b8737e96860a9e0c957e8117efad1c18adc11c Mon Sep 17 00:00:00 2001 From: mjfernez Date: Tue, 8 Jun 2021 20:00:07 -0400 Subject: Added some more uwsgi tips to README --- README | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/README b/README index 9dc6c4c..7889bc2 100644 --- a/README +++ b/README @@ -138,7 +138,7 @@ Have a page with custom CSS, or need to get rid of the navbar entirely? No worries! Just add a '!' at the end of you html file and EZCMS will interpret it as it's own Jinja template without adding everything from the base template. Tip: if you're just changing the CSS, you can start with the following -boilerplate: +boilerplate that I provide: ```code {% extends 'base.html' %} @@ -161,10 +161,10 @@ user will receive a 404 error if they attempt to do so. ### Mimetype Configuration -Default mime types are primarily sourced from this page with some of my own -additions for common source code files (like .c or .py): +Default mime types are primarily sourced from +[this page](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types) +with some of my own additions for common source code files (like .c or .py): -https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types You can add your own by editing the 'mimetypes.csv' file in the following format: @@ -198,7 +198,7 @@ You can disable it by deleting the code under `send_file_from_site` or You should NOT run this server as in the quick start, but instead deploy it in an appropriate container. Refer to https://flask.palletsprojects.com/en/2.0.x/deploying/ for options, but an easy option I like is to use uwsgi since it's well -documented. +documented. A quickstart looks like this: ```bash $ sudo pip install uwsgi @@ -210,3 +210,20 @@ made. There are examples for a nginx configuration in the uWSGI and Flask docs: - https://uwsgi-docs.readthedocs.io/en/latest/Nginx.html - https://flask.palletsprojects.com/en/2.0.x/deploying/uwsgi/ + + +I personally recommend making an ini file so you can run `uwsgi --ini yourini.ini` +without all the extra arguments. A simple ini file, which I stole from +[here](https://github.com/mking/flask-uwsgi), looks like this: + +```code +[uwsgi] +socket = /var/www/run/flask-main/flask-main.sock +home = env +wsgi-file = server.py +callable = app +master = true +die-on-term = true +processes = 4 +logger = file:/var/www/logs/uwsgi.log +``` -- cgit v1.2.3