본문 바로가기

Django118

Django Form 종류 https://iridescent-zeal.tistory.com/199 [Django]장고에서 사용자 입력받기 - Form 이용하기 [ Django에서의 Form ] 장고에서는 사용자가 입력을 하게되면 그 입력에 대한 처리를 할 수 있드록 폼 기능을 제공합니다. models.py의 모델 클래스의 필드가 데이터베이스 필드에 매핑되는 것처럼, 폼 iridescent-zeal.tistory.com 모델 정의 from django.db import models class Student(models.Model): studentID = models.IntegerField() name = models.TextField() major = models.TextField() def __str__(self): return .. 2023. 5. 1.
Django Flash Messages Introduction to the Django Flash Messages 플래시 메시지는 일회성 알림 메시지입니다. Django에서 플래시 메시지를 표시하려면 django.contrib 모듈의 messages를 사용합니다. from django.contrib import messages The messages have some useful functions for displaying information, warning, and error messages: messages.debug – displays a debug message. messages.info – displays an informational message. messages.success – displays a success message.. 2023. 4. 29.
Django Migrations Introduction to Django migration commands Django로 작업할 때 새 테이블을 만들거나 기존 테이블을 변경하기 위해 SQL을 작성할 필요가 없습니다. 대신 Django 마이그레이션을 사용합니다. Django 마이그레이션을 사용하면 명령줄을 통해 모델에 대한 변경 내용을 데이터베이스에 전파할 수 있습니다. Django는 모델에 대한 변경 내용을 기반으로 새 마이그레이션을 만들고 마이그레이션을 데이터베이스에 적용하기 위한 몇 가지 명령을 제공합니다. 모델을 변경하고, 마이그레이션을 만들고, 변경 내용을 데이터베이스에 적용하는 프로세스는 다음과 같습니다. The process for making changes to models, creating migrations, and a.. 2023. 4. 28.
Django Models Introduction to Django models Django에서 모델은 django.db.models.Model 클래스의 하위 클래스입니다 . 모델에는 필드를 조작하는 하나 이상의 필드와 메서드가 포함되어 있습니다. 기본적으로 Django 모델은 모델의 각 필드가 테이블의 column을 나타내는 데이터베이스의 단일 테이블에 매핑 됩니다. 응용 프로그램에는 models.py 모듈에 저장된 0개 이상의 모델이 있을 수 있습니다. 예를 들어 다음은 blog 응용 프로그램에 대한 Post 모델을 정의합니다. from django.db import models from django.utils import timezone class Post(models.Model): title = models.CharFiel.. 2023. 4. 28.
Django 배포 코드를 GitHub에 저장하고 GitHub에 저장된 코드를 PythonAnywhere에서 가져다가 작동하는 방법 https://m.blog.naver.com/pjok1122/221607377401 [Python / Django] pythonanywhere 배포하기(웹 호스팅) 1. 배포를 위한 설정 Setting.py에서 다음을 수정하셔야 합니다. (1) DEBUG 처음에는 DEBUG &#x... blog.naver.com 0. 준비 작업 pythonanywhere 회원 가입 github 회원 가입 1. 배포파일 마무리 1) setting파일 설정 SECRET_KEY 분리 - ????? DEBUG 설정 - False ALLOWED_HOSTS 설정 - hosting업체에서 할당한 주소 지정 SECRET_K.. 2023. 4. 14.
Getting Started with Django Django overview Django Home : https://www.djangoproject.com/ Django uses the MVT (Model-View-Template) pattern, which is slightly similar to MVC (Model-View-Controller) pattern. The MVT pattern consists of three main components: Model – defines the data or contains the logic that interacts with the data in the database. View – communicates with the database via model and transfers data to the te.. 2023. 4. 8.
Django Create App Django projects and applications In the Django framework: A project is a Django installation with some settings. An application is a group of models, views, templates, and URLs. Django 프로젝트에는 하나 이상의 응용 프로그램이 있을 수 있습니다. 예를 들어 프로젝트는 블로그, 사용자 및 위키와 같은 여러 응용 프로그램으로 구성될 수 있는 웹 사이트와 같습니다. 일반적으로 다른 Django 프로젝트에서 재사용할 수 있는 Django 애플리케이션을 디자인합니다. 다음 그림은 Django 프로젝트의 구조와 응용 프로그램을 보여줍니다. Creating a blog ap.. 2023. 4. 8.
[ DJANGO ] Index DJANGO BASICS Getting Started with Django Creating a Django App Defining Models Making Migrations Creating Flash Messages Using Django Admin Understanding Django Form Creating Templates Defining Edit Form Creating Delete Form Building Login/Logout Forms Building User Registration Form DJANGO CLASS-BASED VIEWS Django Todo App Displaying a List using Django ListView Displaying a Model Detail using.. 2023. 4. 8.