Single Page Application in Django

940 views
Skip to first unread message

Simon Gunacker

unread,
Mar 6, 2016, 9:41:10 AM3/6/16
to Django users
Hey everbody,

I am new to django and I try to build a single page application. It consists of different sections (header, portfolio, contact, ...). As far as I understand the django philosophy, each of these sections could be a separate app (having its own model, view and template). But: How do I merge templates? How do I do the URL-routing? Any ideas on how to set this up in a smart way?

thanks, Simon

Avraham Serour

unread,
Mar 7, 2016, 7:04:42 AM3/7/16
to django-users
> As far as I understand the django philosophy,
no, implementing something as a SPA is more of a concern to your frontend, if you use django solely as a backend (say using DRF for example) it won't matter if your client side is an SPA, mobile app or anything else, django will see requests and answer to them.

if you are new to django I strongly recommend doing the tutorial, it will introduce you to the main concepts of django

good luck
Avraham

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/23a71974-6070-4e50-bfa9-39ef741863ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bob Gailer

unread,
Mar 7, 2016, 9:20:35 AM3/7/16
to Django users


On Mar 7, 2016 7:04 AM, "Avraham Serour" <tov...@gmail.com> wrote:
>
>  DRF
I'll bite - what is DRF? Google does not help with that.

Dheerendra Rathor

unread,
Mar 7, 2016, 9:26:05 AM3/7/16
to Django users
Trying googling DRF django or DRF python. Anyway it is Django Rest Framework :-)

acheraime .

unread,
Mar 7, 2016, 9:27:06 AM3/7/16
to django...@googlegroups.com
Django Rest Framework. A powerful framework to build REST API on top of Django.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

For more options, visit https://groups.google.com/d/optout.



--
Adolphe CHER-AIME

nikhil...@gmail.com

unread,
Mar 8, 2016, 5:59:38 AM3/8/16
to Django users
I m not sure if my first post went through or not.

We are also trying to move to SPA using angular.js.
While going to through this app https://github.com/Tivix/django-rest-auth, It seems that we have to use Token authentication on web and mobile. 
Session authentication is not an option. Is it true?

Currently we serve html pages using django session authentication on web. If I use only token authentication then how can I serve html templates?

-Nikhil

nikhil...@gmail.com

unread,
Mar 8, 2016, 5:59:51 AM3/8/16
to Django users
I m also working on SPA with angular.js. One problem I have is regarding authentication. 

We have currently mixture of angular.js and html pages served by django but our new version will be SPA.
Till now our project was using session authentication (web) & token authentication (mobile). 

I was trying to get password related api on REST.While integrating https://github.com/Tivix/django-rest-auth it seems that in SPA we have to use token authentication on web.

If I allow only token authentication on web + mobile then,
Will token authentication allow us to serve partial templates? Our template are currently served by django.


-Nikhil

On Monday, 7 March 2016 19:57:06 UTC+5:30, tizonzon wrote:

Chris Bartos

unread,
Jan 10, 2017, 8:21:31 AM1/10/17
to Django users
Hi,

You don't have to use one or the other. You can use both authentication mechanisms. You would just list each authentication mechanism backend in your settings.py file. So, what would happen is the authentication framework will loop through each of the backends and if one backend fails than it moves on to the next one. I hope that helps.

Chris
Reply all
Reply to author
Forward
0 new messages