What’s the best place for python classes in a Django project

django

It might sound trivial, but I'd like to know where I am supposed put my python classes (not from Model)?

I mean, my model classes are defined in myapp/models.py but I want, for example, use a syndication feed framework to write a simple feed. The doc says that I need to write a Feed class but… Where should I put the code? Which path and file? I'd like to stick to the default Django directory structure.

Thanks!

Best Answer

You are free to put it where you want.

example:

project
  myapp 
     views.py
     models.py
     feeds.py

Then you can import you're feeds module by using import.

from project.myapp.feeds import *

Making directory is better when you deal with a lot of file. For example:

project
    myapp
      models.py
      views.py
      extras
        feeds.py
        sitemaps.py

I suggest you to read this: Python Modules: Packages