How to setup "Hybrid Architecture" in django ?

Submitted 3 years, 3 months ago
Ticket #374
Views 636
Language/Framework Django
Priority Medium
Status Closed


I was trying to setup a svelte js in django to build an ecommerce website. Then, I found out there are 3 architecture : 

  1. Server-First Architecture :bits of js scattered throughout django templates and static files.
  2. Client-First Architecture: Front end is a single page app that treats Django as an REST API
  3. Hybrid Architecture: It is a combination of both (client and server)-First Architecture.

I choosed Hybrid Architecture because I don`t want to wrestling with CORS or any 3rd party framework  and having disadvantage of not taking advantage of using js tooling.Now the questions are:

  •  How do I setup Hybrid Architecture so that I can use Django Features alongside with Svelte js Features ?
  • Can I setup Single Page App using Hybrid Architecture in Django?
  • Is Single Page App  good for Ecommerce in Django 

Note: I don`t want to use any Django libs such as Django-Svelte etc to setup it . I just want to install and setup with npm  and webpack inside django just like normal setups.

Submitted on Mar 19, 21

Can we connect on this requirement? - Vengat 3 years, 3 months ago

@arun Yes, we can connect on this requirements. I have seen react setup with django in hybrid architecture but I want to setup with svelte.js. - Shrestha7 3 years, 3 months ago

how about next monday? if its not urgent requirement. - Vengat 3 years, 3 months ago

@arun ya sure. - Shrestha7 3 years, 3 months ago

@arun hey, its monday when should we connect? Just let me know alright in this comment. - Shrestha7 3 years, 3 months ago

hey how about today 10 PM PST? - Vengat 3 years, 3 months ago

@arun hi, ya sure . Just let me know how and which platform we connect via? I will be waiting for your reply. - Shrestha7 3 years, 3 months ago

Sorry somehow missed your message how about tomorrow 10 PM PST? I will send out the zoom invite - Vengat 3 years, 3 months ago

@arun Ya sure. - Shrestha7 3 years, 3 months ago

excellent. - Vengat 3 years, 3 months ago

@arun if you are busy you can share the github repo and readme file. I can understand from that. - Shrestha7 3 years, 3 months ago (Edited)

I have scheduled the meeting tomorrow 9 PM PST. - Vengat 3 years, 3 months ago

@arun yaa sure I will be on time. - Shrestha7 3 years, 3 months ago

sent you the meeting invite. will connect in 15 mins. - Vengat 3 years, 3 months ago

Hi Shresta7, is the issue resolved? If yes, Please let us know the best solution that worked for you - revathirv 3 years, 2 months ago

@revathirv Yes issue has been resolved I hope so. Me and my team decided to go with Client-First Architecture by creating Frontend and Backend separately. So, that frontend and backend team can work in ease and for CORS Header we have decided to use django-cors-headers 3.7.0. We have decided to use SPA in login page , Home and some other pages where there is no more data and MPA in products listing pages. - Shrestha7 3 years, 2 months ago

@revathirv , @arun what`s your view on using SPA(Single Page Application) and MPA(Multi-Page Application) in same application like I said in above? - Shrestha7 3 years, 2 months ago
add a comment

1 Answer


Hey, yes absolutely you can build the SPA based ecommerce application, but you may need to address below things,

1. Now days Google can crawl JS but it might still be better to apply some special server side rendering for Google bot .

2. Anchor linking. E-commerce marketeers still have this desire to anchor link to content in a page (Grrrr… its not good practice!). This is harder on a Single Page Application. Not impossible, just not easy.

Submitted 3 years, 3 months ago

Latest Blogs