Skip to content

Commit 665b401

Browse files
committed
added django steps and samples
1 parent 22486fe commit 665b401

369 files changed

Lines changed: 6314 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/index.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,4 +1237,21 @@ peggy = Penguin()
12371237
# passing the object
12381238
flying_test(blu)
12391239
flying_test(peggy)
1240+
```
1241+
1242+
# Python Django Commands
1243+
1244+
```
1245+
django-admin startproject skyproj
1246+
python manage.py runserver 0.0.0.0:8000
1247+
python manage.py startapp myapp
1248+
#add model in myapp
1249+
#add app in project setting
1250+
python mange.py showmigrations
1251+
python mange.py makemigrations
1252+
python manage.py migrate
1253+
#add management commad in app/management/commands
1254+
python mange.py my_manage_command
1255+
python manage.py createsuperuser
1256+
python manage.py shell
12401257
```

samples/Ch01/.DS_Store

6 KB
Binary file not shown.

samples/Ch01/._.DS_Store

4 KB
Binary file not shown.

samples/Ch01/01_04/.DS_Store

6 KB
Binary file not shown.

samples/Ch01/01_04/._.DS_Store

4 KB
Binary file not shown.
6 KB
Binary file not shown.
4 KB
Binary file not shown.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python
2+
import os
3+
import sys
4+
5+
if __name__ == "__main__":
6+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wisdompets.settings")
7+
try:
8+
from django.core.management import execute_from_command_line
9+
except ImportError:
10+
# The above import may fail for some other reason. Ensure that the
11+
# issue is really that Django is missing to avoid masking other
12+
# exceptions on Python 2.
13+
try:
14+
import django
15+
except ImportError:
16+
raise ImportError(
17+
"Couldn't import Django. Are you sure it's installed and "
18+
"available on your PYTHONPATH environment variable? Did you "
19+
"forget to activate a virtual environment?"
20+
)
21+
raise
22+
execute_from_command_line(sys.argv)
6 KB
Binary file not shown.
4 KB
Binary file not shown.

0 commit comments

Comments
 (0)