#28307 closed Cleanup/optimization (wontfix)
Add more stub files in startapp template
Reported by: | Mark | Owned by: | nobody |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I find that the standard django app template (the one used by the startapp
command) is a little bit "messy" and it seems to me that encourages not-so-clean architectures for the apps.
This is what I suggest:
- A separate
forms.py
file (to discourage keeping form classes inviews.py
file) - Separate
middleware.py
andmixins.py
files (for the same reason as above, and to make the third party app architectures more similar to django itself, with less doubts for the developer) - A separate
urls.py
file (this is another file I find always creating myself just after the app creation) - Refactor
tests.py
in atests
module, also to encourage modularity of the testsuite instead of creating a mammothtests.py
file by adding "just one more test case" and avoiding the hassle of refactoring the whole thing after some development
I forked the django project on github and created a branch in my repository, here: https://github.com/mcagl/django/tree/mcagl/better-startapp-template
The branch does not conflict with the master
branch
Change History (3)
comment:1 by , 8 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 8 years ago
Summary: | Cleaner app template → Add more stub files in startapp template |
---|
Note:
See TracTickets
for help on using tickets.
You can raise the idea on the DevelopersMailingList but past discussions (search that mailing list's archives for "startapp" and "startproject") to add files or reorganize has not yielded consensus about it -- that's why there's an option for custom project/app templates. The Django master branch no longer suppots Python 2, so
# coding: utf-8
would be obsolete.