跟老齐学Python Django实战 2/n Second edition

#1

I deleted the whole virtual folder, creating a new one, and reinstall the Django package , but I still can't find "django-admin";

Installing collected packages: pytz, sqlparse, Django
Successfully installed Django-2.2.12 pytz-2019.3 sqlparse-0.3.1
(laqidjango) cor@debian:~/laqidjango$ clear

(laqidjango) cor@debian:~/laqidjango$ ls
bin  include  lib  local  share
(laqidjango) cor@debian:~/laqidjango$ find |grep django-admin
(laqidjango) cor@debian:~/laqidjango$

 #1.1, venv modle is embedied since python3.3, the right way to start is:

python3.5(or above)  -m venv lqdjango

cd lqdjango

source bin/active

pip3 install Django

  #1.2 then , we can grep it inside the venv.

(lqdj1) cor@debian:~/lqdj1$ find |grep django-admin
./lib/python3.5/site-packages/django/bin/__pycache__/django-admin.cpython-35.pyc
./lib/python3.5/site-packages/django/bin/django-admin.py
./bin/__pycache__/django-admin.cpython-35.pyc
./bin/django-admin.py
./bin/django-admin

  

 

#2,

(laqidjango) cor@debian:~/laqidjango$ ls
bin  include  lib  local  share
(laqidjango) cor@debian:~/laqidjango$ pwd
/home/cor/laqidjango

  

python3 -m django startproject  mysite

  

(laqidjango) cor@debian:~/laqidjango$ cd mysite/
(laqidjango) cor@debian:~/laqidjango/mysite$ ls
manage.py  mysite
(laqidjango) cor@debian:~/laqidjango/mysite$ tree
.
├── manage.py
└── mysite
    ├── __init__.py
    ├── settings.py
    ├── urls.py
    └── wsgi.py

1 directory, 5 files

  #4

python3 manage.py startapp blog

  

上一篇:Multiple View Geometry in Computer Vision (Second Edition) 学习笔记-1


下一篇:JAVA基础_JAVA发展史