본문 바로가기 메뉴 바로가기

AI Platform / Web

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

AI Platform / Web

검색하기 폼
  • 분류 전체보기 (374)
    • 알고리즘 (56)
      • 알고리즘 종류 (20)
      • 백준 (1)
      • sw (30)
    • Web (206)
      • HTML (10)
      • CSS (6)
      • Bootstrap (2)
      • Django (63)
      • JAVASCRIPT (22)
      • typescript (2)
      • Vue.js (10)
      • SQL (2)
      • git (2)
      • 프로젝트구현 (21)
      • React (42)
      • php (2)
      • nodejs (3)
      • nextjs (12)
    • Database (0)
      • MongoDB (0)
    • 빅데이터 (8)
    • 인공지능(Artificial Intelligenc.. (64)
      • python (23)
      • 자연어 처리(natural language pro.. (16)
      • Linear algebra (1)
      • Algorithm (2)
      • Tensorflow (8)
      • speech recongnition (0)
      • 머신러닝 (4)
      • 딥러닝(Deep Learning) (2)
      • CNN (4)
      • RNN (1)
    • 데이터분석 (9)
    • Platform (12)
      • spring boot (9)
    • 라즈베리파이 (5)
    • github (1)
    • 오픈소스 (1)
  • 방명록

render (1)
[Django] render와 redirect 의 차이점

예를 들어서 상황을 한번 가정해보자. views에서 create이 후에 게시물 목록을 보여주기 위해서 render나 redirect를 할 건데, DB에 저장 후에 게시판이 뜨게 하고 싶다. views.py from django.shortcuts import render, redirect 기본적으로 위와 같이 import를 한다. render(request, 'article/index.html')을 하면, 바로 index.html로 넘어가기 때문에 DB가 없다. 따라서 index.html 로 넘어가도 게시물들이 안 뜬다. 하나의 함수는 하나의 기능만 가능하기 때문에 create함수에서는 DB를 저장 하기만 할 뿐, DB를 불러오기가 안된다. 즉, def index를 거쳐야 한다. redirect를 쓰면 u..

Web/Django 2020. 8. 1. 17:56
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • 자연어처리
  • JavaScript
  • vuejs
  • react
  • TensorFlow
  • react autoFocus
  • useHistory 안됨
  • 자료구조
  • nodejs
  • django
  • nextjs autoFocus
  • login
  • logout
  • Python
  • Queue
  • error:0308010C:digital envelope routines::unsupported
  • Express
  • 클라우데라
  • UserCreationForm
  • next.config.js
  • DFS
  • typescript
  • Deque
  • BFS
  • useState
  • mongoDB
  • NextJS
  • Vue
  • read_csv
  • pandas
more
«   2025/06   »
일 월 화 수 목 금 토
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바