kkampardi / darkroom

Dango REST API with AngularJS
MIT License
0 stars 0 forks source link

Setup django templates #5

Open kkampardi opened 7 years ago

kkampardi commented 7 years ago
kkampardi commented 7 years ago

Here are some notes on a possible implementation for Django and AngularJS working together:

@otsakir this is related to the front end:

Example: `{% verbatim %}

{{ post.title }}

{{ post.author.username }}

{{ post.body }}

{% endverbatim %}`

To specify Angular controllers and attributes use Django {% block 'attribute' %} tag, like this:

<div class="content" ng-controller="{% block ng_controller %}AppController{% endblock %}">

If we are, for some reason, to use more than one templates for this application we can enclose the {% verbatim %} within the classic Django {% block content %} ... {% endblock %} tag. We're able to route to those temples using both Angular routing or Django URL resolvers.

@otsakir There is a bunch of different solutions regarding Django and Angular integration, that we can checkout. As far as I can see the above seems to be enough simple and clean.