Django (14) 썸네일형 리스트형 django5 - DB layout.html, List.html 을 활용한 css 적용법 table 작성 models.py from django.db import models # Create your models here. # Database Table을 class로 선언 class Article(models.Model): code = models.CharField(max_length = 10) name = models.CharField(max_length = 20) price = models.IntegerField() pub_date = models.DateTimeField() table을 생성할 경우는 Migrations를 해야한다. Migrations 후에 늘 하던데로 migrate도 해야한다. (사진 첨부는 하지 않았지.. django4 - session 예제(간이 쇼핑몰, 장바구니 기능) urls.py """django4_shop URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpat.. django3 - session url.py from django.contrib import admin from django.urls import path from sessionapp import views urlpatterns = [ path("admin/", admin.site.urls), path('', views.mainFunc), path('setos', views.setOsFunc), path('showos', views.showOsFunc), ] views.py from django.shortcuts import render from django.http.response import HttpResponseRedirect # Create your views here. # 아래 모든 방식을 알아둬야 한다. def mainFun.. django2 - GET, POST, django 기본 구조 urls.py 웹앱의 페이지를 어떤 주소에 연결 시킬지를 정의하는 파일이다. path를 작성하는 방식은 3가지가 있다. 그중에서 Including another URLconf 가 가장 많이 사용된다. """django2 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.1/topics/http/urls/ Examples: Function views # 플젝이 단순할때 사용 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', vie.. django1 - static 폴더 (image, css, js) 게시글 참고 2022.10.14 - [개발을 위한 준비/설치 및 설정] - 장고 ip 주소 및 포트 번호 기본 값 설정 이전게시글 참고 2022.10.14 - [Django] - Django 시작하기 - html 출력 및 forward urls """django1 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: p.. Django 시작하기 - html 출력 및 forward Django 설치 및 Django 프로젝트 실행하기 이전 게시글 참고 2022.10.14 - [개발을 위한 준비/설치 및 설정] - Django 설치(윈도우) 서버실행하기 다만 장고가 준비한 서버는 상업용으로 쓰기에는 문제가 있기 때문에 nginx 혹은 apache를 사용해야 한다. 다만 그것을 프로그래머가 하는 경우는 드물다. 이클립스 외의 에디터(파이참, 비쥬얼스튜디오 등)로 할 경우 Anaconda Promp실행 cd /work dir django-admin startproject goodpro cd goodpro dir goodpro python manage.py startapp myapp views html 출력 from django.shortcuts import render from djang.. 이전 1 2 다음