티스토리 뷰

Dev/python

[python]Django 설치 및 기본 세팅 (Django Install and Setting)

가지가지하는 부부 - do variety 2021. 3. 4. 17:40

 

[Install]

docs.djangoproject.com/ko/3.1/intro/tutorial01/

 

 

-Run Server

python3 manage.py runserver 0:8000

 

[Port setting and execute]

python3 manage.py runserver 0:8000 (외부에서 접속하도록 수정)

 

-modify for all port accepted

settings.py

#ALLOWED_HOSTS = []

ALLOWED_HOSTS = ['*']

 

 

[Admin page setting]

1. Create DB 

python manage.py makemigrations

python manage.py migrate

 

2. Create Super User

python manage.py createsuperuser

 

[Kill Port]

sudo lsof -t -i tcp:8000 | xargs kill -9

 

 

 

 

 

 

댓글
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함