简体   繁体   中英

Django same project multiple times on one server

I had to develop something in Django (new to it) and it went quite smoothly. But after delivering to the client I had to setup a second "testing" instance so that any new features would be tested on it to avoid errors in the production one. And I have only one apache server at my disposal and this breed some weird things.

I run my applications by adding path to the wsgi script in the httpd.conf. It works fine, the new server is up and running. it used a different database so all is good. But it doesent use the views and models from its folder, it used the ones from the original app instead and I just ran out of ideas on how to fix it. Please help me in some way.

I believe that your two django projects should be deployed on your staging and production server as two completely seperate projects/directories.

If you use version control, this could be as trivial as branching your main project and adding the new features. After you have two seperate code bases you can put your fixed branch on your production server.

Your project can exist anywhere on your server. You could set up a staging subdomain and create a virtualhost that points to your django project branch http://httpd.apache.org/docs/2.2/vhosts/examples.html This would allow both projects to exist on the same server, without one project having to be aware of the other

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM