How to run multiple Django programs concurrently on the Apache server

Source: Internet
Author: User
It is entirely possible to run multiple Django programs in the same Apache instance. You might want to do this when you are a standalone WEB developer and have multiple different customers.

As long as you use VirtualHost like this, you can achieve:

Namevirtualhost *
 
  
   
    ServerName www.example.com  #  ... SETENV django_settings_module mysite.settings
 
  
 
  
   
    ServerName www2.example.com  # ...  SETENV django_settings_module mysite.other_settings
 
  

If you need to run two Django programs in the same VirtualHost, you need to pay special attention to ensure that the Mod_python code cache is not messed up. Use the Pythoninterpreter directive to interpret the different instructions separately:

 
  
   
    ServerName www.example.com  # ...  
  
   
    
       SetEnv django_settings_module mysite.settings    pythoninterpreter mysite  
  
     
  
   
    
       SETENV django_settings_module mysite.other_settings    pythoninterpreter mysite_other  
  
   
 
  

The values in this pythoninterpreter are not important, as long as they are different in two location blocks.

  • 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.