-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstall Django (mac)
More file actions
58 lines (45 loc) · 1.11 KB
/
Install Django (mac)
File metadata and controls
58 lines (45 loc) · 1.11 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#Install App using Django
#Just follow this!
#https://scotch.io/tutorials/build-your-first-python-and-django-application
brew install python3
pip install argparse * optional
pip install virtualenv
mkdir tolsby**
ls
cd to **
mkdir helllo
virtualenv -p /usr/local/bin/python3 env
source env/bin/activate
source activate
source deactivate
pip install django
django-admin startproject helloapp
python manage.py runserver
cd helloapp
python manage.py startapp howdy
python manage.py runserver
#Go here (http://127.0.0.1:8000/)
#Should be running!
##---To rerun the server--##
cd <project_folder>
virtualenv -p /usr/local/bin/python3 env
source env/bin/activate *your terminal should have (env) prefix
cd helloapp/
python manage.py runserver
#Go to
http://127.0.0.1:8000/
#Changing admin username / password
#In linux:
#Install pip first
sudo apt-get install python3-pip
#Then install virtualenv using pip3
sudo pip3 install virtualenv
#Now create a virtual environment
virtualenv venv
cd <project>
source venv/bin/activate
cd helloapp
python3 manage.py runserver
python3 manage.py migrate
python3 manage.py createsuperuser
#END#