Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您“应该”在哪里将表单定义放在 Django 中,放在哪里models.py,views.py最重要的是为什么?
models.py
views.py
表单定义应该forms.py放在同一个包中,并从那里引用。这是为了代码模块化。
forms.py