Stefan Foulis wrote:
> what I'm trying to do is divide up the views.py file into multiple
> files because the single views.py file in some of my apps is getting
> very cluttered.
>
> I tried just making a views subdirectory and then placing multiple
> files with groups of views inside

Ditto to what Nathan suggested about putting an
empty __init__.py into your new views directory,
but even if you want to break up your views file
it's not necessary to create a seperate directory.
You could organize it something along the lines of:

  mysite/
      myapp/
          views_eggs.py
          views_ham.py

An alternative would be to keep everything that's
exposed to your templates in views.py, and the
secondary stuff in other file(s):

  mysite/
      myapp/
          views.py
          utils.py

Then in views.py, import the stuff from utils.py:

  # views.py
  from mysite.myapp.utils import supervalidator, xfabulator

No changes are necessary to urls.py, and you keep all
the 'public' functions in a single file.

P.S.  Cum grano salis: My Django experience is less than
a week old.

--
Jeff Bauer
Rubicon, Inc.


--~--~---------~--~----~------------~-------~--~----~
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to