Python Web Chapter

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

Create a new virtual environment that is separate from other Python packages

First create a new directory, named XX,

Python3 Operation $:p ython-m venv ll_env

May not succeed

Method One:

Install Virtual environments using PIP install--user virtualenv under Linux

You may be alerted that PIP is not installed

Install PIP and then operate using sudo apt-get install Python-pip

Pip install--user virtualenv to install the virtual machine

  No distributions at all found for virtualenv

But I have a problem, so the use of Ubuntu comes with apt to install, sure enough, different system operation commands are different.

sudo apt-get install python-virtualenv

Installation Complete

Method Two:

.....

Installing a standalone virtual machine using the sudo apt-get install python_virtualenv

Create a stand-alone virtual space

Virtualenv ll_env

Activated

Activating the Environment $:source Ll_env/bin/activate (Linux)

(llenv) ...

Ll_env\scripts\activate (under Windows)

Stop using Deactivate

Use Pip install Django in the virtual machine to install Django

Pip Install Django

Use django-admin.py startproject learning_log.

Ls

LS learning_log to enumerate what files were created

Create a project note. Must add

LS to enumerate files (the book says to create files) use dir under Window

Ls

LS Learning_log (Windows has problems, go to Linux)

/**************************************************/

You can include multiple apps in each Django project, like sub-systems, sub-modules, features, and so on, in a large project, independent of each other, but also associated.

All apps share project resources.

Enter the command in the terminal terminal below Pycharm:

Python manage.py Startapp CMDB

Now we are ready to run the Web service.

The command line is in the following way: Python manage.py runserver 127.0.0.1:8000

But in Pycharm, you can do this:

In the Upper toolbar, locate the icon shown below.

Python Web Chapter

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.