Logo

dev-resources.site

for different kinds of informations.

To Django or to DjangoREST?

Published at
11/2/2024
Categories
python
django
drf
backend
Author
ru0ya
Categories
4 categories in total
python
open
django
open
drf
open
backend
open
Author
5 person written this
ru0ya
open
To Django or to DjangoREST?

Django and DjangoREST are high level frameworks in Python that might be argued on whether they are different, so are they?. DjangoREST is used for building API's(Application Programming Interface) while Django for web apps.To leave it at that though would leave one with a conclusion and so lets explore further.
What is Django?
It is a high level framework that follows the Model-View-Template(MVT) pattern. It handles both front-end and back-end development providing features for a standard web app. Utilises the Object-Relational Mapping(ORM) simplifying database interactions and adhering to the DRY(Don't Repeat Yourself) principle.
Handles URL routing, template rendering, database management. It is tightly coupled with django templates.
What is DjangoREST?
An extension of Django framework specialized for API's. Data is returned in json format, the API standard. It leverages Djangos abilities to facilitate development of scalable, maintainable and secure API's.
It adheres to Django's principles like DRY and strongly emphasize code reusability and modularity.
So really whats the difference?
There really is no difference but instead one only needs to understand what they wish to accomplish.
i) DRF(DjangoREST Framework) offers scalability capabilities for example when your web app becomes popular and now you need an app, it makes it easy to switch over.
With Django one would need to create a whole other back-end and make migrations on the user data. This can be time consuming and resource intensive.
ii) When there is multiple teams, frontend and backend, working on a system, DRF makes it easy.The backend team can work on the backend while the frontend can work with frameworks and utilize axios to hit urls.
iii)If you are looking to create a standard and simple web app, Django offers inbuilt templating languages.When you need to use frontend frameworks like Angular or React then DRF makes it easier to integrate them.
Conclusion
There is no difference between Django and DRF(Django Rest Framework), while one renders templates and the other data in json format. It waters down to the projects specific needs and goals
Although this can be seen as a difference, It is truly only clear that one is an extension of the other and the difference lies in understanding what you want to accomplish.

Further read and references:
Django
Django-Rest-Framework
StackOverflow

drf Article's
30 articles in total
Favicon
Djoser+SimpleJWT
Favicon
AssertionError: 403
Favicon
extra_kwargs arguments
Favicon
To Django or to DjangoREST?
Favicon
Django API | queryset & object, filter() & get()
Favicon
I just tried to compare values between model and serializer
Favicon
Customize Schema with @extend_schema_view
Favicon
Seperate serializers
Favicon
Leveraging Headers for Dynamic Localization in Django
Favicon
Django REST Framework warning: `UnorderedObjectListWarning`
Favicon
DRF create @property decorator in view and use property in serializer
Favicon
why Serializers used for? easy to understand
Favicon
Async API Calls Unleashed: Exploring Django 4 and Django Rest Framework
Favicon
# Comprehensive Security for Class-Based Views in Django Rest Framework
Favicon
HATEOAS Principle - Generating Full Paths for Objects in Django Rest Framework.
Favicon
Instance version control in DRF with Django Reversion
Favicon
Django News #171 - DjangoCon US 2023 Preview
Favicon
How to create thumbnails programmatically in Django
Favicon
Automatically Add Logged In User Under 'created_by' and 'updated_by' to Model in Django Rest Framework
Favicon
how to fix raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
Favicon
CSRF verification failed. Request aborted. in django rest framework
Favicon
CSRF verification failed. Request aborted. in django rest framework
Favicon
How to fix "Must supply api_key"
Favicon
Updating A Many-To-Many Relationship In Django
Favicon
Excluding Fields in Django Rest Framework Serializers
Favicon
JWT Authentication with Django REST Framework - What? Why? How?
Favicon
How to implement Auto Expiring Token in Django Rest Framework
Favicon
Building web applications with Django, Django REST Framework and Nuxt
Favicon
How to use Postman to authenticate to Django Rest Framework
Favicon
Setting Up Django Rest Framework

Featured ones: