From 945594509e6a19ab0229e9949691e2f7652ea500 Mon Sep 17 00:00:00 2001 From: mjfernez Date: Tue, 15 Jun 2021 23:28:40 -0400 Subject: Changed / to /site, added views.py, README amended Previously this program served files in the 'templates/site' dir on '/', but this caused problems when accessing raw files using '/raw/' which is useful for embedding or quickly downloading content. It's also an inconvenience to the user, since they have to add a word rather than double-clicking an replacing it. The main server file and the base and index templates have been changed to reflect this. The codebase has been reorganized to separate views from the main flask app. Blueprints were avoided since only one blueprint would be needed so thus unnecessary. README and docstrings were also expanded for clarity and edited for errors. Some comments --- README | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'README') diff --git a/README b/README index ddc1932..a0a84f2 100644 --- a/README +++ b/README @@ -24,11 +24,11 @@ elsewhere. Why not just use a database or the million other CMS software packages out there? Zero reason not to! I just wanted to see what it would look like to build something from the ground up WITHOUT having to copy HTML over and over -again. Databases are great, but so are filesystems, and I see no reason to +again. Databases are great, but so are file systems, and I see no reason to overcomplicate when making a simple home page. This software is primarily geared towards bloggers or people who want a home page like it's 1999, but Flask has great documentation so I think you'll find it a pleasure to build on -top of. +top of if you want to get creative. ### Why not just neocities? @@ -58,8 +58,10 @@ $ python server.py ``` Your server will (by default) be hosted on http://127.0.0.1:5000 -and have the `templates/site/` directory mounted. You should see `home.html` -render. +and have the `templates/site/` directory delivered to your users when they +access http://127.0.0.1:5000/site/ + +You should see `home.html` render on the root directory. ## Adding Pages @@ -70,7 +72,7 @@ particular is special since it contains the top-level folders which will be used to navigate your site, but any folders beneath will be automatically indexed. -As an excercise, add a file to the `templates/site/thoughts/rants` folder +As an exercise, add a file to the `templates/site/thoughts/rants` folder called `myrant.html` and put the following content: `

I don't like spam!

` @@ -185,7 +187,7 @@ replace the HTML with your own license (or none), by editing `templates/site/license.html` -### Other tips +### Other Tips There are a few special directories linked that are needed to customize your site. First the `static` directory, which holds your static @@ -204,6 +206,8 @@ documented. A quickstart looks like this: ```bash $ sudo pip install uwsgi +$ sudo mkdir /var/path/to/your-flask/ +$ sudo chown www-data -R /var/path/to/your-flask $ uwsgi -s /var/path/to/your-flask.sock --manage-script-name --mount /=server:app --virtualenv ./env ``` -- cgit v1.2.3