forked from neerajgupta2407/saleor_course_resources
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_saleor_core.txt
82 lines (52 loc) · 1.66 KB
/
setup_saleor_core.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Installing python and other essentials
https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-programming-environment-on-an-ubuntu-18-04-server
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install python3.7 libpython3.7-dev python3-all-dev
sudo apt install virtualenv
sudo apt install postgresql
sudo apt install uwsgi
sudo apt-get install build-essential python3-dev
# Required for 2.11 and above.
sudo apt-get install libpangocairo-1.0-0
### 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.7 venv
source venv/bin/activate
cd saleor
git fetch origin 2.10:2.10 && git checkout 2.10
pip install -r requirements.txt
### settiing up postgres user.
sudo su - postgres
psql
CREATE ROLE saleor WITH LOGIN PASSWORD 'saleor';
CREATE DATABASE saleor;
ALTER USER saleor WITH SUPERUSER;
GRANT ALL PRIVILEGES ON DATABASE saleor TO saleor;
ALTER USER saleor CREATEDB;
## Export these variables to os.
export ALLOWED_HOSTS=13.127.7.177
export ALLOWED_CLIENT_HOSTS=13.127.7.177
export DEBUG=True
export SECRET_KEY='your_secret_key'
export INTERNAL_IPS=127.0.0.1,13.127.7.177,
export DEFAULT_COUNTRY=IN
export DEFAULT_CURRENCY=INR
### 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