Abstract Base Classes - make Abstract class - this class do not have database table class Abstract_Model( ) : variable 1 = models.DateTimeField() class Meta : abstract = True CREATE SU > python manage.py createsuperuser >> username >> email address >> password Models & Migration :: Models - Django create table per model - Django model looks like from django.db import models class Model_name(inheritance) : variable1 = models.CharfField(constraints) variable2 = models.URLField(constraints) variable3 = models.DateTimeField(constraints) :: Migration - update database schema > python manage.py makemigrations > python manage.py migrate Django ORM - database agnostic - only need driver(Adapter) - ORM -> Object-relational mappers - SQL vs Django ORM SQL> SELECT * FROM users WHERE country = "korea" ORDER BY signup_date Django> User.objs.filter(country ="korea").order_by('signup_date) * write in python * Django Translates to SQL :: Run 1. Create data base > CREATE DATABASE {data base name} 2. runserver > pipenv shell > python manage.py runse.. INSTALL PACKAGES and Setting :: Install > pipenv --three > pipenv shell > pipenv install -r requirements/local.txt :: Files local.txt base.txt :: Setting config L settings L base.py L local.py L production.py base.py, local.py => Run on Application production.py => Run on Server Git Basic git init (대상 폴더 initialize) git remote add origin {Repo URL} (저장소와 연결) git pull origin master git add . git commit -m "commit msg" git push origin master init -> initialize remote -> pointing git repository add . -> add changed commit push CookieCutter - create django project - can customize django project :: Install > pip install cookiecutter :: clone > cookiecutter url >> project name >> author name >> email >> description >> domain name >> version >> timezone : Asia/Seoul >> white noise n >> celery n >> mailhog n >> sentry for error reporting n >> opbeat n >> pycham n >> windows n >> docker n >> heroku n >> elastic beanstalk experimental n .. Parts of Django - Settings > Change the default set of Django > Install modules > remove modules - Urls > get Url > execute a view function - Apps > Components, Functions > CRUD 이전 1 ··· 5 6 7 8 9 다음