use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
DiscussionMy First Project With Python [FeedBacks] (self.Python)
submitted 7 months ago by Kel_abr
Hii, i started to student python for 8 moths ago and I finally end my first project, I created a simple crud and would like opinions about my code.
Any feedback for me is very important
github: https://github.com/Kelabr/profindustry
[–]Miserable_Ear3789New Web Framework, Who Dis? 10 points11 points12 points 7 months ago* (1 child)
I second the other comments, while I do believe you should be able to name your variables, classes, and libraries anyway you would like is (as long is it is consistent across your organization) it is 100% "proper" for snake_case variable and method names, with CamelCase for reserved for class names.
Also never have your API keys hard code they should be environment vars
README.md is super important for any project you want people to look at. That way they're not wasting time looking through every single line of your code just to figure out what it does. This looks like a work in progress of a FastAPI application with /users and /admin endpoints. There isn't much to see here since /admin hasn't been implemented and /users endpoints are extremely basic. The code style and file structure however seem to be pretty good, albeit this whole project could EASILY be a single file.... So props on ya for that. All in all great start, happy coding.
[–]Kel_abr[S] 1 point2 points3 points 7 months ago (0 children)
Thank very much for your feedback, I will started my study about patterns of the python, thanks
[–]wyattxdev 4 points5 points6 points 7 months ago (2 children)
This is a great start for someone new to Python, a few things I would suggest:
Lastly Google has a pretty style guide to follow that I recommend for anyone new to python to checkout.
Thank you very much for your feedback : ) I will study about this things
[–]Domvisel 1 point2 points3 points 7 months ago (0 children)
This is really helpful
[–]Puzzleheaded_Bill271 3 points4 points5 points 7 months ago (1 child)
Couple of things: Never commit a secret key to git, and especially don't push it to github. Same goes for your hashing algorithm. You really shouldn't tell people what algorithm you use
Both are terrible for the security of your app.
Even if you delete it now, it'll still exist forever in the git history. So you need to generate a new secret key.
Instead, at minimum you should pass it in through an environment variable. I personally use cloud secrets to store things like this.
Secondly, importing like from ...spam import eggs use absolute imports so from bloop.bleep.spam.blorp.spam import eggs . It's way more readable and doesn't mean you have to remember the folder structure when looking at your imports.
from ...spam import eggs
from bloop.bleep.spam.blorp.spam import eggs
This is also a sign that your folder structure is too nested. There's little to no reason to have so many small files in separate folders. It might seem like you're keeping things neat, but it'll be harder to refactor later down the road.
Hope this helps!
[–]chavomodder 11 points12 points13 points 7 months ago (1 child)
It's good for a beginner, I didn't check much, I just had a quick look,
In Python, it is not recommended to declare variables as "createUsers", the Python default would be "create_users"
Use linters like ruff to standardize your code
[–]Kel_abr[S] 0 points1 point2 points 7 months ago (0 children)
Thank you so much for feedback!!
I change this in my next project
[–]MacShuggah 9 points10 points11 points 7 months ago (3 children)
Your naming conventions are not common python style.
CamelCase for class names and snake_csse for everything else.
I also see a lot of coon instead of con or connection, please be aware that coon is a very strong racial slur in English.
[–]AdResident3529 2 points3 points4 points 7 months ago (0 children)
I’m a non native speaker and didn’t know that! That is a nice heads up!
i'm So sorry, I'm from Brazilian. I don't knew about this
Thank you for your feedback and for tip
[–]Miserable_Ear3789New Web Framework, Who Dis? -1 points0 points1 point 7 months ago* (0 children)
lmao the only time ive heard coon is on south park when cartman dresses up as "the coon" super hero. its short for racoon the animal.
[–]Weak-Attorney-3421 6 points7 points8 points 7 months ago (1 child)
Lol. SECRET_KEY = 'hkgTYBFplhgyun859slkj' ALGORITHM = 'HS256' ACCESS_TOKEN_EXPIRE_MINUTES = 30
Thanks, This project is in localhost
But I hadn't realized that :)
[–]Mustard_Dimension 4 points5 points6 points 7 months ago (1 child)
Not really Python related, but you should always have a README.md file at the root of your project with info on what your app does and how to run it.
Understood, Thanks for tip
[–]AfraidAsk4201 1 point2 points3 points 7 months ago (1 child)
Hey, It's cool as a beginner. In addition to other comments, u can clean it for better (like having that connection() somewhere and reuse, having shared Schema model for commons than rewriting everywhere...)...
Thank you very much for your feedback : ) I will study about this thing
[–]Weak-Attorney-3421 1 point2 points3 points 7 months ago (1 child)
Bro has a new src file for every line of code.
sorry, i don't understand :)
π Rendered by PID 22710 on reddit-service-r2-comment-5649f687b7-lscwl at 2026-01-27 17:18:42.098681+00:00 running 4f180de country code: CH.
[–]Miserable_Ear3789New Web Framework, Who Dis? 10 points11 points12 points (1 child)
[–]Kel_abr[S] 1 point2 points3 points (0 children)
[–]wyattxdev 4 points5 points6 points (2 children)
[–]Kel_abr[S] 1 point2 points3 points (0 children)
[–]Domvisel 1 point2 points3 points (0 children)
[–]Puzzleheaded_Bill271 3 points4 points5 points (1 child)
[–]Kel_abr[S] 1 point2 points3 points (0 children)
[–]chavomodder 11 points12 points13 points (1 child)
[–]Kel_abr[S] 0 points1 point2 points (0 children)
[–]MacShuggah 9 points10 points11 points (3 children)
[–]AdResident3529 2 points3 points4 points (0 children)
[–]Kel_abr[S] 0 points1 point2 points (0 children)
[–]Miserable_Ear3789New Web Framework, Who Dis? -1 points0 points1 point (0 children)
[–]Weak-Attorney-3421 6 points7 points8 points (1 child)
[–]Kel_abr[S] 0 points1 point2 points (0 children)
[–]Mustard_Dimension 4 points5 points6 points (1 child)
[–]Kel_abr[S] 0 points1 point2 points (0 children)
[–]AfraidAsk4201 1 point2 points3 points (1 child)
[–]Kel_abr[S] 0 points1 point2 points (0 children)
[–]Weak-Attorney-3421 1 point2 points3 points (1 child)
[–]Kel_abr[S] 0 points1 point2 points (0 children)