diff --git a/.gitignore b/.gitignore index aa6d288..ed3737b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ settings.yml static/ -server/__pycache__ +**/__pycache__ diff --git a/README.md b/README.md index a0e537c..9148d4f 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,88 @@ # startinblox-startinoff +## Quick-start: Gettin' started with Startin'blox + +1. Sign up for an account on https://git.startinblox.com +2. Add your SSH key here: https://git.startinblox.com/profile/keys +3. Create a project folder, I'll use `export PROJECT_FOLDER=~/Projects/Autonomic/StartinBlox/` -- all subsequent steps are run from `$PROJECT_FOLDER` +4. (Optional) Create a Python virtual environment using your preferred method, + or e.g. + ``` + $ python3 -m venv $PROJECT_FOLDER/venv + $ source $PROJECT_FOLDER/venv/bin/activate + ``` +5. Check out the `djangoldp` code: + ``` + $ git clone git@git.startinblox.com:djangoldp-packages/djangoldp.git + ``` + and install it: + ``` + $ cd $PROJECT_FOLDER/djangoldp + $ pip install -e . + $ pip install psycopg2 pycryptodomex # is this still needed? + ``` +6. Check out this very repository: + ``` + $ git clone https://git.autonomic.zone/decentral1se/startinblox-startinoff + ``` +7. Install dependencies: + ``` + $ djangoldp install + ``` +8. Run database migrations: + ``` + $ python manage.py migrate + ``` +9. Launch the development server: + ``` + $ python manage.py runserver + $ # Or, alternatively: + $ djangoldp runserver + ``` + +## Quick start 2: this time, it's Hubl! + + +## Architecture 🏗 + `djangoldp` is a Django app which you plug into a Django project. So, if you're -hacking on `djangoldp` then you need a Django project to test it. When you -follow this [setup +hacking on `djangoldp` or related apps, then you need a Django project to test it. + +When you follow this [setup guide](https://git.startinblox.com/djangoldp-packages/djangoldp#setup-a-djangoldp-server), you get asked to run `djangoldp initserver myldpserver` (where I changed `myldpserver` to `startinblox-startinoff`) and what spits out is what you also -see in this repository but with a working `setting.yml` file. If you create a -virtual environment for `djangoldp` code then keep that virtual environment -sourced and you can then run `./manage.py` here in this project folder to test -your changes. +see in this repository but with a working `settings.yml` file. ``` -➜ startinblox tree -L 1 +user@machine:/path/to/startinblox$ tree -L 1 . -├── djangoldp (source .venv/bin/activate here and hack away) +├── djangoldp └── startinblox-startinoff (run ./manage.py commands here which uses your djangoldp code) 2 directories, 0 files ``` + +## Using Postgres instead of SQLite + +In the early days, we were using PostgreSQL, and we may yet need to return to +its warm embrace. To do so: + +1. Install and start Postgres + - Mac OSX: https://www.postgresql.org/download/macosx/, or `brew install postgresql`, then `brew services start postgresql` + - Fedora: `dnf install postgresql-server && sudo systemctl enable postgresql.service && sudo systemctl start postgresql.service` +2. Create a user and a database: + ``` + $ createuser djangoldp + $ createdb -O djangoldp djangoldp + ``` + (you may need `sudo -u postgres` or `-U postgres` on both of these commands, + depending on your local security set-up) +3. Edit `settings.yml` if you need to remove the postgres user or change the + password + +## Troubleshooting / top tips + +* Remember to activate your virtual environment, if you're using one, before + running any Python / `manage.py` / `djangoldp` commands + diff --git a/server/migrations/__pycache__/0001_initial.cpython-37.pyc b/server/migrations/__pycache__/0001_initial.cpython-37.pyc deleted file mode 100644 index 1c58d03..0000000 Binary files a/server/migrations/__pycache__/0001_initial.cpython-37.pyc and /dev/null differ diff --git a/server/migrations/__pycache__/0001_initial.cpython-39.pyc b/server/migrations/__pycache__/0001_initial.cpython-39.pyc deleted file mode 100644 index af2ad08..0000000 Binary files a/server/migrations/__pycache__/0001_initial.cpython-39.pyc and /dev/null differ diff --git a/server/migrations/__pycache__/0002_auto_20210315_1108.cpython-37.pyc b/server/migrations/__pycache__/0002_auto_20210315_1108.cpython-37.pyc deleted file mode 100644 index b4cb4ab..0000000 Binary files a/server/migrations/__pycache__/0002_auto_20210315_1108.cpython-37.pyc and /dev/null differ diff --git a/server/migrations/__pycache__/0002_auto_20210315_1108.cpython-39.pyc b/server/migrations/__pycache__/0002_auto_20210315_1108.cpython-39.pyc deleted file mode 100644 index c9321a7..0000000 Binary files a/server/migrations/__pycache__/0002_auto_20210315_1108.cpython-39.pyc and /dev/null differ diff --git a/server/migrations/__pycache__/0003_delete_todo.cpython-37.pyc b/server/migrations/__pycache__/0003_delete_todo.cpython-37.pyc deleted file mode 100644 index bdba30a..0000000 Binary files a/server/migrations/__pycache__/0003_delete_todo.cpython-37.pyc and /dev/null differ diff --git a/server/migrations/__pycache__/0003_delete_todo.cpython-39.pyc b/server/migrations/__pycache__/0003_delete_todo.cpython-39.pyc deleted file mode 100644 index 8fe62ba..0000000 Binary files a/server/migrations/__pycache__/0003_delete_todo.cpython-39.pyc and /dev/null differ diff --git a/server/migrations/__pycache__/__init__.cpython-37.pyc b/server/migrations/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index aa88342..0000000 Binary files a/server/migrations/__pycache__/__init__.cpython-37.pyc and /dev/null differ diff --git a/server/migrations/__pycache__/__init__.cpython-39.pyc b/server/migrations/__pycache__/__init__.cpython-39.pyc deleted file mode 100644 index 56863a5..0000000 Binary files a/server/migrations/__pycache__/__init__.cpython-39.pyc and /dev/null differ