Practical Walkthrough: Developing a Django Site
Developing a Web site with Django follows a Django set of development processes. This section demonstrates the Django development process and related technologies by creating a message entry page.
6.12.1 Building a Project
Before Django development, you need to build a Django project with Django-admin, with the following syntax:
#django-adminstartproject Site Name
Where Django-admin is the Django Project management tool that is generated in the Python directory after the Django component is installed. For example, create a development project called Djangosite:
#django-admin Startproject Djangosite
The command creates a subdirectory djangosite in the current directory, where the Django-developed default file is generated, and the contents of the Djangosite directory are as follows:
djangosite/manage.py djangosite/__init__.py settings.py urls.py wsgi.py
Several of the files generated by default are important and will be used or maintained in future development, explaining their meanings as follows:
manage.py: This is the command-line tool that Django uses to manage this project, and then the site is run, the database is automatically generated, and the static file collection is done through the file.
The Inner djangosite/directory contains the actual file for this project, and because it contains the __init__.py file, the directory is also a Python package.
djangosite/__init__.py: Tell Python that the directory is a Python package with no content.
Djangosite/settings.py:django the project configuration file. By default, it defines the Django component referenced by this project, the Django project name, and so on. In the subsequent development, you will also need to configure the database parameters, import other Python packages, and other information.
djangosite/urls.py: Maintains the URL route map for the project, which defines which Python module interprets and provides feedback on the URL of the client access. By default, only the "/admin" is defined as the interpreter for the Administrator site.
djangosite/wsgi.py: Defines WSGI interface information for integration with other Web servers, typically this file is not changed after it is generated.
A friend who likes this book can learn this picture oh.
650) this.width=650; "Src=" http://img.blog.csdn.net/20161117215815744?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "/>
Python Efficient development Combat walkthrough-Developing a Django Site 1