Python+django+bootstrap Frame Environment Construction

Source: Internet
Author: User
Tags install django pip install django

1. Install Python and pip (python, pip install self Baidu, Pip is a tool to install and manage Python packages)

2. Configure Python environment variables (both Python and scripts directories need to be configured)

3. Installing Django: Two methods

  Installation:

The first method: Execute in the python\scripts directory: Pip install Django

The second method: Download the Django installation files (such as: Django-1.8.2.tar), unzip, the cmd command line into the Django-1.8.2 extracted directory (note the decompression directory has setup.py file), and then execute the command: Python setup.py Install

  To set the Django environment variable:

Add the Django installation directory settings to the path

  Verify that the installation is successful:    

D:\django-1.8.2>python
Python 2.7.8 (Default, June, 16:03:49) [MSC v.1500 + bit (Intel)] on win
32
Type "Help", "copyright", "credits" or "license" for more information.
>>> Import Django
>>> django.get_version ()
' 1.8.2 '
>>>

Success

4, Installation DJANGO-BOOTSTRAP3

Installation method:

Pip install: Execute in python\scripts directory, pip install DJANGO-BOOTSTRAP3

Manual Installation:

Download: django-bootstrap3-7.0.1.tar.gz (: HTTPS://PYPI.PYTHON.ORG/PYPI/DJANGO-BOOTSTRAP3)

Extract:

Install: CMD into the directory where the setup.py file is located, Run command: Python setup.py install

D:\django-bootstrap3-7.0.1>python setup.py Install
Running Install
Running Bdist_egg
Running Egg_info

......

Installed D:\python27\lib\site-packages\django_bootstrap3-7.0.1-py2.7.egg
Processing dependencies for django-bootstrap3==7.0.1
Finished processing dependencies for django-bootstrap3==7.0.1

Build the Django_bootstrap3-7.0.1-py2.7.egg folder in the Python27\lib\site-packages directory after the installation is complete

      

  Add "Bootstrap3" to the Installed_apps module in the Django settings.py file, as follows:

Installed_apps = (
' Django.contrib.admin ',
' Django.contrib.auth ',
' Django.contrib.contenttypes ',
' Django.contrib.sessions ',
' Django.contrib.messages ',
' Django.contrib.staticfiles ',
' Blog ',
' Bootstrap3 ',
)

Django-bootstrap3 comes with demo, enter the demo directory, start the service:

D:\django-bootstrap3-7.0.1\demo>python manage.py Runserver
Performing system checks ...

System Check identified no issues (0 silenced).

You have unapplied migrations; Your app properly until they is app
Lied.
Run ' python manage.py migrate ' to apply them.
June 15, 2016-17:35:20
Django version 1.8.2, using Settings ' demo.settings '
Starting development Server at Http://127.0.0.1:8000/
Quit the server with Ctrl-break.

Remark: D:\django-bootstrap3-7.0.1 for extracting directory

Browser access: Http://localhost:8000/

Python+django+bootstrap Frame Environment Construction

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.