1π
To install Django on CentOS system, you have to process like that :
Step 1 : Update your system
sudo yum install epel-release
sudo yum update -y && sudo reboot
Step 2 : Install pip and dependencies
sudo yum install python-devel python-setuptools python-pip
sudo pip install --upgrade pip
Step 3 : Install virtualenv and Django inside
sudo pip install virtualenv
source ~/djangoenv/bin/activate
You will obtain something like :
(djangoenv) [user@hostname ~]$
Step 4 : Install Django
pip install django
#or particular version X.X
pip install django==X.X
Step 5 : Create your project
cd ~
django-admin startproject myproject
Step 6 : Runserver
cd myproject/
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
0π
The error is that your username sv
is not in the sudo user list. You should ask you sysadmin to add that user to sudo user list. or you can try this
usermod
command like usermod -aG groupname username
. Refer this (https://www.digitalocean.com/community/tutorials/how-to-create-a-sudo-user-on-centos-quickstart)
You should try a different strategy to install. Two useful links are as follows:
- Issue using Django to pass JSON to Javascript
- Can PostgreSQL query external Microsoft Dynamics REST API directly?
- Django β display informations from different models into the same HTML template
- 'TypeError: 'DotMap' object is not callable' error at django model class
- Generate a unique key after refresh Django Admin form
0π
Use yum package manager to download and install Django (although it recommended to work in env):
sudo yum install python-django
Test the installation:
django-admin --version