Django by Example study notes, djangoexample

Source: Internet
Author: User
Tags install django pip install django virtual environment virtualenv

Django by Example study notes, djangoexample

Purpose: I resigned in October 2017 and learned python web development for more than five months. Now, I have submitted my resume for my junior position and practiced projects. Django by example is a very good book. I plan to record some important points in the learning process for reference by myself and others.

System: HP notebook, retain the original win10, and draw a space (400 GB) to install ubuntu 16.04 (dual system installation is also a few twists and turns, before is to follow laruence to learn linux, toss Centos 7, later, we found Fan problems and drive errors. After ubuntu was changed, we encountered a dynamic disk problem under the original win10, backed up data to Baidu's online disk, and changed the dynamic disk to a static disk, later I installed ubuntu with a USB flash drive, and the PCIE reported an error and fan problem. I had a hard time installing sogou's input method for one afternoon. However, I started to like Linux)

 

Pthon environment:

Ubuntu16.04 comes with python3.5.2

 

Virtual Environment Construction:

Pip install virtualenv # install virtualenv

Virtualenv venv # create a venv isolation environment. My directory is in/home/clay-chen/django/venv django, which is a directory I created in advance for exercises.

Source/home/clay-chen/django/venv/bin/activate # activate the Virtual Environment

 

Install Django:

Pip install Django # After the installation is successful, open the python compiling environment and run the following command to check whether the installation is successful:

# Import django. VERSION

 

Create the first project: # For ease of management, I created a new project folder under the venv directory to place the exercise project file. When creating a project, I need to switch to this directory

Django-admin startproject mysite # The new project name here is mysite, which contains manage. py and a sub-Folder mysite with the same name as the project. The sub-folder with the same name contains the project configuration file and route file.

 

Link to MySQL: # django comes with SQLite micro-database, but this should not be used in future production. To enhance the exercise, I chose MySQL, which is different from this book.

  

 

 

  

 

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.