A
A
Alexander Bondarenko2020-07-11 18:28:34
Python
Alexander Bondarenko, 2020-07-11 18:28:34

How to properly install python3 on debian?

Hello everyone, I'm trying to install a Django site on a VPS using this template
, I 'm installing python3 nginx systemd gunicorn git

sudo apt-get install python3 nginx systemd  gunicorn git

then clone this template
git clone https://github.com/alexey-goloburdin/django-clean-template.git

I go to the cloned directory,
cd django-clean-template
I find out where python3 is located, I
which python3
run the installer , I
write the received path, then
I get errors with my ip
./install.sh: line 8: The: command not found
./install.sh: line 9: env/bin/activate: No such file or directory
./install.sh: line 10: pip: command not found
./install.sh: line 11: pip: command not found
Created symlink /etc/systemd/system/multi-user.target.wants/gunicorn.service → /root/rdjango-clean-template/systemd/gunicorn.service.

Why is pip not found? He seems to be put together with python. For a virtual environment, I did not install virtualenv (I fixed this, but the error with pip remained)
Here is the ./install.sh file itself
#!/bin/bash
base_python_interpreter=""
project_domain=""
project_path=`pwd`

read -p "Python interpreter: " base_python_interpreter
read -p "Your domain without protocol (for example, google.com): " project_domain
`$base_python_interpreter -m venv env`
source env/bin/activate
pip install -U pip
pip install -r requirements.txt

sed -i "s~dbms_template_path~$project_path~g" nginx/site.conf systemd/gunicorn.service
sed -i "s~dbms_template_domain~$project_domain~g" nginx/site.conf src/config/settings.py

sudo ln -s $project_path/nginx/site.conf /etc/nginx/sites-enabled/
sudo ln -s $project_path/systemd/gunicorn.service /etc/systemd/system/

sudo systemctl daemon-reload
sudo systemctl start gunicorn
sudo systemctl enable gunicorn
sudo service nginx restart

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-07-11
@bond_1013

then clone this template
Well, go to the author and ask him. And it’s better to figure out how to install Django on the server from scratch than to use left-handed scripts.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question