Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Installing python and other essentials
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install python3.9 libpython3.9-dev python3-all-dev
apt install python3-virtualenv
sudo apt install virtualenv
sudo apt install postgresql
sudo apt install uwsgi
sudo apt-get install build-essential python3-dev
### Setup Node
### insatalling node.
sudo apt install npm
## installing NVM
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile
source ~/.bashrc
nvm install v12
### Setup Code
mkdir -p codes/backend
cd codes/backend
virtualenv -p python3.9 venv
source venv/bin/activate
git clone https://github.com/saleor/saleor.git --branch 3.8.7
cd saleor
git fetch origin 3.8:3.8 && git checkout 3.8
pip install -r requirements.txt
pip install --upgrade -r requirements.txt
### settiing up postgres user.
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt install postgresql postgresql-contrib
systemctl is-active postgresql
systemctl is-enabled postgresql
systemctl status postgresql
pg_isready
su - postgres
psql
CREATE USER pgadmin WITH PASSWORD 'Securep@wd';
CREATE DATABASE pgdb;
GRANT ALL PRIVILEGES ON DATABASE pgdb to pgadmin;
\q
exit
nano /etc/postgresql/15/main/pg_hba.conf
# Update md5
# save and exit
systemctl status postgresql.service
systemctl restart postgresql.service
## Export these variables to os.
export ALLOWED_HOSTS=159.223.128.233
export ALLOWED_CLIENT_HOSTS=159.223.128.233
export DEBUG=True
export SECRET_KEY='your_secret_key'
export INTERNAL_IPS=127.0.0.1,159.223.128.233,
export DEFAULT_COUNTRY=BR
export DEFAULT_CURRENCY=BRL
sudo apt install python3.9 python3.9-venv
pip install upgrade-requirements
pip-upgrade
pip install --upgrade setuptools
pip install django
pip install celery
pip install dj-database-url
pip install dj_email_url
pip install django_cache_url
pip install jaeger_client
pip install sentry_sdk
pip install psycopg2
pip3 install --upgrade cython
pip install Cython
pip install graphql
pip install pip-review
pip install --upgrade -r requirements.txt
pip install pip-upgrader
pip install -r requirements.txt
pip install -r requirements_dev.txt
### Applying migrations
python manage.py migrate
## create dummy data
python manage.py populatedb
## Create superuser
python manage.py createsuperuser
## runserver
python manage.py runserver 0.0.0.0:8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment