This is the basic setup for a new django project.
Before anything else :
sudo apt-get install libmysqlclient-dev python-dev python-mysqldb
Install the cache handler :
sudo apt-get install memcached
Setup the virtualenv :
virtualenv .venv source .venv/bin/activate pip install -r requirements.txt
If you don't have virtualenv or pip :
sudo apt-get install python-setuptools sudo easy_install pip sudo pip install virtualenv
If you want to use celery :
sudo apt-get install redis-server
Before anything else :
sudo apt-get install nodejs npm sudo npm install -g yarn
Installing front dependencies :
cd front && yarn install && cd ..
source .venv/bin/activate python manage.py runserver
source .venv/bin/activate celery --app=main.celery:app worker --loglevel=INFO -B
source .venv/bin/activate python manage.py runfront
In the following commands, replace {{name}} by the name you want for your site.
You can also run python manage.py configuredeployment which will configure all the files for you and change these commands accordingly.
openssl req -new -newkey rsa:2048 -nodes -keyout nginx/ssl/{{name}}.key -out nginx/ssl/{{name}}.csr openssl x509 -req -days 365 -in nginx/ssl/{{name}}.csr -signkey nginx/ssl/{{name}}.key -out nginx/ssl/{{name}}.crt
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -" sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" sudo aptitude update sudo aptitude install lxc-docker sudo gpasswd -a ${USER} docker sudo service docker restart newgrp docker
docker-compose up -d # Alternatively, you can use the DEBUG environment variable to launch in prod or in dev DEBUG=True docker-compose up -d
docker-compose ps
docker-compose exec api bash
docker-compose logs -f
docker-compose down
docker-compose stop
docker-compose start