Thanks, Shawn. I believe the PYTHONPATH is fine, because other views and templates that didn't have forms were working correctly.
But you're right about "addSample = sampleEntry(request.POST)" causing the error. I commented out those two lines and the error goes away, and the page displays. I suppose I need to put those items in a view to make them actually interact with the model. I also need to study the documentation a little more closely, it appears. On Jul 19, 10:19 am, Shawn Milochik <sh...@milochik.com> wrote: > > When I comment out the import views above, it gives me the following > > error: > > > Exception Type: NameError at /QC_THISSS_01/samples/create/ > > Exception Value: name 'request' is not defined > > This is because when you import the file it attempts to actually execute the > line "addSample = sampleEntry(request.POST)" despite the fact that there's > no request at this point. > > The failure to import is probably because you myProject is not on your > PYTHONPATH. > > Incidentally, you can leave out the myProject portion of the imports if this > app is intended to be self-contained, as in a re-usable app that won't > necessarily know where it will live. > > Also, it's bad form to camelCase a class (sampleEntry) in Python. > SampleEntry is preferred. > > Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.