updated readme

master
grumbulon 1 year ago
parent 00d30b5bc3
commit 4001344cbe
  1. 2
      .env
  2. 34
      README.md
  3. 5
      init.sh
  4. 1
      lush/__init__.py
  5. 5
      lush/blog.py
  6. 4
      lush/db.py

@ -0,0 +1,2 @@
export FLASK_APP=lush
export FLASK_ENV=production

@ -21,4 +21,36 @@ lush is a minimalist blogging platform for the common writer. It is currently in
1. Customized themes
# Install guide
coming soon (real)
### Installing via wheel
Installing lush is made easy with flask.
1. Dependencies to install are the python wheel package and waitress-serve.
* Run the following to install deps:
```
pip install wheel
pip install waitress
use whatever your OS' package manager is
sudo pacman -S waitress-serve
```
1. Next build the wheel distribution `python setup.py bdist_wheel`
* You can find the file in dist/lush-0.1.0-py3-none-any.whl.
1. finally install with `pip install dist/lush-0.1.0-py3-none-any.whl`
### Setting up lush
1. Environment vars will need to be set for the next step you can simply run `source init.sh`
1. Next we will initialize the DB by running `python3 -m flask init-db`
1. You will next want to generate your secret key - you may do it this way `python -c 'import secrets; print(secrets.token_hex())'`
1. Create the config.py file in the instance folder, and copy the generated value into it.
1. Create your first user by running `python3 -m flask addusr` and following the guided steps
* if you need to delete a user you can run rmusr
### Configure Nginx
to-do
### Running lush
the webserver can be launched with the following: `waitress-serve --port=80 --call 'lush:create_app'`

@ -0,0 +1,5 @@
#! /usr/bin/env bash
grep -v '^#' .env
export $(grep -v '^#' .env | xargs)

@ -34,5 +34,4 @@ def create_app(test_config=None):
from . import blog
app.register_blueprint(blog.bp)
app.add_url_rule('/', endpoint='index')
return app

@ -31,6 +31,11 @@ def userposts():
).fetchall()
return render_template('blog/index.html', posts=posts)
@bp.route('/about')
def about():
db = get_db()
@bp.route('/create', methods=('GET', 'POST'))
@login_required
def create():

@ -27,7 +27,7 @@ def init_db():
db = get_db()
with current_app.open_resource('schema.sql') as f:
db.executescript(f.read().decode('utf8'))
db.executescript(f.read().decode('utf-8'))
@click.command('init-db')
@with_appcontext
@ -84,4 +84,4 @@ def init_app(app):
app.teardown_appcontext(close_db)
app.cli.add_command(init_db_command)
app.cli.add_command(addusr_command)
app.cli.add_command(rmusr_command)
app.cli.add_command(rmusr_command)

Loading…
Cancel
Save