Giter Site home page Giter Site logo

djangobasic's Introduction

Django Guide

MVC & MVT - Design Pattern

  • M : Model
    • 안전하게 데이터를 저장
  • V : View
    • 데이터를 적절하게 유저에게 보여줌
  • C : Control, T : Template(Django)
    • 사용자의 입력과 이벤트에 반응하여 Model과 View를 업데이트

Screen Shot 2019-05-18 at 3 13 33 PM

ref) WSGI - Web Service Gateway Interface

Project와 App

  • 프로젝트 생성 $ django-admin startproject 프로젝트명
  • App 생성 $ ./manage.py startapp App명

settings.py

  • DEBUG
    • 디버그 모드 설정
    • SECURITY WARNING: don't run with debug turned on in production!
  • INSTALLED_APPS
    • pip로 설치한 앱 또는 본인이 만든 app 추가
  • MIDDLEWARE
    • request와 response 사이의 주요기능 레이어
  • TEMPLATE
    • django template 관령 설정, 실제 뷰(html, 변수)
  • DATABASES
    • DB엔진의 연결 설정
  • STATIC_URL
    • 정적 파일의 URL(CSS, JavaScript, Images, etc.)

manage.py

  • 프로젝트 관리 명령어 모음
  • 주요 명령어
    • startapp - 앱 생성
    • runserver - 서버 실행
    • createsuperuser - 관리자 생성
    • makemigrations app - app의 모델 변경사항 체크
    • migrate - 변경사함을 DB에 반영
    • shell - 쉘을 통해 데이터를 확인
    • collectstatic - static파일을 한 곳에 모음
  • ex ) ./manage.py runserver 0.0.0.0:8080

djangobasic's People

Contributors

dodant avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.