Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Django " [ was not closed " error in url routing

I’m new to python. Trying to understand and following the tutorials. One of the many tutorials that I follow, in django for url routing we are creating url.py and put our routing logic inside that file as below:

urlpatterns = [
    path=("",views.index),
    path=("/index",views.index)    
]

In every tutorial that syntax is working. But in my example it throws an error as below:
enter image description here

I did not understand why it is showing me error and not for others.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Also I have tried so assign path method into a variable and after that It worked.
enter image description here

Am I missing syntax rule or someting?

>Solution :

you dont need = here

urlpatterns = [
    path=("",views.index),
    path=("/index",views.index)    
]

it should be

urlpatterns = [
    path("",views.index),
    path("/index",views.index)    
]
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading