Django’s Place in a Web Development World Ruled by React – InApps is an article under the topic Software Development Many of you are most interested in today !! Today, let’s InApps.net learn Django’s Place in a Web Development World Ruled by React – InApps in today’s post !

Read more about Django’s Place in a Web Development World Ruled by React – InApps at Wikipedia

You can find content about Django’s Place in a Web Development World Ruled by React – InApps from the Wikipedia website

Web development in 2021 is so dominated by JavaScript and its many frontend frameworks, it’s sometimes easy to forget that the traditional server-side web application architecture is not only alive and well — but thriving. 55.3% of Django developers who took the annual StackOverflow survey said they will continue to use it; and 49.3% said the same of Ruby on Rails. Django and Ruby on Rails — two of the leading backend web development frameworks and both open source — have been on the scene since the mid-2000s. They’re no longer the trendy young bucks in web development, but they are still the seventh and 11th most-loved web frameworks respectively.

In a column earlier this year, I discussed how Basecamp — the company that created Ruby on Rails — is adapting to frontend trends with a newly released framework called Hotwire. One of the goals of Hotwire is to reduce the amount of JavaScript code being used, by “sending HTML instead of JSON over the wire.” It’s both a challenge to the JavaScript reliance of leading frontend frameworks like React and Next.js, but also a way for Ruby on Rails to stay relevant.

To find out the Django perspective on our current JavaScript-heavy web landscape, I reached out to one of its co-creators — Simon Willison. Nowadays Willison is focused on his latest project, Datasette, an open source tool he created for exploring and publishing data. But he’s best known for co-creating Django in 2003, as a Python framework to help developers build complex, database-driven websites. At the time Willison and his co-creator Adrian Holovaty were working for a small US newspaper, so the idea was to help the paper’s writers and editors easily put content into a database that would then get published to the website.

 

 

Over the past fifteen or so years, Django has become an integral part of a number of massive-scale internet products, such as Instagram, Pinterest and Spotify. As an Instagram engineer noted in September 2019, “Instagram Server is a Python monolith with several million lines of code and a few thousand Django endpoints.”

What’s less known is that Django is sometimes used alongside the likes of React and Vue, two of the leading frontend frameworks of today. This shouldn’t be a surprise — Instagram clearly uses both Django and React, since the latter is a project run by its parent company Facebook. But judging by a recent Twitter comment by Willison, it’s a common misconception that Django can’t work with JavaScript frontend frameworks.

“The technically correct answer,” Willison told me when I asked him about this, “is that a backend framework like Django works with any frontend framework, because of separation of concerns: if a web framework can respond to HTTP requests with JSON and HTML, it can be used with anything.”

However, he noted there are aspects of the Django/JS framework relationship that confuse people, “especially newer developers.”

“Things like JWT [JSON Web Token] for authentication are a hot topic — core members of the Django project think JWT has a flawed design and have argued against shipping support for it in Django core, leaving it to third-party packages. But lots of developers want to use JWT and have a hard time figuring out how to do it.”

The default solution, he said, is to use the Django REST framework, a toolkit for building Web APIs. This toolkit includes support for JWT. An alternative, which he himself often uses, is to write standard Django views that return JSON.

The case for pairing the two frameworks would be to use React to handle the user interface, fetching data from the Django backend as necessary. For example, this tutorial shows how to build a to-do application, with React making HTTP requests to the Django REST API in order to fetch and set data.

The Problem with Single-Page Applications (SPAs)

Although Django and React can play well together, there’s been a lot of debate in recent years about how far to push the React model of application development. Some think that React has introduced too much complexity into web development and is now overused.

In an influential blog post last May, software engineer Tom MacWright wrote that the “emerging norm for web development is to build a React single-page application, with server rendering.” Server-side rendering (SSR) means to run JavaScript frontend code on the backend, in order to pre-populate an HTML page (which is then sent to the client, where typically further JavaScript code runs to make the page interactive). MacWright says this approach is unnecessary for many use cases, noting that it can produce “messy optimizations” and issues with data fetching.

Read More:   What Goes Inside the Containers Counts – InApps 2022

According to MacWright, data fetching is “really important and really bizarre in React land.” Although he likes GraphQL as a way to fetch data, he says that “for a React component that loads data with fetch from an API, the solutions have only gotten weirder.”

Willison agrees with MacWright about the overuse of SPA.

“In the past 5-10 years,” Willison said, “it seems that new developers have grown up in a world where SPA is the default approach to building pretty much anything. I think it’s a terrible default for many projects.”

As well as being of dubious technical benefit, Willison thinks some SPA projects can drag on for longer than necessary.

“I’ve seen SPA projects take months longer than I would expect the same project to take if it was built with boring old JavaScript-free HTML forms.”

Modern Web Development Shouldn’t Mean Ignoring the Classics

Getting back to Tom MacWright’s article, he (rather unfairly, I think) labeled Django “uncool” and suggested it was “outside the norms of modern web development.” But if you accept his argument that the React single-page application has many problems, then surely a boring old Django web page or app would suffice in many use cases — at least for cases that don’t require a complicated user interface.

But equally, in Django and React we have two frameworks that should be complementary to each other — one is a backend framework, the other is for the frontend. As Simon Willison pointed out, there are relatively simple ways to have a React-built user interface that gets data from a Django backend as needed.

As in many areas of twenty-first century life, sometimes we just over-complicate things in web development.

Feature image via Pixabay.

Source: InApps.net

List of Keywords users find our article on Google:

django jobs
django saas
react fetch
graphql ruby
vue apollo graphql
best spa in hcmc
best spa ho chi minh city district 1
django game development
django ecommerce
python django developers
django order by
django developer jobs
django request
django model to json
apollo graphql vue
ruby on rails tutorial learn web development with rails
next js apollo
web development company
django wikipedia
django many to many
ruled me
django release schedule
django related name
best spa in ho chi minh
one to many relationship django
django send email
django many to one
django request get
django python jobs
graphql vue apollo
spa ho chi minh district 1
ho chi minh spa
spa vietnam ho chi minh
vue graphql apollo
django with react an ecommerce website
react native jwt
django.tours
django model
vue django rest framework
fetch react
next js apollo client
ecommerce with django
python django jobs
apollo client nextjs
django rest framework token authentication
django image
django template
django project
react fetch api
okta graphql
django security
python django developer
website development company
custom application development
messy world.net
django post
okta-react
django in 2022
pinterest okta
stackoverflow teams pricing
range rover pegas
jango instagram
stackoverflow jobs pricing
single page application wikipedia
spa ho chi minh city
django facebook
hotwire packages
pinterest django
wiki django
jwt issue time ahead of current time
what industry is web development linkedin
django value
django whatsapp group
linkedin industry for web development
okta-vue
django many to many set
okta react native
django template if and
json django
spa ho chi minh
stackoverflow architecture
django json
ho chi minh instagram
simon willison
django file upload
django request post
inaweb
jobs django python
post in django
django rest auth jwt
e-commerce django
hire json expert
jwt ruby
request django
django get request
best spa ho chi minh
django e-commerce
django rest framework relationships
spa software email templates
the return of django
apollo client with next js
apollo nextjs
django model fields
django post request
nextjs apollo example
apollo next js
cloud services bucks county
django saas tutorial
django with react | an ecommerce website
django working with forms
order by django
django react ecommerce
django select
jsonfield django
pl 50k keywords
django image upload
django rest framework simple jwt
ho chi minh city spa
jwt jobs
next js module federation
next.js apollo
react django tutorial
vue apollo
web-token/jwt-framework
django forms api
django react admin
django user
javascript django engineer jobs
nextjs with apollo
react admin alternatives
django get example
django latest
django no module named
django request.get
django upload file
javascript django
nextjs jwt
django post request data
instagram backend architecture
next js graphql apollo
rails hotwire
app van simple simon
best spa software 2019
django authentication backend
django related manager
django request.user
django cli
django migrate
django e commerce website
django json to model
graphql with django
hotwire rails
send whatsapp message using django
django devops
django email
django models phone number
jwt react
return of django
spa in hcmc
apollo client ssr
django email backend
django makemigrations
django rest framework jwt
fetch policy apollo
python flaky tests
vue apollo graphql tutorial
Rate this post
Admin
Admin
Content writer

Let’s create the next big thing together!

Coming together is a beginning. Keeping together is progress. Working together is success.

Let’s talk

Let’s Create the Next Big Thing Together!

You can reach us anytime via sales@inapps.net

    You need to enter your email to download

      Success. Downloading...