summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md58
-rwxr-xr-xmigrate.py9
-rw-r--r--sql/README.md5
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