Angular and Django

134 views
Skip to first unread message

zweb

unread,
Jun 21, 2014, 11:03:17 PM6/21/14
to django...@googlegroups.com

I was looking at Angular and looks like it does many of the thing Django Templates does but on the client side.

Are you using Angular with Django? How is the experience? What are the /pros/cons? What are using django for and what are you using angular for?
Is django pretty much a rest framework  with business logic and DB access? (when used with Angular)

Glen Jungels

unread,
Jun 22, 2014, 12:44:10 PM6/22/14
to django...@googlegroups.com

When I am finally able to get django to work, I plan on doing this.  I think the client side processing of Angular will be a nice complement to Django on the back end.

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/54c6aeed-4bd5-4fe9-975f-21defd3481ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Doug Snyder

unread,
Jun 22, 2014, 3:26:29 PM6/22/14
to django...@googlegroups.com
be sure to check out:  django-angular

I'm just starting to use angular and django together.
I plan on using django's integration with Content Delivery Networks to serve static files including the Angular app files
( AngularJS itself can already be served with content delivery just by using  the URL google provides:
but also image files that require fast response time.
Django has nice tools to preprocess static files using the 


Things like 3rd party logins are basically solved and modularized into prepackaged apps:


I also use python libraries that aren't associated with django,
there's really not much that ISN'T written in python these days.
I am able to get nice packages to access Web API.

I'm using GIS data in one of my projects and django makes it really easy with:


which pulls together many ongoing GIS packages all into one simple, extensible interface that fits right into django.
So I guess there's a lot of reasons to use django with Angular, but it depends on what you are trying to do.
Moving stuff to the front end does make the back end less important, but you still need a backend unless you can really
do what you need to with solutions that basically amount to having your Angular app have all the functionality and having
storage in a cloud db.
I've also thought of using Flask, another python web dev platform. Its supposed to be lighter weight than django,
but lighter on functionality and conveniences and an active developer network. If I wasn't using any python awesomeness,
maybe a Flask backend would improve server performance, but everything I'm working on can benefit from django so I 
haven't taken the time to learn Flask.

Hope this helps.
Django and AngularJS are two scoops of webdev icecream with sparkles. Hope you enjoy.

Doug

Doug Snyder

unread,
Jun 22, 2014, 3:30:38 PM6/22/14
to django...@googlegroups.com
compared to other js webapp solutions like Ember or Knockout,
Angular is more powerful but maybe a steaper learning curve.
It lets you get really under the hood and has a unique feature called directives where you're essentially creating html tags to use as widgets.
Its state of the art and Google folks aren't afraid of getting into the pudding.
As people write more and more reuseable directives to share around,
its going to become more and more powerful.

Doug Snyder

unread,
Jun 22, 2014, 3:32:32 PM6/22/14
to django...@googlegroups.com
Angular directives and binding are actually more powerful than Django's templating!

Scot Hacker

unread,
Jun 22, 2014, 3:51:03 PM6/22/14
to django...@googlegroups.com
Angular is really wonderful, and I use it with several Django projects. But the two are agnostic about each other. All Angular needs from the back-end is a solid JSON API to work with and a few core back-end features like handling authentication. Modern JS frameworks like Angular, sadly, make the back-end almost (but not quite) irrelevant. The reason I use Django as the back-end is because Django REST Framework is so freaking fantastic as an API generator. I'm really hoping that once Django 1.7 lands and migrations are in, the dev team will turn its attention to native RESTfulness.

You do lose a lot of Django goodness when adopting a client-side framework though. For example, you can't traverse model relationships however and whenever you want - any data you need in the view needs to be added to the API first. 

This isn't *quite* ready for public consumption yet, but here's something I've been working on - a kit for building hybrid Django + Angular sites:

Phang Mulianto

unread,
Jun 22, 2014, 4:06:04 PM6/22/14
to django-users
Angularjs great for a front end, and it just plain html + javascript. we won't need django templating, just put the angular app in a webserver like nginx to server static files, then use django for the API part with REST service.

The angular html generation should not in django templating, because it will loose the benefit of REST + API application. and you will still need to process the HTML before output to the client / nginx server.

Just let django process the core CRUD function and authentication/authorization, and the presentation give it to Angularjs.

I am use angular if want better user experience with web app, especially with single page app.

Regards,

Mulianto


--
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 http://groups.google.com/group/django-users.

Andrew Farrell

unread,
Jun 22, 2014, 8:47:21 PM6/22/14
to django...@googlegroups.com
Doug, I'm very interested to hear that Angular is more powerful than Ember. After some indecision between Ember and Angular, I decided to start picking up Ember on the advice of a friend that it was the more powerful of the two. Therefore, if you have anything I might read to contradict that, I'd be really interested to learn from it.

Also, Toran Billups, if you are listening to this thread and don't mind a friendly debate,
I recall you had expressed some strong positive opinions about Ember+Django back at the end of January. 
Have you explored Angular and do you have any thoughts about the comparison?


Reply all
Reply to author
Forward
0 new messages