Skip to content

Logic in the consumers.py instead of views.py? #1801

Answered by carltongibson
mikbuch asked this question in Q&A
Discussion options

You must be logged in to vote

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…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@mikbuch
Comment options

@carltongibson
Comment options

Answer selected by mikbuch
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants