Logic in the consumers.py
instead of views.py
?
#1801
-
Hi, I just want to ask about the good practices about where to put the logic of my application. Normally, in Django, the logic is handled in Looking forward for hearing your opinions :) Best, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @mikbuch — no harm in putting logic in Eventually you want to break out the app-specific logic from the handling requests logic, so you might make methods to encapsulate that, which could be called from your consumers or your views, or backend scripts even. I don't think there's a one-sized answer for this kind of thing… |
Beta Was this translation helpful? Give feedback.
-
Just to leave an account here: we have implemented the logic in the |
Beta Was this translation helpful? Give feedback.
Hi @mikbuch — no harm in putting logic in
consumers.py
, especially to begin.Eventually you want to break out the app-specific logic from the handling requests logic, so you might make methods to encapsulate that, which could be called from your consumers or your views, or backend scripts even.
I don't think there's a one-sized answer for this kind of thing…