Skip to content

Instantly share code, notes, and snippets.

@debuggerpk
Created September 19, 2014 15:08
Show Gist options
  • Select an option

  • Save debuggerpk/e7e2246043f0d918e9d9 to your computer and use it in GitHub Desktop.

Select an option

Save debuggerpk/e7e2246043f0d918e9d9 to your computer and use it in GitHub Desktop.
Dynamic partials loading with django and angular
# urls.py
url(r'partials/(?P<template_name>.+\.html?$)', PartialView.as_view()),
# views.py
class PartialView(TemplateView):
def get_template_names(self):
template_name = 'partials/' + self.kwargs['template_name']
return [template_name]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment