django(66)
-
Django admin change_list.html 구조
change_list.html base_site.html base.html nav_sidebar.html search_form.html pagination.html
2021.03.27 -
Invalid HTTP_HOST header: '192.168.0.3'. You may need to add '192.168.0.10' to ALLOWED_HOSTS.
setting.py에 아래와 같이 서비스하려는 IP 등록해야 함 ALLOWED_HOSTS = ['localhost','127.0.0.1','192.168.0.10'] 서비스하려는 IP로 시작 python manage.py runserver 192.168.0.10:80
2021.03.27 -
Django union
unionedImages = Trained_Image.objects.all().values_list('prefix').union(Image.objects.all().values_list('prefix')) for unionedImage in unionedImages : print(unionedImage) 결과 ('./aaa/aa/96',) ('./bbb/bb/97',)
2021.03.27 -
Django filter 정규식
boxes = Trained_Box.objects.filter(char__iregex=r'[0-9]').exclude(status='excepted')
2021.03.27 -
Django filter Max 구하기
from django.db.models import Max name = Tested_Data.objects.filter(name__contains=lang).aggregate(name=Max('name')) print(name) print(name['name']) 결과 {'name': './aaa/aa/222'} ./aaa/aa/222
2021.03.27 -
Django get_or_create
조회한 결과가 없으면 신규로 row 생성 isCreated : 신규로 생성되면 True, 이미 존재한 데이터면 False testedData,isCreated = Tested_Data.objects.get_or_create(name=fileName,dir=dir)
2021.03.11