sudo apt install python3.9python -m pip install Djangopip install pyTelegramBotAPIpip install vardump
- Install:
git clone git@github.com:raccoon464/vietnam.git - Change config:
/var/www/vietnam/t_bot/config/main.py - Start test:
/var/www/vietnam python3 manage.py bot - Try to send "/start" in your bot
- Сonfigure nginx.conf (направляем домен на порт 8000)
server {
server_name your-domain.com;
location /
{
proxy_pass http://localhost:8000;
proxy_buffering off;
proxy_pass_request_headers on;
proxy_set_header Connection "Keep-Alive";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
if ($host = your-domain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name your-domain.com;
return 404; # managed by Certbot
}
- Change in /var/www/vietnam/t_bot/config/main.py url ~~ vietnam.cryptayls.com ~~ => your-domain.com
- Change in /var/www/vietnam/vietnam/setings.py ALLOWED_HOSTS, CSRF_TRUSTED_ORIGINS
- Comand:
python3 manage.py runserver 0.0.0.0:8000 - Сheck your url your-domain.com/admin
- Log in (user = admin/ pass = admin)
- If it was success, next comand:
/var/www/vietnam python3 manage.py wh - Finish