From cd2e4fca26aa4d57c2b80e5dcc4a6b9d36083445 Mon Sep 17 00:00:00 2001 From: ahosking Date: Sat, 25 Mar 2023 11:51:36 -0400 Subject: [PATCH] Chore: Add Developer Documentation Add Instructions for getting started from scratch Add command to create/run a database for dev/testing Specify Python version for pyenv Update requirements for nev versions of packages --- .python-version | 1 + README.md | 22 +++++++++++++++++++--- requirements.txt | Bin 548 -> 260 bytes 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 .python-version diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..a5c4c76 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.9.0 diff --git a/README.md b/README.md index b894f7c..e57334d 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,30 @@ The AHosking.com API ## Getting Started ### + 1. `sudo apt install libpq-dev python-dev python3-psycopg2` 1. `pip install virtualenv` 1. `python3 -m virtualenv .env` 1. Activate environment -`.\.env\Scripts\activate` -1. + `.\.env\Scripts\activate` +1. `export DEBUG=false` +1. `docker run --name api-postgres -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_USER=api -e POSTGRES_DB=api -p 5432:5432 -d postgres` +1. ``` + export DATABASE_HOST=localhost + export DATABASE_PORT=5432 + export DATABASE_USER=api + export DATABASE_PASSWORD=mysecretpassword + export DATABASE_NAME=api + ``` +1. `python3 manage.py makemigrations` +1. `python3 manage.py migrate` +1. `python3 manage.py createsuperuser` +1. `python manage.py runserver 0.0.0.0:9000` +## Troubleshooting + +`pip3 install --upgrade --force-reinstall -r requirements.txt` will re-install requirements and upgrade based on requirements.txt ### Third-party -* https://pypi.org/project/django-3-jet/ \ No newline at end of file +- https://pypi.org/project/django-4-jet/ diff --git a/requirements.txt b/requirements.txt index cec27636e262189e85cbf58985ef439f03b20456..8b37ad6aefe2a8034df377e9a6c109623dabf744 100644 GIT binary patch literal 260 zcmYL^!4kqC3`FnzOEW-G+e2>t2->t#DaY~t!h!iE-JGpDooG&GD!3``C4KYErGR=B*`QaD W-(k^wN&`_!#^>a9h*Ta`Ir#(G8BbpT literal 548 zcmZva&2EBF5QWdWN#B8VuK{ctjp@#%@6eEP>7OD6ZN-Og`^{W5G%Yh8(t!}i^y9(7XyGu2vy6|c_s!mW&I0x;W%%D>4`4uwY_~l)9 zJXzOBp1c0{tspnJ22vWElkFO5GjwnjT%j$eZ&J7VaFxxKp|$C3vW9xCQU|;b(9zkL zDO4mn^?JsmVgCF=EZk|Sg!dadSx4)$)f4@D&k#5zu1IvJH51fyIr1ExdsMHeYIat- zN1(p