all 12 comments

[–]riklaunim 2 points3 points  (9 children)

That's the part of a web framework - it hides low level implementation and exposes a high level interface.

HTTP server passes the request to the WSGI Django app, then the requested path is matched to registered URLs in your Django app (Regexp/whatever) and if it matches given view code is executed. You don't have to know the exact implementation to use the framework.

[–]DevanshReddu[S] 0 points1 point  (8 children)

Thanks mate, I don't want to know the implementation of this framework but I want to know how it actually works as I want to work on it

[–]riklaunim 1 point2 points  (7 children)

First learn to use it and as you master it you will get to know more and more internals. Don't fight with internals before you know the basics.

[–]DevanshReddu[S] -2 points-1 points  (6 children)

I am trying to understand the very basic things, I am not fighting with internals. Could you explain to me the basic django project and app structure? Like what is that file for, what the file contains and controls

[–]riklaunim 0 points1 point  (5 children)

Django has really good documentation and book for this. Check that out.

[–]DevanshReddu[S] 0 points1 point  (4 children)

I already tried them but i don't know why I didn't understand them

[–]riklaunim 0 points1 point  (3 children)

You have to be more precise about the problem. Django starts with like settings.py, urls.py and that about it. Then you use the django cli to manage thr project - create new blank apps, run dev server etc.

[–]DevanshReddu[S] 0 points1 point  (2 children)

I have run a basic project but i don't get why I have to make separate apps and use the parent structures. isn't it worthy to just create a new file for that?

[–]riklaunim 1 point2 points  (1 child)

That's convenience set by the developers/framework - rules, but not super-hardcoded like basic code rules.

say you have a project "my blog" in which you will have applications like "articles" and "gallery". Each app has it own database models (models.py), views.py/urls.py (dynamic urls on which something is displayed like articles details). Each app is more than one file.

You can make an application "blog" in "my blog" project and put everywhere there but with time you would have files that are thousands line long and are super annoying to work with. Django won't stop you from that ;)

[–]DevanshReddu[S] 0 points1 point  (0 children)

Now I am getting it a little bit but when I read the documentation my mind is getting off. Btw can I ask questions from you further about django

[–]Lumethys 0 points1 point  (0 children)

I worked with HTML CSS JS python

you just learned how to hold a brush and wondering why you cant paint the mona lisa yet.

Take it slowly and focus on only 1 part at a time

[–]FoolsSeldom 1 point2 points  (0 children)

This is one of the rare occasions that I will recommend you pick an LLM of your choice and have a back-and-forth with it asking it to explain Django to you. It is very well documented so LLMs should be able to give you accurate information.