가상 환경에서 Django 웹 사이트 서비스 시작

3221 단어 django
# 디렉토리 구조 폴더 PATH 목록
      0000-0000
D:\WWW
├─DjangoProject
│  │
│  ├─Lib
│  │  └─site-packages
│  │      
│  └─Scripts
│      └─__pycache__
└─MyWEB
        └─MyWEB
        └─__pycache__

#여기서 Django Project는 Django 가상 환경입니다.
# 이하는 주요 컨텐트=======================================================================================================================================
# 가상 환경을 활성화하려면 다음과 같이 하십시오.
D:\WWW>djangoproject\scripts\activate
# 현재 가상 환경 디렉토리 보기
(DjangoProject) D:\WWW>dir
     D        。
        0000-0000

 D:\WWW    

0000/00/00  13:34              .
0000/00/00  13:34              ..
0000/00/00  18:18              DjangoProject
0000/00/00  13:34           108,759 ptree.txt
               1            108,759   
               3      3,784,130,560     

# MyWEB 프로젝트를 만들려면 다음과 같이 하십시오.
(DjangoProject) D:\WWW>django-admin.exe startproject MyWEB

#디렉토리를 보려면 다음과 같이 하십시오.
(DjangoProject) D:\WWW>dir
     D        。
        0000-0000

 D:\WWW    

0000/00/00  14:15              .
0000/00/00  14:15              ..
0000/00/00  18:18              DjangoProject
0000/00/00  14:15              MyWEB #      MyWEB      
0000/00/00  13:34           108,759 ptree.txt
               1            108,759   
               4      3,784,122,368     

(DjangoProject) D:\WWW>cd myweb

(DjangoProject) D:\WWW\MyWEB>dir
     D        。
        0000-0000

 D:\WWW\MyWEB    

0000/00/00  14:15              .
0000/00/00  14:15              ..
0000/00/00  14:15               646 manage.py
0000/00/00  14:15              MyWEB
               1                646   
               3      3,784,122,368     

#실행 관리자py runserver(서비스 실행):
(DjangoProject) D:\WWW\MyWEB>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).

You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin,
 auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
00 00, 0000 - 14:17:56
Django version 3.0.6, using settings 'MyWEB.settings'
Starting development server at http://127.0.0.1:8000/ #         #
Quit the server with CTRL-BREAK.  #   Ctrl+C    #
[00/00/0000 14:18:29] "GET / HTTP/1.1" 200 16351
[00/00/0000 14:18:29] "GET /static/admin/css/fonts.css HTTP/1.1" 200 423
[00/00/0000 14:18:29] "GET /static/admin/fonts/Roboto-Light-webfont.woff HTTP/1.1" 200 85692
[00/00/0000 14:18:29] "GET /static/admin/fonts/Roboto-Regular-webfont.woff HTTP/1.1" 200 85876
[00/00/0000 14:18:29] "GET /static/admin/fonts/Roboto-Bold-webfont.woff HTTP/1.1" 200 86184
Not Found: /favicon.ico
[00/00/0000 14:18:29] "GET /favicon.ico HTTP/1.1" 404 1971
[00/00/0000 14:19:00] "GET / HTTP/1.1" 200 16351

OK, 이제 브라우저의 주소 표시줄에 입력할 수 있습니다http://127.0.0.1:8000/당신의 사이트를 방문하세요. (물론 기본값 하나만 있습니다. 다음은 당신이 벽돌을 늘리고 기와를 늘리는 것입니다.)

좋은 웹페이지 즐겨찾기