Build a development environment using Python2.6

Source: Internet
Author: User

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:

 
 
  1. c:\Python26;c:\Python26\Scripts;  

2. Install PIL3. install django to the decompress directory of django, for example:

 
 
  1. cmd  
  2.  
  3. cd /d e:/django/Django-1.1.1  
  4.  

Run the following command on the command line to install django:

 
 
  1. python setup.py install  
  2.  
  3. (  
  4.  

Let's try to create a directory.

 
 
  1. d:\django_test  
  2.  
  3. cd /d d:  
  4.  
  5. mkdir django_test  
  6.  
  7. cd django_test  
  8.  
  9. django-admin.py startproject mysite  
  10.  

You can generate four. py files under the django_test/mysite directory:

 
 
  1. manage.py, __init__.py, urls.py, settings.py。  
  2.  
  3. cd mysite  
  4.  
  5. manage.py runserver  
  6.  

Enter:

Http: // 127.0.0.1: 8000/do you see the page of Welcome to Django?

Modify the configuration item configuration file:

 
 
  1. settings.py  
  2.  

First, create two directories under the mysite directory

Media: used to store media files templates: used to store template files

 
 
  1. mkdir media  
  2.  
  3. mkdir templates  

Open settings. py on the WordPad to modify or add:

 
 
  1. MEDIA_ROOT = 'd:/django_test/mysite' 
  2. STATIC_PATH = 'd:/django_test/mysite/media'   
  3.  
  4. TEMPLATE_DIRS = (  
  5. "d:/django_test/mystie/tempates",  
  6. # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".  
  7. # Always use forward slashes, even on Windows.  
  8. # Don't forget to use absolute paths, not relative paths.  
  9. )   
  10.  
  11. )  
  12.  

The content of the above article is a part of the introduction of using the Python programming language.

     
   

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.