项目作者: mertdot

项目描述 :
Python Django Web Framework - Full Course for Beginners
高级语言: Python
项目地址: git://github.com/mertdot/trydjango.git
创建时间: 2020-03-18T15:09:10Z
项目社区:https://github.com/mertdot/trydjango

开源协议:

下载


trydjango

Python Django Web Framework - Full Course for Beginners

Entry

We have to set up virtualenv because manage third party packages easily.to start virtualenv we can just type,

  1. $ virtualenv . # '.' points all files inside of folder

To start virtualenv enter that main folder, not root folder, just folder that keeps all project files inside and type,

  1. $ source bin/activate

Create Project

  1. django-admin startproject [projectName] #type this inside of src file which we created before and is located main folder.

Start Server

  1. python manage.py runserver # type that inside of root folder.()

Models

  1. $ python manage.py startapp [modelName] #this line creates new model

Migrations

  1. $ python manage.py makemigrate #to migrate our models
  1. $ python manage.py migrate #apply all migrations

Admin Panel

  1. $ python manage.py createsuperuser

What we learnt except django

  1. $ pip freeze #Output installed packages in requirements format.

Addition

main folder stands for folder that keep whole project files.

root folder’ stands for folder that keeps that only project files and also keeps manage.py*.Mostly, root folder is ‘/src’ folder.