August 2016
Beginner to intermediate
717 pages
15h 24m
English
Now that we have created our URL and interpreted by the routing system, we must ensure that a view (which is a controller in the MVC pattern) meets the customer's demand.
This is the function of the second parameter of the URLs present in urls.py. This parameter will define the method that will play the role of a view. Take, for example, our first URL:
url (r'^$', 'TasksManager.views.index.page'),
Firstly, as we have seen when studying regular expressions, this URL will be valid only if we browse the http://localhost:8000 URL. The second parameter in the URL means that in the index.py file, there is a method called page that will process the request. The index.py file is located in the views package at the root of the
Read now
Unlock full access