Skip to content
This repository has been archived by the owner on Oct 29, 2018. It is now read-only.

Webpack loader plugin for Django routes

Notifications You must be signed in to change notification settings

CircleUp/django-route-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-route-loader

Webpack loader plugin to hook into Django named routes.

Usage

Install the plugin, no Webpack configuration is necessary.

npm install --save django-route-loader

Define the Django route.

from django.conf.urls import include, url

urlpatterns = [
    url(r'^user/(?P<user_id>\d+)/$', user.views.user_prifile, name='user_profile'),
]

Require the route through the plugin.

var userProfileRoute = require('djang-route!?user_profile');

assert.equal(userProfileRoute({user_id: 1337}), 'user/1337/');

About

Webpack loader plugin for Django routes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published