- XSS PHP
- asp.net dropdownlist
- swagger 500 error
- Mac Oracle
- 하드 윈도우 복사
- asp.net core swagger
- asp.net core Select
- SSD 복사
- 바코드 생성하기
- TempData
- asp.net Select
- 타임피커
- ViewData
- 404에러페이지
- asp ftp
- 강제이동
- ASP.Net Core 404
- simpe ftp
- ViewBag
- 하드 마이그레이션
- php 캐쉬제거
- javascript redirection
- 말줄임표시
- 바코드 스캔하기
- XSS방어
- 원격ftp
- django 엑셀불러오기
- 맥 오라클설치
- jquery 바코드생성
- javascript 바코드 생성
목록python (89)
웹개발자의 기지개
Django 에서 Model 간의 관계에 관해 몇가지 정리해 본다. User 와 Album 모델은 Album.owner FoeignKey 로 연결되어 있다. 1 2 3 4 5 6 from django.contrib.auth.models import User class Album(models.Model): name = models.CharField('NAME', max_length=30) description = models.CharField('One Line Description', max_length=100, blank=True) owner = models.ForeignKey('auth.User', on_delete=models.CASCADE, verbose_name='OWNER', blank=True..
1. 템플릿 필터 {% url %} 에서 url 다음에 오는 변수 인자들이 여러개일때 어떻게 ? https://docs.djangoproject.com/ko/4.0/intro/tutorial03/ 첫 번째 장고 앱 작성하기, part 3 | Django 문서 | Django Django The web framework for perfectionists with deadlines. Overview Download Documentation News Community Code Issues About ♥ Donate docs.djangoproject.com 위의 주소상에서 제일 하단부에 url 용법이 나온다. [ /polls/urls.py ] 1 2 3 4 5 6 7 8 9 10 11 from django.ur..
python 상에서 super 상위클래스 사용방법 여타의 다른 키워드와 동일하게 super 키워드를 쓴다. class ExCreateView(CreateView): def form_valid(self, form): # form.instance.user = self.request.user return super(ExCreateView, self).form_valid(form) python2 에서는 class A(object): def foo(self): print "A" class B(A): def foo(self): print "B" super(B, self).foo() class C(B): def foo(self): print "C" super(C, self).foo() c = C() c.foo() 실..
날짜와 시간 모듈이다. https://docs.python.org/ko/3/library/datetime.html datetime — 기본 날짜와 시간 형 — Python 3.10.4 문서 datetime — 기본 날짜와 시간 형 소스 코드: Lib/datetime.py datetime 모듈은 날짜와 시간을 조작하는 클래스를 제공합니다. 날짜와 시간 산술이 지원되지만, 구현의 초점은 출력 포매팅과 조작을 위한 docs.python.org strftime() 과 strptime() 비교 https://docs.python.org/ko/3/library/datetime.html#strftime-strptime-behavior datetime — 기본 날짜와 시간 형 — Python 3.10.4 문서 date..

위의 이미지를 보면 업로드된 파일들은 모두 media 폴더내에 별도로 files 와 images 폴더로 각각 별도로 저장되어 있다. [ /config/settings.py ] - 프로젝트앱에서 /media 폴더 설정 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 from pathlib import Path import os BASE_DIR = Path(__file__).resolve().parent.parent LANGUAGE_CODE = 'ko-kr' TIME_ZONE = 'Asia/Seoul' USE_I18N = True USE_TZ = True STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE..
일단 request.POST['name'] 이런식으로 보통은 POST 방식으로 넘어온 값을 간편하게 많이 이용한다. 그런데, 그값이 없으면 KeyError 라는 에러를 발생시키고 오류 메세지가 띄워지게 된다. 이를위해 아래 소스처럼 request.POST.get('name') 을 이용하면 에레메세지를 반환하지 않고 name 변수값이 없으면 None 값을 반환하는 것을 알수 있다. 또한, request.POST.get('name', '') 하면 변수값이 없다면 default 로 빈값을 임의로 넣어준다. 참고 : http://daplus.net/django-request-post-get-sth-%EB%8C%80-request-post-sth-%EC%B0%A8%EC%9D%B4%EC%A0%90/ 참고 : htt..
Member 상에 no 라는 PK 가 있고, Board 상에 이와 연결된 member_no 라는 외래키 FK 가 있을때, Board 글 삽입시 아래와 같은 에러메세지를 만났다. ValueError at /board/write/ Cannot assign "'1'": "Board.member_no" must be a "Member" instance. Request Method: POST Request URL: http://127.0.0.1:8000/board/write/ Django Version: 4.0.4 Exception Type: ValueError Exception Value: Cannot assign "'1'": "Board.member_no" must be a "Member" instance. ..
RuntimeError at /member/register You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to 127.0.0.1:8000/member/register/ (note the trailing slash), or set APPEND_SLASH=False in your Django settings. Request Method: POST Request URL: http://127.0.0.1:8000/member..