분류 전체보기(702)
-
서버 실행
python manage.py runserver python manage.py runserver 8080 python manage.py runserver IP:8080
2021.01.14 -
프로젝트 생성
django-admin startproject 프로젝트명
2021.01.14 -
django 버전 확인
case 1 >>> import django >>> print(django.get_version()) case 2 python -m django --version
2021.01.14 -
Djaong Admin에 모델 등록
case 1 class ProgramingAdmin(admin.ModelAdmin) : ... admin.site.register(Programing) case 2 class ProgramingAdmin(admin.ModelAdmin) : ... admin.site.register(Programing, ProgramingAdmin) case3 @admin.register(Programing) class ProgramingAdmin(admin.ModelAdmin) : ...
2021.01.14 -
Model 호출시 출력되는 내용 셋팅
def __str__(self) 함수 추가 class Programing(models.Model) : language = models.TextField(choices=language) framework = models.TextField(default='None',choices=framework) tip = models.TextField() desc = models.TextField() def __str__(self) : return self.name
2021.01.14 -
데이터에 html 구문 적용
from django.utils.html import format_html print(format_html('abc abc')) print(format_html('{}'),'test')
2021.01.14