3 ms·
By making Django templates and rendering them with the view the backend dev created. Django's original architecture handles this exact separation of concerns. A
by travisjungroth 5y ago
By making Django templates and rendering them with the view the backend dev created. Django's original architecture handles this exact separation of concerns. A view creates a context dictionary (which is equivalent to a JSON response) and then the template is rendered with the context before being returned with the response to the client.
https://docs.djangoproject.com/en/3.2/ref/class-based-views/base/#templateview https://docs.djangoproject.com/en/3.2/ref/class-based-views/...
This pattern seems to have declined in popularity, but it can really win in speed and simplicity over a frontend/API split.