November 2015
Beginner to intermediate
840 pages
26h 30m
English
urls.pyIf you open the /organizer/urls.py file, you’ll discover that our urlpatterns list is quite long. What’s more, we’re defining the prefix to many of the URL patterns multiple times: our URL patterns all have regular expression patterns that start with /tag/, /startup/, or /newslink/. That is not desirable.
While Django convention dictates that our app contain all of the URL patterns in a urls.py file, there is absolutely no reason to adhere to this convention if breaking from convention makes our code cleaner. In this section, we split the urls.py file into several smaller modules, resulting in a url package.
To begin, we need to create a url directory in /organizer/and then create a file called --init--.py in ...
Read now
Unlock full access