Python Django Framework Development

Source: Internet
Author: User
Tags install django pip install django

Reference Documentation:

http://python.usyiyi.cn/django_182/intro/tutorial01.html #Django 1.8.2 Documentation

Http://www.ziqiangxuetang.com/django/django-admin.html #Django Basic Tutorials

1-1. Installing the Django Framework (official website: https://www.djangoproject.com)

Pip Install django==1.9.1

1-2. Create a Web site project

Django-admin startproject webname #当前目录下会生成webname的目录

1-3. Create the corresponding table in the database

Python manage.py Migrate

1-4. Start the development server

Python manage.py runserver #在webname目录下执行该命令, default 8000 port
8080 #修改此处数字更改默认端口
0.0.0.0:8000  #修改此处数字更改默认端口

2-1. Create a model

Create a Helloweb website app

Python manage.py startapp helloweb #在webname目录下执行该命令

2-2. Edit the Model

2-3. Activating the Model

Edit the mysite/settings.py file and modify the Installed_apps settings to include the string ' Helloweb '

Installed_apps = (    'Django.contrib.admin',    'Django.contrib.auth',    'Django.contrib.contenttypes',    'django.contrib.sessions',    'django.contrib.messages',    'Django.contrib.staticfiles',    'Helloweb',)

Also, notify Django that you want to include the Helloweb app

Python manage.py makemigrations Helloweb

Python Django Framework Development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.