r/learnpython • • Mar 01 '21

Python is kicking my butt

I’ve been learning python since early December now.. I seemed to become comfortable with the syntax and was gaining confidence quickly!

Then I moved on to Django and was quickly sent a reality check as the difficulty level increased really fast... I went back to python and started learning classes... this also is extremely hard to grasp..

While learning classes I realized I didn’t know for loops.. dictionaries.. len/range() nearly as much as I thought I did... the confidence I so quickly built is now gone.

I know the journey to web dev isn’t going to be easy at all.. I’m not giving up.. just wanted to get this off my chest.. I’m going back to the basics this week. Wish me luck. Have a nice week!

486 Upvotes

118 comments sorted by

View all comments

1

u/doom-goat Mar 01 '21

Many may disagree with this, but if you want to boost your confidence use Flask. It includes less, and would technically be harder to build applications that you can quickly build in Django, but the benefit is that you can easily get a working application together in something like ten lines of code. Great for prototypes, experiments and passion projects. Also jinja2 (part of Flask) is a breeze for templating, or you can just use it to build APIs, and do anything else for the frontend. My current project is a stock trading system built with Flask, it executes trades, consumes multiple APIs for data, and a bunch of other stuff. I'm just using Flask for the prototype, then switching to FastAPI and React, but using a different tool for this stage would make it a lot harder and more time-consuming.

Particularly if you're like me and walls of code you didn't figure out yourself just shut your brain off.

Classes are essentially just collections of variables and functions. There's more to it but starting out just think of it that way.

You will want to learn Django's ORM or SQLAlchemy, eventually, but to start out try making a json file with a bunch of mock data, and make a flask application that serves different pieces of it based on what url you enter. Then you've essentially made an API. This is the sort of thing that boosted my confidence starting out at least.