Step#4. Django 디렉터리 생성하기 (django-admin startproject 디렉터리명)

정은경·2019년 12월 23일
0

🎸 Play the Django 

목록 보기
9/57

가상환경에서 django 디렉터리 생성해볼게요!

1) django 프로그램의 명령어 살펴보기

(test_project) marie@MarieJungui-MacBookPro:~ » django-admin

Type 'django-admin help <subcommand>' for help on a specific subcommand.

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
Note that only Django core commands are listed as settings are not properly configured (error: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.).
(test_project) marie@MarieJungui-MacBookPro:~ »

2) 현재 위치에 django 디렉터리 생성하기 ("django-admin startproject 생성할디렉터리명 .")

django-admin startproject 생성할디렉터리명 .

django-admin startproject mynewdjango .
(test_project) marie@MarieJungui-MacBookPro:~ » mkdir mynewdjango
(test_project) marie@MarieJungui-MacBookPro:~ » pwd
/Users/marie
(test_project) marie@MarieJungui-MacBookPro:~ » cd mynewdjango
(test_project) marie@MarieJungui-MacBookPro:~/mynewdjango » pwd
/Users/marie/mynewdjango
(test_project) marie@MarieJungui-MacBookPro:~/mynewdjango »
(test_project) marie@MarieJungui-MacBookPro:~/mynewdjango » django-admin startproject mynewjangodirec .
(test_project) marie@MarieJungui-MacBookPro:~/mynewdjango » ls
manage.py       mynewjangodirec
(test_project) marie@MarieJungui-MacBookPro:~/mynewdjango »
(test_project) marie@MarieJungui-MacBookPro:~/mynewdjango » tree
.
├── manage.py
└── mynewjangodirec
    ├── __init__.py
    ├── asgi.py
    ├── settings.py
    ├── urls.py
    └── wsgi.py

1 directory, 6 files
(test_project) marie@MarieJungui-MacBookPro:~/mynewdjango »

[참고] "django-admin startproject 생성할디렉터리명" vs. "django-admin startproject 생성할디렉터리명 ."

(test_project) marie@MarieJungui-MacBookPro:~ » pwd
/Users/marie
(test_project) marie@MarieJungui-MacBookPro:~ » mkdir testdirec01
(test_project) marie@MarieJungui-MacBookPro:~ » cd testdirec01
(test_project) marie@MarieJungui-MacBookPro:~/testdirec01 » pwd
/Users/marie/testdirec01
(test_project) marie@MarieJungui-MacBookPro:~/testdirec01 »
(test_project) marie@MarieJungui-MacBookPro:~/testdirec01 » django-admin startproject test01
(test_project) marie@MarieJungui-MacBookPro:~/testdirec01 » tree
.
└── test01
    ├── manage.py
    └── test01
        ├── __init__.py
        ├── asgi.py
        ├── settings.py
        ├── urls.py
        └── wsgi.py

2 directories, 6 files
(test_project) marie@MarieJungui-MacBookPro:~/testdirec01 »
(test_project) marie@MarieJungui-MacBookPro:~/testdirec01 » cd ~
(test_project) marie@MarieJungui-MacBookPro:~ »
(test_project) marie@MarieJungui-MacBookPro:~ » mkdir testdirec02
(test_project) marie@MarieJungui-MacBookPro:~ » pwd
/Users/marie
(test_project) marie@MarieJungui-MacBookPro:~ » cd testdirec02
(test_project) marie@MarieJungui-MacBookPro:~/testdirec02 » pwd
/Users/marie/testdirec02
(test_project) marie@MarieJungui-MacBookPro:~/testdirec02 » django-admin startproject test02 .
(test_project) marie@MarieJungui-MacBookPro:~/testdirec02 » tree
.
├── manage.py
└── test02
    ├── __init__.py
    ├── asgi.py
    ├── settings.py
    ├── urls.py
    └── wsgi.py

1 directory, 6 files
(test_project) marie@MarieJungui-MacBookPro:~/testdirec02 »
profile
#의식의흐름 #순간순간 #생각의스냅샷

0개의 댓글