You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
7 years ago | |
|---|---|---|
| client | 7 years ago | |
| deployment | 7 years ago | |
| eshop | 7 years ago | |
| media | 7 years ago | |
| templates | 7 years ago | |
| .gitignore | 7 years ago | |
| README.md | 7 years ago | |
| requirements.txt | 8 years ago | |
README.md
Online software storefront
Python version: 3.5.2
Django 2.0
Server configuration
- Install necessary packages:
sudo apt-get install -y libpq-dev postgresql nginx virtualenv
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
- Create database:
CREATE DATABASE eshop_db;
CREATE USER eshop_admin WITH password '12345678';
GRANT ALL ON DATABASE eshop_db TO eshop_admin;
# Allow user to create db for running django tests
ALTER USER eshop_admin CREATEDB;
- Install virtualenv inside the project directory and activate it:
virtualenv --python3=$(which python3) venv
source venv/bin/activate
- Use systemd file with name gunicorn-eshop.service to initialize gunicorn server with DJANGO_SETTINGS_MODULE environment var
- Use systemd file with name celery-eshop.service to initialize celery following with these instructions
- Install dependencies from inside the activated virtualenv:
pip install -r requirements.txt
- Install all packages from package.json in the client/ directory and run webpack
npm i
npm run dev
- Create empty logs dir in project directory
###Development
- Activate eshop environment using virtualenv
- Make .env file with the structure described in .env.sample file
- Make migrations for modules: auth, accounts_ext, etc.
- Start celery queue for tasks with the command:
celery -A eshop_project worker -l info --pool=eventlet
###Deployment
- Activate eshop environment using virtualenv
- Make pull request from bitbucket repo by ssh using passphrase
- Make .env file with the structure described in .env.sample file
- Make migrations for modules
- Collect static
- Restart gunicorn-eshop and celery-eshop daemons in systemd
- Load fixture core fixture sites to configure site domain (before the FIRST http request)