From 6976c15a4d1d73daf321298b8a246dd2633e0ec9 Mon Sep 17 00:00:00 2001 From: 3wc <3wc.git@doesthisthing.work> Date: Wed, 2 Jun 2021 14:26:56 +0200 Subject: [PATCH] Update README, remove __pycache__, --- .gitignore | 2 +- README.md | 83 ++++++++++++++++-- .../__pycache__/0001_initial.cpython-37.pyc | Bin 1154 -> 0 bytes .../__pycache__/0001_initial.cpython-39.pyc | Bin 1159 -> 0 bytes .../0002_auto_20210315_1108.cpython-37.pyc | Bin 604 -> 0 bytes .../0002_auto_20210315_1108.cpython-39.pyc | Bin 603 -> 0 bytes .../0003_delete_todo.cpython-37.pyc | Bin 518 -> 0 bytes .../0003_delete_todo.cpython-39.pyc | Bin 521 -> 0 bytes .../__pycache__/__init__.cpython-37.pyc | Bin 193 -> 0 bytes .../__pycache__/__init__.cpython-39.pyc | Bin 186 -> 0 bytes 10 files changed, 76 insertions(+), 9 deletions(-) delete mode 100644 server/migrations/__pycache__/0001_initial.cpython-37.pyc delete mode 100644 server/migrations/__pycache__/0001_initial.cpython-39.pyc delete mode 100644 server/migrations/__pycache__/0002_auto_20210315_1108.cpython-37.pyc delete mode 100644 server/migrations/__pycache__/0002_auto_20210315_1108.cpython-39.pyc delete mode 100644 server/migrations/__pycache__/0003_delete_todo.cpython-37.pyc delete mode 100644 server/migrations/__pycache__/0003_delete_todo.cpython-39.pyc delete mode 100644 server/migrations/__pycache__/__init__.cpython-37.pyc delete mode 100644 server/migrations/__pycache__/__init__.cpython-39.pyc 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 1c58d03008ee683cc515c316ab215a6ac1a09c1a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1154 zcmYjQ&5j&35N^A>=YKX6vH^)xU;DuJ=759{ibAqlghV0)o6B4pPgl*1XWjP1c5ilb z1g^sqaDXGP2ws)`1y+;ev(NP{oM-3L2~qrmOG;j zB48@2*__pU&RHvS70;7zB8VaRHG%}$CjBLzr@()V^7K8~L^%(mTCS|{(r6cYwE81x9V(f1Qz-T6rLT{HWIrMS38EwYhErY=> zrn@2OO-N@1;~gh?(#Z^_2l<5LDLjDLj?wEw?Ei7{XSC$29@%^ZkKpw87#{E96`MbR zj|s&mVfgZx{#8h>44A+rTn7H_MV^F-XuK&ai^3y>@z%;(*t_x?@50cbl|spP7$!Gp z7sg?!MU5eCtdfw&Azdh;uS236r9!XK@=b$bEM2(})wPoP`rYRaeb$DkiN8uHb(eXQ zNev`;%={X&mo1^0beYJGX2f|Pa48z)!*GpiTY9|p;W62pw})i!V|>}hAg`A~IdW+- zkWMTVesGs{@Th#5SbDUFh)&!frA~m}|4U`d8P!?bmJ0RCufqUP071Y!4Y2?Sy=pD= z3PX>wMNgJD65ob?Wwf_OS=PFU!$2&Yx1#dl(E&iYMO#bfy6#B;^j<(o#RHd&JTQcF*j2@`UM8cy*E{`2Mw3`^U+1V-yN~P<^o$c7L2+P^qqDjeBuq z2+{sG{1w@P{B+wtx_C_u;|hX*Q(Ty;sZo1Ztfbeju`4XvHqfS)RpGp_Uh0K1xBowX zcDOgoWkIf}=ZgEESDc@pKPeB$&$f5A{n~w6?o-+ZJmE=_FwRfeDVxzeVUw6M&N{uk ucf@`Mi;k#0H?t3foGrUr*u2Hly1qxYKb_NE7<{!a$ z8c^A1Wpj6bH1Bv!%f6%ygPcK-b6|Nm5Aq1(Wd}Hf*j@I3(TpI5&Mum9=wg34SPok) zgWfJAU7zemWHW%_j*~oUWd`Ged_?jX9>8SB==LM*zB&3cnDKdsd_IO_IC&ky!(BLM z`2+ZbkbLUt&wo5mBR>)wr;E~{a0q_5HnI|CTdZ*F`xcE9O1?lp zxU`=;Mu164KDeQzhz^kLrz5zO$+2^9}l;w8d1ED<$jIi?1xYq)AZ`how+z zn>d}w8c1-MxCJIp8&VT#6Or7y5$|2Vnb;`j`wLX-!r_hc56NF&A0B&`+KQdn#MXsMg}9P*~61!uJ3L5ClwP9|{29 zDHo!iqwmmb(UIqs#B1Lzb?uB+hBYBV-xE{oj3}KyJ^(1zXew!K+d(nl+AY%19Fw{4 z%p@wXzN^=5gFQ@q8mx^H`F)vX+i2<3|(@YrwjcXbo>- z4xhB8Y)Lg?qv?M~^j|cYd>@vCK`U6B&syW3&VT;ZsQu;Wd#x3U`e6EGA>O88sX=T6Xv4vNMWP9N?a=x2E~iU0U{Y+Il?VQ4}%GPuK~Y&^%&;cf8LT&Hti* zqxY?S+PMXO3e%RQJu#CHY@E*8LYOZaFina(So>2(I^X+dUypAaT5V%CVZHEwoU~%2 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 b4cb4ab6346ffac213bc0f2d026543ebc8927bb6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 604 zcmYjOv5wR*5VezRHXHT|gx~|{QgF#GLb?K>10hk}A%SSNF}cia@G7wv+u7p^8ldGv z_$9Yg`~nr@Ga5hJ&u^Yzot)&1;@jD~k6$@szr*4f2{q@G_AwP;z&qCS4d?6) zg9zdu3}WQF=zF}0AbHP<*&jN`3hwh>wx)JcE87I<7#TI^l(wRRY{P-kRo?PVjLB{m zNFjk4q%eo9ok@h7oll$w?H>Sc>!EXE zkEWN_1|>eO0esqgs#S|V1?gnp4SgoqF)BTN!NkmF%!{20anj}2pBYIiHegQjjOP|8kIMayV>7KerbkS$e OCu3d&J{#s=#{U3FT&hd} 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 c9321a721ffead2a3dc3a23cac9922be6e276a42..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 603 zcmYjNv2N5r5Z$%czKeB1LI^&9&Pc@eAtVYEg^DVnpu1+-c;+rX>|L|Fmym)AS_*!F zj(_0`wx!}1C-dUu z_L@Ni@fQX$@@@1vUPU0@vOM`seJtl8>za*KzA@U>1GH}m6({8G2?b;;4vfC@4PV75 zw#h)eVIaQqhC}i-B0PnZ$Ym@mSyr;qjc-&Ngg0Qq1HiS~wO;mU zyT-X;k30#n0tjh+q4Wkr3fQ8@ATArc3bWd1Z%s?YLaPqL%=F{>XEb*%<$y^UGATO) zyLQMIQhwN}_V#4~*rNv2b%V}EbXvIos`Y434GnrTk%i3AMw2c-n0-iHWB8+s3)5k- zR@cgELkAVTHCwE`E3S-vUpTL%+f=14Y^9``_|nQk1Q+OL4+D^#3WB4wqC%@K1c^ydYql`EK5)G=vE1ZzeloYV4Q5a4(A?n?z)^e zO0>1dJ{a{o#puR|P8dfKo!7=m=(fbPkfk~j4|5Uo`kL+n?ckW}oGmVK?zb5)xEKBbX_bh; 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 8fe62bacb6b6ece1d4a4d4744abd18a12fa43dc3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 521 zcmYjNu};G<5Ve!Ev?ajEijWvG&?K#p7!c}!#MCY@Wif7jEe%N=>=ft>D+8awzwiZK znfL{ka&C*-lkVx=o$q|__}*TNpnZJ7-3cY++Xma_VbDX@#|VN5nvt9)l#**A9O1qZ z;Q~#aS2uBlcSC~O556M-HLZL)QM{VULXT`}+guEK==ul&NJ0g{b~>Sn3tn2YgWqjb zUyU@){{O7NF?9{<36wdEqNv08tdgt~b>gTSpRqWO&W(2~g~ScKg6A*@c1(jYOBpjQ z#&RiUndLrXk29XFE53jd3IWAv3R*e1m)X673@YeL0hwvZ64r7)iQ32d5`HJ)z04sT z^Ep?AjG{O!l}uq&>F`;qhfr5sRnuaa$(L<@y3Wh-I9%xoH}?urS(o9j_&cjmOuL*b zd$T&a_7NJcv+!yjMO-W^gTOUSk@8|9+hVxff0^HGx?%^|Y#JAg`kf+mZg1Q7igM8E(ekl_Ht#VkM~g&~+hlhJP_LlH9~KEG@~;%g@bB)-NteEGo&&OUlWwKxXSg#q-nB y^npf|r55SuW~LVg`kf{ABR6F~H15P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;x_~enx(7s(xBx zWnxiYzJY2gmZo2vT2z)=q@SCa oUX)mpnV(mzA0MBYmst`YuUAlci^C>2KczG$)edCwXCP((0PAxyod5s;