Django Study Notes (1): Understanding Django

Source: Internet
Author: User
Tags django web server install django

I. References

1. Django Book
2. Google & Baidu & django official website documentation

2. Introduction to Django
1. History

Baidu .......

2. Features

3. MVC design mode

The biggest feature of django's mvc development model is loose integration.

Iv. Django Installation

1. installation steps:

Baidu or blog

2. Note

(1). Django requires Python 2.3 or later.
(2). Python may be pre-installed in Linux or Mac OS X.
(3) Django hosts three database engines: PostgreSQL/MySQL/SQLite 3

3. Check whether the installation is successful.

If you enter the preceding command and the version information is displayed successfully, the installation is successful.

5. Django initial experience

If you use setup. py tool to install Django, The django-admin.py has been added to the system path, because we often use, so it is recommended to add to the system search path, for Windows, change the PATH environment variable (which is included in the Python and Django installation tutorials)

1. Project Process

(1) Open DOS, You can manually create a folder or enter the doscommand (mkdir)
(2) enter the django-admin.py startproject mysite to create a mysite project in the current directory, which contains:
_ Init _. py: Let Python treat this directory as a file required by an Development Kit (that is, a group of modules ).
Manage. py: a command line tool that interacts with django projects in multiple ways
Settings. py: Configuration tool for this Django Project
Urls. py: URL declaration of this Django Project
(3) Start the built-in Django web Server
Enter the manage. py runserver command in the current directory to start
(4) view in the browser
Enter 127.0.0.1: 8000 to see the page "It Worked"

2. Change host or port
The default port is port 8000, and only the local connection can be monitored. The change can be as follows:

You can also change the IP address of the server listener so that django can listen to all network interfaces, so that other computers can connect to the server.

 

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.