Test the Python environment of Baidu cloud computing platform

Source: Internet
Author: User

1. Create an application

Go to the BAE Management page, cloud environment> my Applications> Create an application. Repeat Python during running. Python is currently in Public Beta and needs to be applied separately)

2. Set Version Management

Click "version management" of the current application to create a new version.

After the new version is created, you can see the Svn address in red below

Use the Svn client to check out the address.

3. upload an application

Note: My version is 2.5, and the directory structure of applications of different versions may be different.) create a Django application. Leave the application name in step 2 blank and get the following directory structure:

Modify wsgi. py as follows:

 
 
  1. import os  
  2. import sys  
  3.  
  4. os.environ['DJANGO_SETTINGS_MODULE'] = 'wordServer.settings' 
  5.  
  6. path = os.path.dirname(os.path.abspath(__file__)) + '/wordServer' 
  7. if path not in sys.path:  
  8.     sys.path.insert(1, path)  
  9.  
  10. from django.core.handlers.wsgi import WSGIHandler  
  11. from bae.core.wsgi import WSGIApplication  
  12.  
  13. application = WSGIApplication(WSGIHandler()) 

Copy the entire wordSever subdirectory to the directory you just checked out. The directory structure is as follows:

Finally, submit the change and visit 0.wordserver.duapp.com to see the Django initial interface:

Edit recommendations]

  1. Python deletes the same files in a directory
  2. Several articles required to learn Python well
  3. Several things you should pay attention to when coding Python
  4. Sort else statements in Python
  5. Video: Jack Hong, chief architect of Douban, talks about Python Development

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.