DEV Community

loading...

What is the difference between path and url in the urls.py in Django

Iulian
Hello, I am studying Python, Django, and Sql, because I want to make a project I have in mind true
・1 min read

Hello, could you please explain me the different between path and url in the urls.py file in the Django project?

Thank you :)

Discussion (5)

Collapse
georgealex22 profile image
Jorge

Until Django 1.11 there was nothing called a path to define app urls. Django 2.0 introduces path as a replacement for URL

Collapse
the_soldier997 profile image
Iulian Author

Thank you very much, now it is very clear.

Collapse
devdrake0 profile image
Si

Did you look at the documentation?

Collapse
int_funk profile image
iFunction • Edited

If you don't mind I'd like to address this question as it is my most hated response on development forums. But basically, Documentation is not written for beginners and newbies, it is written for seasoned developers that understand the principles of programming. I've been dabbling in Python3 since 2011 and now, 8 years later, I now use the documentation, but up until now, it's been pointless, hours of trawling through documentation that makes no sense especially if you suffer from dyslexia like me.

My question here would be why would you tell any newbie to read the docs? Why would you log in and post when you could just think it and not ruin someones day, because yes, being told to read the docs is basically being told, "If you're too stupid to work it out then you shouldn't be trying to do it, because I'm not going to help you unless you are crying".

Please don't tell people to read the docs if it's blatantly obvious that they are new to programming, either give them a bit of help, or point them to a tutorial or something where they can get the answer and learn, but if you really want to get them looking at the docs, then find that part and send a link to it. As a by the by, whilst django documentation is better than most, there is much of it that's missing or almost impossible to find, and there is some of it that is bound to be out of date. As newbies we just want a little bit of help and if you don't want to give it, that's fine, just don't comment, but don't add insult to what is possibly causing a psychological meltdown for someone.

Basically " Read the docs" is something you should only say to someone that would never have asked the question in the first place.

Collapse
devdrake0 profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Si • Edited

Firstly, I think you need to calm yourself down. Did you wake up in a butt hurt mood, or did you go looking for something to be offended by?

Secondly, I asked a question. Has the Op read the documentation, perhaps not and it gave the answer, perhaps yes and there's something specific they didn't understand.

Don't make assumptions about my answer, ask for clarification if you need it.

Also, "documentation isn't for beginners" is a bull shit comment. Documentation is for everyone.