Pass Django's info to AngularJS

js+django Dec. 19, 2015, 1:03 a.m.

<script>
            angular.module('ResakseApp').factory('AuthUser', function () {
                return {
                    id: "{{ user.id|default:'' }}",
                    username: "{{ user.username|default:'' }}",
                    avatar: "{{ user.forumuser.avatar.crop.30x30 }}"
                }
            });
</script>

Sometimes I use AngularJS in my DjangoApp, and i dont want to make another login page just for angular, so usually I pass down request.user to angular's factory.

Any thoughts?