diff options
author | Matt Arnold | 2025-04-16 11:26:37 -0400 |
---|---|---|
committer | Matt Arnold | 2025-04-16 11:26:37 -0400 |
commit | 50d4a8634f134c0d5276f7ed65d06fa9ddbf03a7 (patch) | |
tree | 5bc2f8a7283fe1d6f778ece92118ba7194331208 | |
parent | 5ac700d8dd4c2a22aff20226e426302b6c2c46ab (diff) |
Documentation fixes and blerg
-rw-r--r-- | README.md | 58 | ||||
-rwxr-xr-x | migrate.py | 9 | ||||
-rw-r--r-- | sql/README.md | 5 |
3 files changed, 71 insertions, 1 deletions
diff --git a/README.md b/README.md index 0d71c94..a093aa3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,62 @@ **Where all your vibes live** -A forum engine in progress. Do not use in production. Run ./migrate.py install and follow the prompts. +A forum engine in progress. Do not use in production. Run ./migrate.py install and follow the prompts. Full install instructions below. It needs everything, posting, and reply works! So it can be hacked on further 😅 + +# Full install instructions + +## step 1 +If you've never done python before.. Python projects live inside little boxes call virtual envs. To set one up for this project. Do + +```shell +python -m venv venv +``` +That will set up a virtual env in the customary place. To use it +## step 2 +```shell +source ./venv/bin/activate +``` +## step 3 +Then you install the dependencies like so +```shell +pip install -r requirements.txt +``` +## step 4 +Next run migrate install, and follow all the prompts +```shell +./migrate.py install +``` +## step 5 +Finally boot app.py + +```shell +./app.py +``` +It will setup a listener on port 5052 + + +## step 6 + +When done playing exit the app server by pressing ctrl-c then run +```shell +deactivate +``` + +# stuff to do on a git pull + +```shell +./migrate.py upgrade-schema +pip install -r requirements.txt +``` + + +# known bugs + + +The app server will invalidate your cookies on every make a change, and reload. as it regenerates the secret key used for session signing every time it restarts with stat. +I will fix this eventually. + + +Thus endith the instructions \ No newline at end of file diff --git a/migrate.py b/migrate.py index c386a0e..1de40da 100755 --- a/migrate.py +++ b/migrate.py @@ -24,6 +24,7 @@ def cli(): @cli.command def install(): + """Installs a new database""" database.create_tables([NewUser, Post, Faccet]) username = click.prompt("Enter a user account name:", default="user", type=str) @@ -46,5 +47,13 @@ def install(): click.echo(styled) +@cli.command +def upgrade_schema(): + """Upgrade the database if needed""" + stub_msg = click.style("You are on the latest database", fg="white", bold=True) + click.echo(stub_msg) + exit(0) + + if __name__ == "__main__": cli() diff --git a/sql/README.md b/sql/README.md new file mode 100644 index 0000000..21a3e48 --- /dev/null +++ b/sql/README.md @@ -0,0 +1,5 @@ +# Schema Migrations + +Ok peewee doesn't have great migration support as yet. +Whenever you alter models.py, Please put an sql file with ALTER TABLE statement in here +and run it with migrate.py. \ No newline at end of file |