WebFaction
Community site: login faq

I have an app that was set up using Python 2.5 / Django 1.1. I’d like to upgrade Django to the latest stable release (1.2.4), but that requires Python 2.6. How can I get this app to use Python 2.6?

Thanks! -- David

asked 30 Jan '11, 19:35

davidcairns
112
accept rate: 0%


Our newest apache builds use that version of Django and Python. The easiest would be to create a new blank Django application with Django 1.2.4 and Python 2.6 and migrate your app to it. Directly converting it would be difficult and would still require rebuilding apache and its libraries. You could leave your current app online and bind this one to a temporary URL while you migrate your code.

permanent link

answered 30 Jan '11, 19:42

johns
5.3k312
accept rate: 23%

I would appreciate a great deal more detail around this, particularly the "migrate your app" bit. What is the procedure there? Thanks so much.

(16 Apr '11, 19:28) barsoomcore
1

A typical django webapp looks something like this:

$HOME/webapps/django/
                     apache2/
                     bin/
                     lib/
                     myproject/
                     myproject.wsgi

The "Django-specific" part of this application directory is the "myproject" folder in here. This is sometimes called the "Django app" or "app" when used in context with Django. For the sake of clarity, consider the entire "$HOME/webapps/django" folder to be the "webapp". This is what the Control Panel creates when you add a new Django web application via one-click automated installer.

You can generally create a new updated Django webapp from the Control Panel. Then, you will have another webapp available:

$HOME/webapps/django_130/
                     apache2/
                     bin/
                     lib/
                     myproject/
                     myproject.wsgi

Then, just move the "old" myproject/ and myproject.wsgi files to the new application. This is "copying your old Django application to the new webapp". The "migration" part suggests that you may then need to update some configuration settings, install required python libraries, etc, until the application works. All of this is application-specific so there really isn't a particular guide to doing it.

(16 Apr '11, 19:47) ryans ♦♦

Thanks! For reference (at least my own next time I have to do this):

I have a custom app name, and thus custom directory and .wsgi file names. So I had to edit references to the old django app directory so they pointed to the new django app directory, in the .wsgi and settings.py files. I also had to update the httpd.conf in new_django_app/apache2/conf/ so that it pointed at the custom .wsgi file.

Then I had to install libraries in ~/lib/python_new_version

Thanks again for the help.

(22 Apr '11, 18:59) barsoomcore

Glad to help! And thanks for elaborating on your migration configuration updates, as well :)

(22 Apr '11, 19:43) ryans ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×337
×113
×21
×7

question asked: 30 Jan '11, 19:35

question was seen: 6,282 times

last updated: 22 Apr '11, 19:43

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM