Server error caused by too many database look-ups

31 views
Skip to first unread message

Jonas Ghyllebert

unread,
May 2, 2012, 3:37:30 PM5/2/12
to django...@googlegroups.com
Hi everybody,

I've got a problem while accessing a model in the Django Adminpanel.
I uploaded the models file, i hope this makes it easier for you to understand my problem.

When I try to add or view a Region in the adminpanel, the server usually gives me an 500 server error.
This is what i get to see:
 

Error: Server Error

The server encountered an error and could not complete your request.

If the problem persists, please report your problem and mention this error message and the query that caused it.

Now, in the uploaded file you may (or not) have seen that I want to have 25 fields from Zip.

My guess is that Django connects to the database for every listbox it is generating.
Is there a way to cache the 2000+ zips?
Or, am I seeing it wrong? What should I do then?

Greetings


models.py

koenb

unread,
May 3, 2012, 2:53:20 AM5/3/12
to django...@googlegroups.com
You should use DEBUG=True in your development settings, so you get a proper traceback of what is going on.

As far as I can see, you do have syntax errors in your models.py file (eg line 266). You should fix them first.

As a side note, your unicode methods are not all correct, some of them are returning bytestrings (this may bite you once you start using non-ascii data).

Koen

Op woensdag 2 mei 2012 21:37:30 UTC+2 schreef Jonas Ghyllebert het volgende:

Jonas Ghyllebert

unread,
May 4, 2012, 7:52:28 AM5/4/12
to django...@googlegroups.com
The site is in debug mode. The problem however is that we build the application step-by-step, because we need data from our client for the next steps. 
That's why we already deployed the site on Google App Engine.

As of the syntax errors you mention, we don't get any errors while testing the app. But we'll look into it.

I'll give database caching a try for my original problem.
Reply all
Reply to author
Forward
0 new messages