Hi,

I'm having a very strange problem with a site I've developed, which
only seems to happen when DEBUG=False and is now preventing my from
launching the site (unless I launch it in DEBUG mode, which I
obviously don't want to).  The EXACT same code works in DEBUG=True,
but with DEBUG=False I get the following error when trying to access
one of my ManyToMany fields:

views.py - FieldError: Cannot resolve keyword 'page' into field.
Choices are: bank_holidays, date_values, finish, id, start, values,
year

I have discovered that if I comment out my admin.autodiscover() line
in urls.py it suddenly starts working again.  I've therefore looked at
my admin.py and simplified it to a very basic example, but this still
doesn't work.  Here are the relevant parts of my code (let me know if
there are any other parts that would be useful to see)...

models.py: http://dpaste.com/hold/537990/
views.py: http://dpaste.com/537991/
admin.py: http://dpaste.com/hold/537993/

So as soon as I try and lookup page.years.all() in my page view I get
an error.  If I don't import any models in my admin.py (I've tried
removing the whole admin.py file) then I can lookup page.years.all()
without any issues.  Weird!  Maybe some sort of circular import issue
or something?  I've been looking at this for 6 hours and can't see a
solution so any help would be great!

I'm using Apache with mod_wsgi in daemon mode and I am touching the
wsgi file to reload the code between test attempts.  I've tried
embedded mode and restarted Apache just incase the changes weren't
being loaded properly, but this gives the same behaviour.  I'm using
Django 1.2.5.

Thanks,
Nick

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to