d_novice
d_novice

Reputation: 497

Django Views and Urls

This is a bit long so please bear with me.....

I am in the middle of building an android application. I have built the client app, now I am working on the server.

I have decided to use Django for the server. Though I have already decided on the data structures, currently I am stuck with how am I supposed to send different kinds of requests from the server and how the server is supposed to handle them differently.

For example:

  1. A request could be registering a new user and storing his credentials.
  2. Another request could be when a user likes or dislikes a comment. ..... there could be few more

One way that I can think of is to first have separate "django views" for each kind of requests and then attach a "django url" to it. Now from the client app, a particular kind of request could be made at its specific url, and then once received at the server, "django" will automatically direct it to its view, which will then take the desired actions.

Please let me know if there are any better ways to do it.

Upvotes: 1

Views: 68

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599906

Yes, that is exactly how to do it.

You probably want to look into Django REST framework for this.

Upvotes: 2

Related Questions