Skip to main content

Posts

Showing posts from April, 2013

AngularJS and Django

Two excellent tools for creating websites are Django and AngularJS , unfortunately they both use the same {{ syntax}} for templates which makes it a bit messy to include both in the same file. This isn't necessarily a bad thing as mixing server and client rendering just sounds like a recipe for a vulnerability. The method that has been working for me is to completely separate any client side templates from server side templates. For example I serve from a static apache instance a file like this: < section id = "search" ng-controller = "MyCtrl" > < input type = "search"   ng-model = "searchTerm"   ng-change = "doSearch()" results = "10"   placeholder = "Search for track to add" autofocus   autocomplete = "off" > < table class = "table" ng-show = "result.tracks" > ...