#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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.03775e10243177884717b2d3cc42b730%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to