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