You are not logged in.
Some people want to run the latest Django trunk.
To do so, all you have to do is delete $HOME/lib/python2.4/django and replace it with the latest Django trunk.
Restart your Apache instance and voila ![]()
[a12007@web6 ~]$ cd lib/python2.4/ [a12007@web6 python2.4]$ ls django [a12007@web6 python2.4]$ rm -fr django [a12007@web6 python2.4]$ svn checkout http://code.djangoproject.com/svn/django/trunk/django/ [...] A django/middleware/doc.py A django/middleware/transaction.py U django Checked out revision 4313. [a12007@web6 python2.4]$ cd [a12007@web6 ~]$ cd webapps/django/apache2/bin [a12007@web6 bin]$ ./restart Restarted [a12007@web6 bin]$
Cheers,
Remi.
Offline
I already have django 0.95 running, and I'd like to keep it running that way for one site. But, I'd also like to run the development version for second site. How would I do that? Would I wind up with a django and djangoD? or something like that?
Offline
I would create a second application of type Django and checkout the desired revision of Django in the application's directory. If you take this approach don't forget to remove /(Home Directory)/(Username)/lib/python2.4/ from the Python path in your httpd.conf.
Last edited by IAIHMB (2007-03-20 18:59:24)
Offline
Thanks dave.
I'm rather new to python and got lost on the path part. I'm also assuming you meant the httpd.conf and not .htaccess. The path settings in httpd.conf look like this:
PythonPath "['/home2/starledger/webapps/dj_dev_tvj'] + sys.path"
Myproject is running, but I'm not sure if it's using the right version of Django.
I've been following this tutorial: http://forum.webfaction.com/viewtopic.php?id=27 and I'm wondering if this conflicts with the other setting:
>> export DJANGO_SETTINGS_MODULE=mysite.settings
>> export PYTHONPATH=$PWD
Thanks again, and any help would be appreciated.
Offline
You're right, I got .htaccess and httpd.conf confused. By default your Python path will look something like:
-bash-3.00$ python2.4 Python 2.4.3 (#1, Jul 18 2006, 09:58:38) [GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from sys import path >>> path ['', '/home2/starledger/lib/python2.4', '/usr/local/lib/python2.4/site-packages/setuptools-0.6b4-py2.4.egg', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4', '/usr/local/lib/python2.4/plat-linux2', '/usr/local/lib/python2.4/lib-tk', '/usr/local/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages', '/usr/local/lib/python2.4/site-packages/PIL']
Since you don't want to use Django from /home2/starledger/lib/python2.4 you'll want to remove it from your Python path. Assuming the Django that you want to use is located at /home2/starledger/webapps/dj_dev_tvj/django your Python path would be:
['', '/home2/starledger/webapps/dj_dev_tvj', '/usr/local/lib/python2.4/site-packages/setuptools-0.6b4-py2.4.egg', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4', '/usr/local/lib/python2.4/plat-linux2', '/usr/local/lib/python2.4/lib-tk', '/usr/local/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages', '/usr/local/lib/python2.4/site-packages/PIL']
Which would look something like this in httpd.conf:
PythonPath "['', '/home2/starledger/webapps/dj_dev_tvj', '/usr/local/lib/python2.4/site-packages/setuptools-0.6b4-py2.4.egg', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4', '/usr/local/lib/python2.4/plat-linux2', '/usr/local/lib/python2.4/lib-tk', '/usr/local/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages', '/usr/local/lib/python2.4/site-packages/PIL']"
You can check which version of Django you're using with:
-bash-3.00$ python2.4 Python 2.4.3 (#1, Jul 18 2006, 09:58:38) [GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import django >>> django.VERSION (0, 96, 'pre')
Don't forget to update your Python path when in the interactive session or you'll get the version of Django from /home2/starledger/lib/python2.4. With that said it might be easier to upgrade your existing Django project to work with the version of Django that you'd like to use.
Last edited by IAIHMB (2007-03-20 19:58:05)
Offline
This may be a stupid question to the original post, but when I replace the current version with the lates django trunk, I also have to update at least the 5 Python files in the bin-directory, right? (django-admin.py etc.).
Or better, make a link to the file in the trunk.
Offline
schalker wrote:
This may be a stupid question to the original post, but when I replace the current version with the lates django trunk, I also have to update at least the 5 Python files in the bin-directory, right? (django-admin.py etc.).
Or better, make a link to the file in the trunk.
Yes you do. But these files don't change as often as the other files.
Cheers,
Remi.
Offline
Hi,
I just wanted say that I just did the update to the django trunk and I'm getting this on my site now:
Mod_python error: "PythonHandler django.core.handlers.modpython"
Traceback (most recent call last):
File "/usr/local/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
result = object(req)
File "/home2/mazus/lib/python2.4/django/core/handlers/modpython.py", line 177, in handler
return ModPythonHandler()(req)
File "/home2/mazus/lib/python2.4/django/core/handlers/modpython.py", line 145, in __call__
self.load_middleware()
File "/home2/mazus/lib/python2.4/django/core/handlers/base.py", line 31, in load_middleware
raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e)
ImproperlyConfigured: Error importing middleware django.contrib.sessions.middleware: "MySQLdb-1.2.1p2 or newer is required; you have 1.2.1"
I'm about to go see if I can install the newer MySQLdb module but I thought someone might find this useful. Please let me know if there is an easy way around this that I'm not seeing. Thanks.
Offline
You might try replacing this line:
DATABASE_ENGINE = 'mysql'
with this:
DATABASE_ENGINE = 'old_mysql'
From what I've seen on the django-dev list, they needed to ensure that the MySQLdb driver was a certain version, but actually determining that can be problematic. Right now in trunk they simply copied the earlier mysql backend code to "old_mysql" to provide a workaround for exactly the problem you're having.
Either that or ensure that you have MySQLdb-1.2.1p2 or later as your driver.
Offline
Thanks mboersma. It sounds like that would have sorted it. Remi actually went ahead and upgraded the driver for me which fixed it for me. Very useful info though,thanks!
Offline
When I'm creating a new app in the control panel, and I want to use Django's trunk, what App Type should I select?
Offline
I'd select the newest application of type Django (That is, the one which installs the neweset version of Django.) which uses the desired version of Python.
Offline
Right. Looks like it should work.
Offline
I have installed trunk as directed when try to access django from the python shell I am being told that the module doesn't exist. Everything else I have installed in that python dir is showing up with I import from the shell. It is just django giving me problems. Any ideas?
Offline
davemerwin wrote:
I have installed trunk as directed when try to access django from the python shell I am being told that the module doesn't exist. Everything else I have installed in that python dir is showing up with I import from the shell. It is just django giving me problems. Any ideas?
If you cd into lib/python2.5 then import it should work.
Offline
davemerwin: What commands are you executing and what errors are you getting? I imagine that you're using the wrong version of Python. If you installed Django for Python 2.5 make sure you execute "python2.5" instead of "python".
Offline
I installed trunk into python2.4. I installed other modules there as well. They all work, including satchmo when I simply do the following:
$ python
>> import satchmo
>>
However when I do teh following: I get:
>> import django
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named django
>>>
Not sure why I would use 2.5 over 2.4. Every other environment I use is 2.4 and it seems that the command python is aliased to 2.4.
Any ideas?
Lemme know.
Thanks for your time.
Offline
I figured it out. I had checked out svn trunk not svn django. When entering this:
http://code.djangoproject.com/svn/django/trunk/ You get ALL the files including docs and examples. What you want is http://code.djangoproject.com/svn/django/trunk/django
That grabs JUST the django app. Much better and now everything plays well.
Thanks.
Dave
Offline
schalker wrote:
This may be a stupid question to the original post, but when I replace the current version with the lates django trunk, I also have to update at least the 5 Python files in the bin-directory, right? (django-admin.py etc.).
Or better, make a link to the file in the trunk.
man ln wrote:
ln - make links between files
SYNOPSIS
ln [OPTION]... [-T] TARGET LINK_NAME (1st form)
ln [OPTION]... TARGET (2nd form)
ln [OPTION]... TARGET... DIRECTORY (3rd form)
ln [OPTION]... -t DIRECTORY TARGET... (4th form)
DESCRIPTION
In the 1st form, create a link to TARGET with the name LINK_NAME. In
the 2nd form, create a link to TARGET in the current directory. In the
3rd and 4th forms, create links to each TARGET in DIRECTORY. Create
hard links by default, symbolic links with --symbolic. When creating
hard links, each TARGET must exist.
Mmmm, that went in one ear and came out the other
How would I create symlinks to these files? Can you symlink dir to dir? I'm a linux newb so be gentle ![]()
Offline
I didn't make any changes to the bin files and everything works great. Hmmm...
Offline
I've never replaced Django's ~/bin/ stuff when upgrading Django and I've never had any problems. If I'd ever problems with django-admin.py replacing it with the django-admin.py that comes with the version of Django that I'm using would be the first thing that I'd do though. ![]()
Offline
@tworking Remember, your application type allows you to pick your version of python. So, if you update 0.9.6 in Python2.4 but create your app in Python2.5 nothing will work. Make sense?
Offline
Updated instructions are now in the KB:
https://help.webfaction.com/index.php?_ … p;nav=0,24
Offline