zoukankan      html  css  js  c++  java
  • 跟老齐学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 module 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
    

      

  • 相关阅读:
    [题解] LuoguP6185 [NOI Online 提高组]冒泡排序
    [题解] LuoguP5339 [TJOI2019]唱、跳、rap和篮球
    [题解] LuoguP4168 [Violet]蒲公英
    [题解] LuoguP4705玩游戏
    [题解 LuoguP4491 [HAOI2018]染色
    [题解] LuoguP3768 简单的数学题
    杜教筛
    莫比乌斯反演学习笔记
    [题解] LuoguP2257 YY的GCD
    [题解] LuoguP2764 最小路径覆盖问题
  • 原文地址:https://www.cnblogs.com/winditsway/p/12765670.html
Copyright © 2011-2022 走看看