Orange County Lettings defines its URL routing inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/OpenClassrooms-Student-Center/Python-OC-Lettings-FR/llms.txt
Use this file to discover all available pages before exploring further.
oc_lettings_site/urls.py. All routes are mapped to view functions in views.py.
URL patterns
Route reference
| URL pattern | View function | URL name | Description |
|---|---|---|---|
/ | views.index | index | Home page |
/lettings/ | views.lettings_index | lettings_index | Lists all lettings |
/lettings/<int:letting_id>/ | views.letting | letting | Single letting detail |
/profiles/ | views.profiles_index | profiles_index | Lists all profiles |
/profiles/<str:username>/ | views.profile | profile | Single profile detail |
/admin/ | Django admin | — | Django admin panel |
Path converters
Django’spath() function supports typed URL parameters called path converters:
<int:letting_id>— captures a positive integer from the URL segment and passes it to the view asletting_id. Used in/lettings/<int:letting_id>/.<str:username>— captures any non-empty string (excluding/) and passes it to the view asusername. Used in/profiles/<str:username>/.
Named URLs in templates
Named URL patterns allow templates to generate URLs without hardcoding paths. Django’s{% url %} template tag resolves a named route to its current URL.
Link to the lettings list from any template:
id as an argument:
ROOT_URLCONF is set to oc_lettings_site.urls in settings.py, which tells Django to load this file as the top-level URL configuration for the application.