|
|
Install in your environment of choice:
|
|
|
Examples below are given for a standard virtualenv/pip on ubuntu.
|
|
|
|
|
|
* postgresql, setup a user and create a database (default name is escriptorium)
|
|
|
$ sudo apt install postgresql postgresql-contrib
|
|
|
$ sudo -i -u postgres # switch to postgres user
|
|
|
$ createuser --interactive
|
|
|
Enter name of role to add: <myusername> # use your system user name
|
|
|
Shall the new role be a superuser? (y/n) y
|
|
|
$ exit # logout from postgres user
|
|
|
$ createdb escriptorium
|
|
|
|
|
|
* redis
|
|
|
$ sudo apt-get install redis-server
|
|
|
|
|
|
* postgresql, setup a user and create a database (default name is escriptorium)
|
|
|
|
|
|
$ sudo apt install postgresql postgresql-contrib
|
|
|
$ sudo -i -u postgres # switch to postgres user
|
|
|
$ createuser --interactive
|
|
|
Enter name of role to add: <myusername> # use your system user name
|
|
|
Shall the new role be a superuser? (y/n) y
|
|
|
$ exit # logout from postgres user
|
|
|
$ createdb escriptorium
|
|
|
|
|
|
* redis
|
|
|
|
|
|
$ sudo apt-get install redis-server
|
|
|
|
|
|
<!--* elasticsearch
|
|
|
set max_map_count permanently
|
|
|
$ sudo sysctl -w vm.max_map_count=262144 -->
|
|
|
|
|
|
$ sudo sysctl -w vm.max_map_count=262144 -->
|
|
|
|
|
|
* third party tools
|
|
|
$ sudo apt-get install pngcrush
|
|
|
|
|
|
$ sudo apt-get install pngcrush
|
|
|
|
|
|
* env
|
|
|
$ apt-get install build-essential python-dev python3-dev
|
|
|
$ virtualenv env -p python3.7 (any version >= 3.7 should work)
|
|
|
$ . env/bin/activate
|
|
|
$ pip install -r app/requirements.txt
|
|
|
|
|
|
$ apt-get install build-essential python-dev python3-dev
|
|
|
$ virtualenv env -p python3.7 (any version >= 3.7 should work)
|
|
|
$ . env/bin/activate
|
|
|
$ pip install -r app/requirements.txt
|
|
|
|
|
|
* The default settings needs to be override for devs
|
|
|
$ cp app/escriptorium/local_settings.py{.example,}
|
|
|
$ edit app/escriptorium/local_settings.py
|
|
|
|
|
|
$ cp app/escriptorium/local_settings.py{.example,}
|
|
|
$ edit app/escriptorium/local_settings.py
|
|
|
|
|
|
change for example the database role if need be.
|
|
|
|
... | ... | @@ -39,8 +45,8 @@ It is then recommended to set $DJANGO_SETTINGS_MODULE |
|
|
And use something like (direnv)[https://direnv.net/] or use a custom shell script that sets it to automate it.
|
|
|
```shell
|
|
|
#!/bin/bash
|
|
|
export DJANGO_SETTINGS_MODULE=escriptorium.local_settings
|
|
|
python manage.py $@
|
|
|
$ export DJANGO_SETTINGS_MODULE=escriptorium.local_settings
|
|
|
$ python manage.py $@
|
|
|
```
|
|
|
Then everytime you would be using `python manage.py [args]`, you can use `./manage.sh [args]` instead.
|
|
|
|
... | ... | @@ -52,10 +58,10 @@ Another option is to point the --settings option of the commands to the module. |
|
|
To disable celery completely, and process everything synchronously, you can set `CELERY_TASK_ALWAYS_EAGER = True`
|
|
|
|
|
|
* Create the sql tables
|
|
|
$ cd app/
|
|
|
$ python manage.py migrate (--settings=escriptorium.local_settings)
|
|
|
$ cd app/
|
|
|
$ python manage.py migrate (--settings=escriptorium.local_settings)
|
|
|
|
|
|
* Run the server
|
|
|
$ python manage.py runserver (--settings=escriptorium.local_settings)
|
|
|
$ python manage.py runserver (--settings=escriptorium.local_settings)
|
|
|
|
|
|
The website should be accessible at http://localhost:8000/ |