deploy using vps
deploy using vps
During setup:
IP address
Password
# Set up virtualenv
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install --upgrade pip
pip install -r requirements.txt
Make sure gunicorn is in your requirements.txt.
[Service]
User=root
Group=www-data
WorkingDirectory=/opt/proximity-based-market
ExecStart=/opt/proximity-based-market/venv/bin/gunicorn --workers 3 --bind
127.0.0.1:8000 proximity.wsgi:application
[Install]
WantedBy=multi-user.target
systemctl daemon-reexec
systemctl start gunicorn
systemctl enable gunicornSTEP 10: Secure with SSL (Optional but Recommended)
Paste:
server {
listen 80;
server_name your_domain.com;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Get HTTPS:
certbot --nginx -d your_domain.com