Lee Dat
Lee Dat

Reputation: 165

How to Install Django with command sudo

I want to install django into my CentOS virtual machine. When I search on the Internet for the solutions, I found tutorial page like this image of downloading command

But I when I type the command sudo, and then type Linux virtual machine password, it does not work.

Image of sudo error:

How can I solve this?

Upvotes: 0

Views: 437

Answers (3)

Essex
Essex

Reputation: 6128

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 

Upvotes: 1

Artur Barseghyan
Artur Barseghyan

Reputation: 14172

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

Upvotes: 0

Harshit Garg
Harshit Garg

Reputation: 2259

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:

  1. https://www.digitalocean.com/community/tutorials/how-to-install-the-django-web-framework-on-centos-7

  2. https://www.vultr.com/docs/how-to-install-django-on-centos-7

Upvotes: 0

Related Questions