0

When the user submits a form for example, we want to send some data through an HTTP POST to a specific URL served by Django. I'm new to Django and I'm at the point where I have a handle to the submitted request within a view. From here I can parse the request and populate our 'models' however this seems to violate the MVC pattern that Django is trying to enforce.

Is handling the requests directly in a Django view standard practice or should I be delegating this somewhere else?

mbradber
  • 489
  • 5
  • 17
  • 1
    In Django, "view" is synonymous to "controller". It's standard practice to handle a form with a view in Django. Views can either be function-based or class-based depending on what fits best for your architecture. – Brandon Taylor Mar 18 '14 at 01:35
  • 1
    You're welcome. Have you worked through the tutorials on the Django site? They'll give you examples of processing forms. – Brandon Taylor Mar 18 '14 at 01:37
  • @mbradber Take a look at this question: http://stackoverflow.com/questions/6621653/django-vs-model-view-controller Django follows MVC but not absolutely strictly. – Paulo Bu Mar 18 '14 at 01:51

0 Answers0