Defining Project URLs & App URLs

Main URLs (new_project/urls.py)

Modify the project's urls.py as below:  

  • You may need to modify some of the code like this:

  • The final file may look like this

App URLs (home/urls.py)

  1. Create urls.py in the home app:
     
     
  2. Modify the urls.py file in the app's directory to map the url defined to the appropriate view:

Discussion

13

0