diff options
Diffstat (limited to 'README')
-rw-r--r-- | README | 54 |
1 files changed, 43 insertions, 11 deletions
@@ -31,6 +31,18 @@ Flask has great documentation so I think you'll find it a pleasure to build on top of. +### Why not just neocities? + +Neocities is awesome! You should definitely host a site there. + +https://neocities.org/ + +It's easy to get a simple static site going there and it's totally free, but it +lacks server side scripting and a truly self-hosted option. This program gives +you a nice static base to start from, with the ability to script up you own +templates and whatever else Flask has to offer. + + ## Quick start It's recommended to run each server in it's own virtual environment. This @@ -38,11 +50,12 @@ program uses python 3.7, so change `python` to either `python3` or `python3.7` depending on your needs. First clone this repo (with git clone, or download the zip), change into the directory, then: - -`python -m venv env` -`pip install -r requirements.txt` -`python server.py` - +```bash +$ python -m venv env +$ source env/bin/activate +$ pip install -r requirements.txt +$ python server.py +``` Your server will (by default) be hosted on http://127.0.0.1:5000 @@ -119,6 +132,25 @@ You can of course link to external sites, but you must specify the protocol a relative path like `example.net/google.com`. +### Override base template + +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: + +```code +{% extends 'base.html' %} +{% block css%} +//your cool css here +{% endblock %} +{% block content %} +//your cool content here +{% endblock %} +``` + + ### Making Secret Directories and Files This program follows the Unix convention of placing a "." before directories @@ -156,8 +188,8 @@ replace the HTML with your own license (or none), by editing There are a few special directories linked that are needed to customize your site. First the `static` directory, which holds your static files like CSS templates and images. Second the `raw` directory, which allows -the user to access files the `templates/site` as raw files instead of HTML. -You can disable it by deleting the code under `send_file_from_site` or +the user to access files the `templates/site` as raw files instead of HTML. +You can disable it by deleting the code under `send_file_from_site` or `send_file_from_static` in `server.py`. @@ -168,10 +200,10 @@ an appropriate container. Refer to https://flask.palletsprojects.com/en/2.0.x/de for options, but an easy option I like is to use uwsgi since it's well documented. - -`python -m venv env` -`pip install uwsgi` -`doas -u www uwsgi -s /var/path/to/your-flask.sock --manage-script-name --mount /=server:app --virtualenv ./env` +```bash +$ sudo pip install uwsgi +$ uwsgi -s /var/path/to/your-flask.sock --manage-script-name --mount /=server:app --virtualenv ./env +``` Then point your main http daemon (niginx, apache, httpd) to the socket you made. There are examples for a nginx configuration in the uWSGI and Flask docs: |