views:

46

answers:

3

I have seen people writing forms in models or in forms.py? Is it the case I can actually write it anywhere say in blah.py and just import it wherever necessary?

A: 

yes, you can put it anywhere provided that you can import it

number5
That's quite vague. How do you know whether you can import it?
Pilgrim
+4  A: 

That's correct. It's just like any other python class, you can define your form classes in whichever file you prefer. However, it is often considered best practice for Django to put them in a file like APP/forms.py.

huwshimi
A: 

You can, but it's better to put forms declarations in forms.py in order that other developers could feel familiar in your project.

matiit