1

I like to keep my Django app organized and so I wonder where I should put the code of forms in? Should I write the code in the models file or should I create a new file (i.e. forms.py)?
Does Django have any guidelines for that I should use follow and where do most of the other developer put the forms in?

Matt3o12
  • 4,192
  • 6
  • 32
  • 47

1 Answers1

1

Forms are usually put inside the forms.py under a django app, just near the models.py. Though, if there are a lot of forms in the forms.py, you can make a package from it and split forms into logical parts.

Also see:

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195