Need some advice on how to go about building a real time web app.

129 views
Skip to first unread message

Shazwi Suwandi

unread,
Jan 2, 2015, 7:36:40 AM1/2/15
to django...@googlegroups.com
Hi group,

I'd like to get some guidance on how to go about thinking about the structure of the web app I'm trying to build.
From a high level perspective, I'm trying to make a web app that facilitates a small business doing camera rentals. 

To give a use case, if a user makes a rental booking for a customer in the web app, it'll send a notification to the user
who is in charge of packing the items in real-time. I was searching up about real-time Django and I landed onto 
Swampdragon, which led me to learn about Angular.js (I know, I don't have to use Angular for Swampdragon but I was
kinda curious). That then led me to learn how much I can shift items like validation to the client side and leave Django to 
do the rest. 

Some questions I'd like to ask: 
1) Am I adopting the right approach to make the app real time? In this case, using Swampdragon for subscribing to messages etc.
2) Is django-angular an appropriate way to integrate Angular.js with Django? It'd be nice to use a lot of the client side functionalities of Angular.

Curious and a little bit overwhelmed.


Michiel Overtoom

unread,
Jan 2, 2015, 8:30:01 AM1/2/15
to django...@googlegroups.com

Hi,

A little side-note...

> That then led me to learn how much I can shift items like validation to the client side and leave Django to
> do the rest.

Even if you do client side validation, you still have to do it on the server side too, to protect your application from malicious attacks.

Greetings,

--
"You can't actually make computers run faster, you can only make them do less." - RiderOfGiraffes

jonas hagstedt

unread,
Jan 2, 2015, 9:14:00 AM1/2/15
to django...@googlegroups.com
Personally I don't use any library between Angular and Django (so I don't know about django-angular).

I create specific templates for Angular so I don't have to change the {{ and }] syntax (you can also use the {% verbatim %} tag in your templates if you don't want to create individual templates).

If you want to do notifications with SwampDragon there is a blog post about that here: http://wildfish.com/blog/2014/12/09/swampdragon-real-time-django-notifications/ (including desktop notifications from the browser) along with a Github repo with the source code.
You could probably take most of that code and adopt it to your own project.

Shazwi Suwandi

unread,
Jan 2, 2015, 10:12:10 AM1/2/15
to django...@googlegroups.com
Michiel: Ah, that's myopic on my part. Both sides are important. 

Jonas: I see I see. I keep thinking that libraries will make my life a bit easier but maybe what I currently need now does not require the use of them. And are you the author of 
the article? (I'm assuming it's the same Jonas) Thank you so much for this link!! I'll go read it up. 

jonas hagstedt

unread,
Jan 3, 2015, 1:03:14 PM1/3/15
to django...@googlegroups.com
Yes I am the author of that article.

Libraries does make life easier, as long as they are the right libraries for the job.

If you are unfamiliar with Angular I would actually recommend not using it.

*  Angular 2.0 is supposedly not going to be backwards compatible (it actually looks like a totally different framework).
*  As you mentioned, you don't need to use Angular with SwampDragon.
*  It's another layer of complexity.
*  The blog post I linked to pretty much covers the basis for doing real time notifications, and isn't using Angular, so you could more or less just tweak that code and add it to your project.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages