Django Learning Case One (blog): I. Create a project, APP

Source: Internet
Author: User

1. Create Project

Method One: Use the command line to create the project. In the D-disk cmd execute the following command:

django-admin.py Startproject MyBlog

Method Two: Create the project using Pycharm. Drop location is D:\myblog

2. Create an App

Method One: Use the command line to create the app, in the D-Disk blog folder cmd execution command line creation.

Method Two: Create in pycharm with the terminal command line.

Python manage.py Startapp Blog

3. Introduction of documents

(1) mange.py is a project management tool in Django

(2) files in MyBlog (project):

Wsgi.py:WSGI is the Web Server Gateway Interface Server gateways interface. Is the interface between the Python app and the Web server. No need to move it.

Urls.py:URL configuration file. All the Addresses (pages) in the Django project need us to configure their URLs.

setting.py: The overall configuration file for the project. Includes databases, Web applications, time, and many other configurations.

Base_dir: The root directory of the project

Debug: When set to True, program exceptions are displayed on the front end, set to True when developing debugging, and set to False when actually produced.

Installed_apps: Installed applications, the application of their own development will be added in the future.

Middleware: Middleware, Django comes with a toolset.

Templites: Template. That is, HTML files.

DATABASES: Database configuration.

Language_code: Language.

Time_zone: Time zone.

Static_url: The address of the static file.

_init_.py: Declares the module's file, which is generally empty.

(3) files in the blog (APP)

Migrations: A module for data migration. Content is automatically generated by Django.

admin.py: The configuration file for the application's background management system.

app.py: Some configurations of the application.

models.py: The data table is created here.

test.py: Automated test module.

vies.py: The module in which the code executes the response. The primary location for code logic processing. Most of the code in the project is written here.

Django Learning Case One (blog): I. Create a project, APP

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.