Re: High Load

2006-12-08 Thread Graham King
Cheng, I use Linode and Gentoo as well ! I'm using Apache and MySQL, with memcached. I've spent a lot of time optimizing my setup, so I'm happy to help. The two most important things for me were: - Reduce database usage. Put some code in django.db.backends.postgresql to print out all

QuerySet._combine loses where clause

2006-05-30 Thread Graham King
I have a custom manager for one of my model objects which limits the objects returned. When I use the search features of the admin interface, it seems most of the details of my query set get lost, so the result is no longer limited by the details I passed to the 'extra' method. The

Re: What server configuration to use

2006-05-26 Thread Graham King
PythonistL wrote: > I am going to setup a server to use it with Django. > I am going to use: Trustix Linux (http://www.trustix.org) > mod_Python with Apache > > Is 1GB memory enough? > > Regards, > L. > I'm running two Django sites (www.carriagereturn.org and www.mytimestream.com) on a

Re: SQLite concurrent access to database

2006-05-21 Thread Graham King
Kilian, I does indeed say here that SQLite can handle concurrent transaction, by queuing them up: http://www.sqlite.org/faq.html#q7 You're not using an NFS share are you ? Apparently that would break it. Are you running the app / script on each users machine, or on a web server

cache_page used as 2.4 decorator with time

2006-05-11 Thread Graham King
When trying to cache a page using the cache_page decorator, it doesn't seem to work when passing a time with the python 2.4 syntax. This works: @cache_page def index(request): do stuff As does this: def index(request): do stuff index = cache_page(index,

Re: Strategies for upgrading production databases?

2006-05-11 Thread Graham King
I tend to: - Update tables that have changed (usually adding a column). - Write & run a python script to move data around as appropriate. It's usually very easy with the django db api. - Release your new code and bounce the server. The advantages compared to the full dump / massage /

Re: 'module' object has no attribute 'urlpatterns'

2006-05-11 Thread Graham King
Flavio, Have you recently updated your django using svn ? I had the same problem because there was a 'urls' directory with some .pyc files in django/contrib/admin (there should only be a urls.py, no directory). Deleting the urls directory fixed it. I hope this helps, Graham.

Re: MR django_content_type SQL error

2006-05-10 Thread Graham King
I've now updated this on the Wiki. Graham King wrote: > In the RemovingTheMagic wiki page the SQL to upgrade > django_content_type is given as: > > UPDATE django_content_type SET name='group' WHERE model='group'; > UPDATE django_content_type SET name='user' WH

MR django_content_type SQL error

2006-05-09 Thread Graham King
In the RemovingTheMagic wiki page the SQL to upgrade django_content_type is given as: UPDATE django_content_type SET name='group' WHERE model='group'; UPDATE django_content_type SET name='user' WHERE model='user'; The 'group' and 'user' should be plural. stuka fixes this to: UPDATE

MR - MySQL database upgrade column rename

2006-04-22 Thread Graham King
In the RemovingTheMagic wiki page, the MySQL for upgrading the database has these two lines: ALTER TABLE django_content_type rename package to app_label; ALTER TABLE django_content_type rename python_module_name to model; In MySQL 4.1.14 (and in the docs for MySQL 5.0), the commands

Re: Modify pulldown contents in admin interface

2006-04-10 Thread Graham King
if it causes an issue with threading (I don't know how mod_python works well enough), but it works ! I'm using the CVS trunk build. Thanks again, Graham. Russell Cloran wrote: > Hi, > > On Mon, 2006-04-10 at 15:36 +0100, Graham King wrote: >> Is there a way to control the val

Modify pulldown contents in admin interface

2006-04-10 Thread Graham King
Dear django-users, Is there a way to control the values that appear in a pulldown (a ForeignKey field) on the admin interface ? I would like the ForeignKey to only be assignable to a subset of all values. Any help much appreciated. Graham.

Re: MEDIA_ROOT error ?

2006-03-14 Thread Graham King
Spock, Can you post your urls.py here ? Probably you're just missing a comma. Graham. Spock wrote: > Thant for advice but it doesn't help much.. > Now I'm getting (Web page): > > TypeError at /media/dupa.txt > 'tuple' object is not callable > Request Method: GET > Request URL:

Re: Dreamhost - agh!

2006-03-03 Thread Graham King
pbx wrote: > Adrian said: >> I've never used Dreamhost, but I'll just toss in my two cents that >> having a dedicated server, with root access, is well worth it. >> ... it's still kinda-sorta affordable in the grand scheme >> of things if you're serious about making Web apps. > > I totally

Re: only show something(form) if javascript-enabled

2006-02-20 Thread Graham King
You could make the form invisible using css: #theFormId { display: none; } then use Javascript to change this to display = block. If they don't have Javascript the form won't appear. Or you could use Javascript to write the form out, as in: document.write('
'); but the CSS

Re: mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix

2006-02-16 Thread Graham King
Graham King wrote: > > > paolo wrote: > >>Hi, I had problems running Django with mod_python, so I had the >>possibility to investigate and obtain some detailed info, which I'd >>like to share here. >> >>I'd like to suggest "Expat Causing Apac

Re: recommended javascript books/tutorials/howtos?

2006-02-16 Thread Graham King
Luke Plant wrote: > On Tuesday 14 February 2006 10:07, Gábor Farkas wrote: > > >>i'd like to increase/enhance my javascript knowledge, which right now >>is rather limited (zero?) :) >> >>so, are there are books/websites you can recommend? >> >>i'm primarily interested in the application of

Re: mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix

2006-02-16 Thread Graham King
paolo wrote: > Hi, I had problems running Django with mod_python, so I had the > possibility to investigate and obtain some detailed info, which I'd > like to share here. > > I'd like to suggest "Expat Causing Apache Crash", which explains > problems caused due to mismatches in the version of

Re: mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix

2006-02-16 Thread Graham King
Yes, that is the case. Jacob Kaplan-Moss wrote: > On Feb 15, 2006, at 4:19 PM, Graham King wrote: > >> I have been getting a segmentation fault when using >>django.utils.feedgenerator to generate an RSS feed of my site. This >>works fine with 'django-admin runser

mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix

2006-02-15 Thread Graham King
Dear django-users, I have been getting a segmentation fault when using django.utils.feedgenerator to generate an RSS feed of my site. This works fine with 'django-admin runserver', but when run under mod_python, I get (in Apache's error log): [Wed Feb 15 22:02:41 2006] [notice]