Django - So we would add the following to the project’s urls.py
- from django.conf.urls import include
- urlpatterns = [ ... url(r’^first_app/’,include(‘first_app.urls’)), ...]
Django - This would allow us to look for any url that has the pattern:
- www.domainname.com/first_app/…
- If we match that pattern, the include() function basically tells Django to go look at the urls.py file inside of first_app folder
Django Django - Let’s quickly walk through an example of all of this to show how it works!
- Quick note: We’ve covered everything in Part 1 of Django’s Official Tutorial, so after this lecture you may want to go visit Part One and browse through it!
Do'stlaringiz bilan baham: |