Re: Importing project URLs without a database
On Thu, Aug 1, 2013 at 2:38 PM, Phil <phil@soaarchitects.com> wrote:
Could you post the entire content of your script? There is no way those 2 lines (and the necessary "os" import) can cause this error.
You are right. I investigated much deeper. Turns out this is what I did.
1. Script imported root URL conf
2. Through an URL include, many other URL confs were imported
3. Many URL confs import CBVs from views.py
4. These views.py may import models or import modules that import models
5. At some point a queryset was evaluated during an import
In this particular case, it was a choices field on a form. I have since changed this to use ModelMultipleChoiceField.
In this particular case, it was a choices field on a form. I have since changed this to use ModelMultipleChoiceField.
I guess I'll need to be really careful to not evaluate a queryset or stop using CBV (to avoid the imports). Seems a bit fragile.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home