-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.txt
102 lines (62 loc) · 1.47 KB
/
setup.txt
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
setup
pip install django
django-admin
Available subcommands:
[django]
check
compilemessages
createcachetable
dbshell
diffsettings
dumpdata
flush
inspectdb
loaddata
makemessages
makemigrations
migrate
runserver
sendtestemail
shell
showmigrations
sqlflush
sqlmigrate
sqlsequencereset
squashmigrations
startapp
startproject
test
testserver
########
django-admin startproject XXX
python manage.py runserver
port8000 http://127.0.0.1:8000/
http://127.0.0.1:8000/admin
##########
python manage.py startapp accounts
############
for templates, we could create a main_template so that we don't have to repeat html scripts for different web page.
#########
migrate for database setup command:
python manage.py migrate
then, use the django admin panel to view the database that setup.
you need to create a user to view this.
python manage.py createsuperuser
username: xiaow
email:[email protected]
passward:
login into the admin panel:
python manage.py rumserver
go to the port 8000 with /admin to login with previous username&password
before add the customer to the database, we need to turn off the server, and run:
python manage.py makemigrations
this is prep for migration
#
###############
#
Use this command to start working with the database:
python manage.py shell
type in the shell:
from accounts.models import *
######
pip install django-filter