-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdjango_install
More file actions
33 lines (25 loc) · 820 Bytes
/
django_install
File metadata and controls
33 lines (25 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /bin/bash
sudo su
yum -y install python-pip
pip install virtualenv
pip install --upgrade pip
##mkdir and cd into
mkdir /opt/django
cd /opt/django/
##running python 2 but want 3.6
yum install python36
virtualenv -p python36 django
##still in 2.7.5 && need to source to 3.6
python --version
source django/bin/activate
pip install django
django-admin --version
##start project
django-admin startproject project1
##change ownership from root to a user
chown -R <user> django ##if you don't know this--: who
chown -R <user> project1
su - <user>
##activate django install and run server
source /opt/django/django/bin/activate
/opt/django/project1/manage.py runserver 0.0.0.0:8000&