[Django] #28307: Cleaner app template

3 views
Skip to first unread message

Django

unread,
Jun 13, 2017, 6:00:14 PM6/13/17
to django-...@googlegroups.com
#28307: Cleaner app template
-------------------------------------+-------------------------------------
Reporter: Mark | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core | Version: master
(Management commands) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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 in
`views.py` file)
* Separate `middleware.py` and `mixins.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 a `tests` module, also to encourage modularity of
the testsuite instead of creating a mammoth `tests.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

--
Ticket URL: <https://code.djangoproject.com/ticket/28307>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 13, 2017, 7:29:51 PM6/13/17
to django-...@googlegroups.com
#28307: Cleaner app template
-------------------------------------+-------------------------------------
Reporter: Mark | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => wontfix


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/28307#comment:1>

Django

unread,
Jun 13, 2017, 7:34:23 PM6/13/17
to django-...@googlegroups.com
#28307: Add more stub files in startapp template

-------------------------------------+-------------------------------------
Reporter: Mark | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/28307#comment:2>

Django

unread,
Sep 29, 2023, 12:53:29 PM9/29/23
to django-...@googlegroups.com
#28307: Add more stub files in startapp template

-------------------------------------+-------------------------------------
Reporter: Mark | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Core (Management | Version: dev

commands) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Natalia Bidart):

Related to ticket #25943

--
Ticket URL: <https://code.djangoproject.com/ticket/28307#comment:3>

Reply all
Reply to author
Forward
0 new messages