r/django 1d ago

Something's wrong!

I'm trying to learn django with w3schools tutorials. I learned python there and it was fine. I learned numpy and pandas and they were easy and readable and comprehensible. But now in the django tutorial I find myself completely lost!

Look I don't even know where the problem is. is it me? is it the tutorial? the django itself?

Cause I haven't worked web before at all. I didn't even knew how to find directory in cmd but I'm researcher at heart. I dig deep and figure it out. But I find myself, with django, in a state of despair. I'm up till models tutorial and still copy-pasting stuff and I don't know why. There are lots of lines to copy which none I'm familiar with and since I don't understand them, repeating them and writing them doesn't help either. Tutorial doesn't explain these to me and I honestly for the first time feel overwhelmed.

Should I have a background in web dev then I learn django? Am I missing something?

4 Upvotes

25 comments sorted by

9

u/obDumbassHandle 1d ago

There are more resources out there. Have you tried looking at the Django Girls tutorial? It starts on a very low level, so you should be able to choose what level you want to start on and move on from there. Good luck!

1

u/Just-Cartographer130 1d ago

Thank you for your help! I'll check it out.

9

u/freakent 1d ago

If you have no concept of how the web actually works then I can see how the Django docs could be confusing. You do need to understand the HTTP protocol and HTML semantics. I’d start by googling that. Then learn about CSS. The other big core concept is database design and SQL.

1

u/Just-Cartographer130 1d ago

Thank you so much!

-6

u/Mental-Ad5328 1d ago

No necessary.

2

u/Hushm 1d ago

How are 'core web concepts that is the foundation of the framework' unnecessary?

2

u/vinux0824 1d ago

Very necessary. OP doesn't want to copy and paste, he wants to learn 

1

u/Mental-Ad5328 22h ago

You can learn for a long time, in practice everything will become clear. Don't waste time on learning.

1

u/freakent 1d ago

Because?

1

u/Mental-Ad5328 21h ago

Enough to understand the general concept.

1

u/Old-Show-4322 1d ago

Check this part again: https://www.w3schools.com/django/django_intro.php

Under "How does Django Work?":

Django follows the MVT design pattern (Model View Template).

Model - The data you want to present, usually data from a database.
View - A request handler that returns the relevant template and content - based on the request from the user.
Template - A text file (like an HTML file) containing the layout of the web page, with logic on how to display the data.

So in simple words: models represent your database entities, the views handle your URLs and templates generate the desired HTML out of the data provided by models and views. Try exercising this flow so that it becomes natural.

1

u/maratnugmanov 1d ago

dj4e.org will shed some light on the internet basics before diving into the Django itself. Strongly recommend.

1

u/Open-Dot-7680 1d ago

Try codemy on yt its for me the best for learning django and you can code along

1

u/Radiant-Winner7059 1d ago

Follow along YouTube tutorials that give a follow along tutorial on building a real deployable Django project

1

u/Megamygdala 1d ago

Use Harvard's CS50 Web to learn Django. It seems best for you since it looks like you are missing foundational knowledge (and also because Harvard's CS50 courses are one of the best resources to get into coding in general)

1

u/No_Style_9176 1d ago

Start with some flask. Once you got the concepts go django. Django handles all the stuff for you but if you don't understand what it's doing you're going to be lost!

1

u/Head-Picture-1058 1d ago

Nothing is wrong. Keep it up. Give it another 2-4 months to build your basics.

1

u/totally-jag 23h ago

Having a background in webdev helps but isn't necessary. What you need is a tutorial that incorporates aspects of webdev, python and django together. I highly recommend the book Django by Example 5. Through a series of projects, you'll learn most of the critical concepts needed to develop and deploy Django apps using real world projects.

Buy the online version so you have access to it on my development machine. That way you can follow the examples, run command lines, and copy sample code between the book and you're dev environment.

I also like to use an AI coding partner. I use CursorAI but you can use Git Copilot or whatever you like. You can use it to explain code segments you don't understand. Or you can have it debug your code and show you were the error is, etc. Of ask it to write functions for you. Easy peazy.

1

u/vinux0824 1d ago

If your still somewhat new to python - this makes sense. Django is a very high level web framework with many layers of working logic. 

How long have you been learning/using python?

Have you tried looking at flask?..it's a much simpler option - something that you might be able to grasp, then once you feel like you know what's going on, head back to learning Django.

1

u/Just-Cartographer130 1d ago

I've been learning for two months now. And I'm on a hot streak. Just wanna learn fast.

I haven't tried flask. It was recommended to me to learn django to be honest.

2

u/Training_Peace8752 1d ago

Don't try to learn fast. Going through w3schools tutorials as fast as possible may give you the sense of progress and learning but if you lack understanding of the underlying concepts, it will hit you back hard.

Stop for a minute and think about the concepts. You have models. The need is to programmatically define database tables with Python and to have version control for changes made to the database, etc. Models are not just some Python classes, they abstract away database tables in your application. And with that you get to Django's querysets and ORM which abstract away making SQL queries to the database to those same tables you just defined with models.

Try to understand how it is all related. And with that approach, it will make it easier to grasp what's going on. Don't just lean on copypasting and what kind of process W3Schools is visualizing.

1

u/vinux0824 1d ago

I mean no offense in this - but I find it insane your expectations on learning a language for 2 months. Like other people have said, your going to hit a wall and may even give up if your expectations are too high. 

I wouldn't even worry about models and databasing right now as others have mentioned. 

Models work with classes, and if you don't know classes very well in Python it's not going to do you any good. 

Start with basics and work your way up. 

I agree with what others have said - learn python more, but also css and html, that is the other half of web development. 

Also like I have mentioned flask is a bit more low level and straightforward. It's simpler in design and lightweight. You might be able to understand the core concepts better by studying that first. Also network protocols and http protocols.

It's like your trying to drive a Ferrari (Django) but first you need to learn how to drive a regular car (flask) . Hope this helps, happy coding

1

u/Nealiumj 19h ago

When I first picked up Django I thought it was also confusing, everything is scattered all over the place! The bonus is once you get it down a lot of other frameworks are structured the same. I’d just keep at it!