Python2.6 is widely used in computer languages. You can also use python2.6 django to build a development environment in computer languages. If you have doubts about this, you can browse our article. The following is an introduction to this article.
Installation Tools
1. Install python2.6
Install to C:/Python26
Next, add the environment variable to path:
- c:\Python26;c:\Python26\Scripts;
2. Install PIL3. install django to the decompress directory of django, for example:
- cmd
-
- cd /d e:/django/Django-1.1.1
-
Run the following command on the command line to install django:
- python setup.py install
-
- (
-
Let's try to create a directory.
- d:\django_test
-
- cd /d d:
-
- mkdir django_test
-
- cd django_test
-
- django-admin.py startproject mysite
-
You can generate four. py files under the django_test/mysite directory:
- manage.py, __init__.py, urls.py, settings.py。
-
- cd mysite
-
- manage.py runserver
-
Enter:
Http: // 127.0.0.1: 8000/do you see the page of Welcome to Django?
Modify the configuration item configuration file:
- settings.py
-
First, create two directories under the mysite directory
Media: used to store media files templates: used to store template files
- mkdir media
-
- mkdir templates
Open settings. py on the WordPad to modify or add:
- MEDIA_ROOT = 'd:/django_test/mysite'
- STATIC_PATH = 'd:/django_test/mysite/media'
-
- TEMPLATE_DIRS = (
- "d:/django_test/mystie/tempates",
- # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
- # Always use forward slashes, even on Windows.
- # Don't forget to use absolute paths, not relative paths.
- )
-
- )
-
The content of the above article is a part of the introduction of using the Python programming language.