0

I have a project where I will be creating certain data models, and managing them. I also want to provide functionality to external clients to access and modify this database. So the question is around how to structure various components to achieve this. I have so far considered two options:

Option 1

Create a list of APIs using Django REST Framework, which is a separate Django project. Create another Django project which does not have any backend of its own, and the rendered templates make AJAX calls to the first project or using COREAPI, to fetch and modify data. Clients can interact with the first project, and make modifications.

Option 2

Create one Django project, which has the data models, as well as frontend templates. It also exposes certain endpoints using Django REST Framework, which can be accessed by clients for data modification and access.

Which option would you recommend?

0

I'm not telling which one to pick, instead of that i will give idea about both of this. You can take your decision.

Option 1

Pros:

  1. Front-End and Back-End are different, so you can easily handle many requests (Load Balancing).
  2. Data Security is more in this, because the user cannot change the Data models easily (Data Security).

Cons:

  1. You need two different server to host. (Higher cost)
  2. Changes and deployment needs to be done in two places. (Extra time)

Option 2

Pros:

  1. Cons of Option 1

Cons:

  1. Pros of Option 1

It depends upon your use case. If you're building some static site with small "Contact us" form data to be saved in DB, you can use Option 2. If you're going to create a site which will have fully dynamic data then go for Option 1. Think and make a decision.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.