Django Development Summary: django Development

Source: Internet
Author: User
Tags virtualenv

Django Development Summary: django Development

First, I used a virtual machine, python3.6 + django1.11.0:

To ensure version consistency and a better environment experience, we need to first run the virtualenv command in the virtual environment:

1. create an environment (name is the name of the virtual environment) virtualenv name 2. activate the virtual environment: source name/bin/activate 3. exit the virtual environment: deactivate 4. uninstall virtual environment: sudo pip uninstall virtualenv

We first enter the virtual environment and then install the required environment in the virtual environment and create a new django project, its command: django-admin.py startproject name

It can be found that there are several files and manage. py file, setting. py is a project file for configuring django, and urls is a url for configuring django, which uses a regular expression to write the address.

Run python manage in the virtual environment. py startapp name to create the app. After the app is created, add the app to the root directory and add the name of the app you created to INSTALLED_APPS in setting.

We can see that there are several py and models in the app. py is used to create a database in python, views. py is a visual, admin. py is used to manage users and customize user management.

 

Related Article

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.