I'm learning to deploy Django on Openshift. Right now I have a python-2.7 cartridge up and running with Django 1.6 The git repo cloned in the cartridge is,
git://github.com/rancavil/django-openshift-quickstart.git (Github)
How can I update the Django version of a running webapp?
I've looked at this question that just explain about updating a cartridge, while I'm asking about updating the packages inside a cartridge while keeping the cartridge same as python-2.7.
The easiest way to achieve this is to change the setup dependencies (
install_requires
parameter forsetup ()
) insetup.py
. Instead ofas in the cartridge default you could write
to get the latest version of Django 1.7. More details of how to specify values can be found in the Python Packaging User Guide.
With your next
git push
this file will be executed and the packages get updated, if required.Warnings!
Actually git push takes some time while your application will be down. If you want to shorten the time, you can follow this approach:
ssh into your app openshift server
That will upgrade django immediately. However the running web process still keeps the older version. So you need to restart python cartridge.
From you local command line:
Now its running with the new django and the downtime is minimal.
Make sure to update setup.py as mentioned in the other answer in order to be aligned with the next git push.