1.7 KiB
1.7 KiB
Almost secret deployment battle plan
- Install dependencies:
aptitude install python3 virtualenv python3-virtualenv libjpeg-dev zlib1g-dev libtiff-dev libtiff-dev libwebp-dev libopenjpeg-dev python3-dev
- Create linux user for running the romstore
adduser --disabled-login romstore
- Create database + database user
- postgres
su postgres createuser -D -P -S romstore createdb -O romstore romstore
git clone https://github.com/LongHairedHacker/gulasch-r0mstore/
virtualenv -p python3 virtenv; source virtenv/bin/activate
pip install -r requirements.txt
- Generate new secret key and set it in gulashromstore/settings.py:
pwgen -sy 64 5
- Setup database in gulashromstore/settings.py
- Mysql:
pip install mysqlclient
- Follow: https://docs.djangoproject.com/en/1.11/ref/databases/#connecting-to-the-database
- Postgres:
pip install psycopg2
- Refer to example configuration https://docs.djangoproject.com/en/1.11/ref/settings/#databases
- Setup mail configuration https://docs.djangoproject.com/en/1.11/ref/settings/#email
manage.py migrate
manage.py createsuperuser
manage.py collectstatic
- Set up a uswgi configuration (use systemd/uwsgi.ini)
- update paths
- update user/group ids
- Setup systemd service and socket files
- Setup nginx, see https://uwsgi.readthedocs.io/en/latest/tutorials/Django_and_nginx.html#configure-nginx-for-your-site
- set paths for media, static and the socket
- make sure static points to static_root not static
- Testrun without ssl
- Setup ssl
- Change DEBUG to False in gulashromstore/settings.py