-
Notifications
You must be signed in to change notification settings - Fork 19
Routing urls.py
Kyle J. Roux edited this page Sep 7, 2015
·
2 revisions
To handle routing we use a little tip from Django and we collect our routes for each app in a urls.py file. In this file we will import the apps views, and add them to a group of tuples named routes. Here is an example:
from .views import MainView, SubView
from . import app_blueprint
routes = (
(app_blueprint,),
('/',MainView.as_view('main')),
('/sub',SubView.as_view('sub')),
)Jstacoder jstacoder@gmail.com
Examples