본문 바로가기

반응형

Django

(37)
Django ForeignKey 데이터 가져오기 https://docs.djangoproject.com/en/4.0/topics/db/examples/many_to_one/ Many-to-one relationships | Django documentation | Django Django The web framework for perfectionists with deadlines. Overview Download Documentation News Community Code Issues About ♥ Donate docs.djangoproject.com Comment와 Post는 Many to One 관계이다. 이런 경우 특정 Post에 대한 Comment 전체를 가져오려면 아래와 같이 코딩한다. comment = Comment.objects.filte..
Django Models, Create Table, ForeignKey https://docs.djangoproject.com/en/4.0/topics/db/models/ Models | Django documentation | Django Django The web framework for perfectionists with deadlines. Overview Download Documentation News Community Code Issues About ♥ Donate docs.djangoproject.com Django는 Models에서 Data field를 정의하게 된다. Model을 정의하면 자동으로 Django가 DB Table을 생성 및 관리 한다. class Post(models.Model): post_title = models.CharField(max_l..
Django csft token with Ajax https://docs.djangoproject.com/en/4.0/ref/csrf/ Cross Site Request Forgery protection | Django documentation | Django Django The web framework for perfectionists with deadlines. Overview Download Documentation News Community Code Issues About ♥ Donate docs.djangoproject.com 폼을 이용하는 경우 폼 tag 사이에 {% csft_token %} 을 넣어주면 된다. {% csrf_token %} Ajax를 이용하는 경우 javascript로 csrftoken 값을 가져와서 X-CSRFToken 값..
Django에 bootstrap 설치 https://django-bootstrap-v5.readthedocs.io/en/latest/installation.html Installation — django-bootstrap-v5 1.0.0 documentation Installation The preferred way to install django-bootstrap-v5 is pip : $ pip install django-bootstrap-v5 Alternatively, you can install download or clone this repo and install from its folder with: $ pip install -e . In your project, you should add django-bootstrap-v5 to ..
Django 서버의 static folder 파일 다운로드 https://stackoverflow.com/questions/48842061/download-static-file-displayed-in-the-list-django 이미지 썸네일 삭제 Download static file displayed in the list Django I am trying to make static files download-able from the template of my Django app. def list(request): folder = '/home/galander/Desktop/Projekty/django-pdf-generator/django-pdf/generator/static... stackoverflow.com https://docs.djangoproject.c..
Django에서의 request의 multipart 파일 처리 https://docs.djangoproject.com/en/4.0/topics/http/file-uploads/ File Uploads | Django documentation | Django File Uploads ¶ When Django handles a file upload, the file data ends up placed in request.FILES (for more on the request object see the documentation for request and response objects ). This document explains how files are stored on disk and in memory, and how to customize the default beh..
Django Login, Logout 템플릿 이용하기 https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Authentication 이미지 썸네일 삭제 Django Tutorial Part 8: User authentication and permissions - Learn web development | MDN Excellent work — you've now created a website that library members can log in into and view their own content and that librarians (with the correct permission) can use to view all loaned books and their borrowers. At..
Django Auth https://docs.djangoproject.com/en/4.0/topics/auth/default/ Using the Django authentication system | Django documentation | Django Using the Django authentication system ¶ This document explains the usage of Django’s authentication system in its default configuration. This configuration has evolved to serve the most common project needs, handling a reasonably wide range of tasks, and has a carefu..

반응형