python | Unsorted

Telegram-канал python - Python

135201

You will be muted until you read the rules. Read them! @Rules_for_Python A group about the Python programming language. Offtopic things go here: @pythonofftopic Resources to learn python: @pythonres Group for Hy: @hylang Selenium: @SeleniumPython

Subscribe to a channel

Python

actually you teached me all the DDD and python stuff from 0 stage, so you understand those concept of how the reality the structer i will follow, thats why before complete my code i wanted to know if that was doing correctly or this how to make the real production code . i am really trying to solve the all code in my repo with proper ddd, and i am trying to make code like you do so that one day you will hire me for your repo

Читать полностью…

Python

I’m trying to follow the DDD (Domain-Driven Design) pattern properly, but I’m still a little confused about one part only 😢.

see pls In Python When we follow to use the DDD structer to keep different database User logically separte, we need to convert one class to another.
Example: in my sql database User TAble has 30+ columns, but real business logic case it need only id_, email, password_hash this 3 thing for login implementation part.
Now i need to convert the UserModel to UserFlaskLoginClass (maybe any other class name having very few needy parameter using the @dataclass), as flask_login need a differnt class which need to inherit from UserMixin to have 4 propery and method availabe.
So i need to convert my database's table user to UserOfFlaskLogin class, in this case what do you say about should i convert from class to class using Pydantic's baseModel will be justified in real production.
As i listen pydantic class i can easily convert one into another, will it ok to use pydantic class for htis i need to use pydantic in presentation layer and also in the sqlalchemy layer will this justified and not breaks any rule???

Читать полностью…

Python

This is not a Python specific question, please delete your offtopic message, move to @PythonOfftopic and ask there.

Читать полностью…

Python

Thats not how that works

https://flask.palletsprojects.com/en/stable/testing/

Читать полностью…

Python

You learn them in parallel
Testing your software is as important as building it.

Testing helps you make informed decisions and make sure you dont brake something that works.

That being said, its not about Pytest or any other testing framework.
Its about testing itself which you need to learn and realize.

There are also diffrent kind of tests (unit tests, integration tests, end to end tests)
They all do testing, just on a diffrent scope.

So go start learning how testing software actually looks like, then you can start writing your own tests

Читать полностью…

Python

Search online for "decode Flask session cookie". It's a handy script to have around for Flask development work.

Читать полностью…

Python

so u means any frontend user sitting on the browser side, can get the to know the original string or key value pair written on the cookie without knowing my flask's secret key, but he can't modify this value without knowing the secret key!!!
is this what u means he xan see original things but can't modify, there why not to keep otp in session cookie

Читать полностью…

Python

Okay, it looks like, on user registration, you email them an OTP, then expect them to get it from the email and enter it on the website. In that case, you can't store it in the session cookie because, as I said above, the user can see the contents of the cookie and hence read the OTP from there instead of from the email.

Читать полностью…

Python

Flask signs its session cookie using the secret key, so it can tell if it has been tampered with. You don't need to reimplement this. The session cookie is not encrypted, so the user can see the contents (with a simple Python script to decode it), but they can't change the value without knowing the secret key and have the server accept the cookie.

Читать полностью…

Python

Hello i have started using the flask_login and by the some of the docs i found it say when i will use flask_login library, they say the behind the idea of login the user and later request to check if user is login alreay or not is to keep a user_id in the session of the user as a cookie in the browser storage, and later request my flask will get the id and retrieve the user object and by this it will know what the user is what his credential is.
So basic idea i will use a secret_key and store the user_id =str value in encrypted way in the browser, so that even the user try to change the cookie value by himself my flask will know that he try to modefy this so it will not valid to another user, right this concept is working like this?
i think yes what i need a confirmation if this is right ?

Читать полностью…

Python

docs.python.org
check some courses.

Читать полностью…

Python

https://codeberg.org/Ingwerperium/Ingwerperium/src/branch/main/Python_Lernplan_100_Projekte_en.text Looking for a Random Python Task Generator?

Читать полностью…

Python

Does I can access my gmail using python

Читать полностью…

Python

Hello,
Data science,
Could you specify more

Читать полностью…

Python

Anyone with link for python documentation?

Читать полностью…

Python

No, you dont need a special class for flask login
And you dont need to use UserMixin, just implement the functions iz needs from the docs

DDD does not mean you need a class for every thing in your code
Its the separating things into their own domains which is the point

So your store code does not mix with your users code.

So your payment logic is not intermixed with users and store

And please stop tagging me.
When you have a REAL question regarding actuall code, come back

Читать полностью…

Python

Check out @PythonRes, a channel for Python resources - video courses, pdf books, tutorials and other info to help you learn Python.

Читать полностью…

Python

Hey everyone. I started doing leetcode in python, could anyone find me a resource where I can get a quick recap of python and its functions that can help me do DSA?

Читать полностью…

Python

what are like this,
as i think i make one login mechanism and otp then i think for testin , i will serve my app in local and then there iw ill open the url and see all looks as i want and then also i will try to give wrong otp, correct otp, multple time i will submit and see if i am getting what i needed like this and then i think my app is ready to test on this new things i have implimentated.
this upper is what i know and learnt, what another test you means or how this come in a website i am making in flask

Читать полностью…

Python

Guys I want to know yours opinion now, as i go to make web app with flask i found pytest is a very must needy things what do you say, should we start learning pytest before flask or how i want to make a real python ecommerce app. what is ur opinion based on flask vs pytest???

Читать полностью…

Python

Thanks for clearify this, from now i will never think to use cookie like this what i thoght in past. you have change a lot of my thinking of web dev matters.

Читать полностью…

Python

Thanks for clear my confusion.
What i understand is suppose user_id is :- 1938292
so in th3 cookie it get saved as a random string like the id:- "yeiekndjsiiekwpsmnsmepw", you means any user who can see the upper random string, he can generate or see 1938292, i thought they cannot know what is written there,
so now i fully understand that i should to make a mechanism to store the otp in the backend not in cookie, as far as i understand any user maybe pro hacker type user can see what is stored in the cookie but can't change this... 😋

Читать полностью…

Python

What are you trying to achieve with the OTP?

Читать полностью…

Python

and then i listen that not keep private sensitivity data into the cookie of the user, like user request for register, and after he enter the email id, i send the otp and i need store the otp value in redis, but what would i store this in the session cookie, as they say not to store sensitivity data like otp there, so i am confused here in this scenerio, if keeping storing the user_id in the sesion is secure so why not keep session[otp_valid_for_10_minut] = 12221 liek this is so bad?
i have this problem anyone know this pls say what i should to do there

storing otp in session rather in redis is really critical, as my main login string of user_id is in the sesion coookie, why this is not bad tehre

Читать полностью…

Python

https://pythonbooks.org/free-books/

Читать полностью…

Python

I am a student of bca first of all wht should learn in python anyone help by sharing any lessons or document

Читать полностью…

Python

access means seeing all old email or sending email, i knew sending email using smtplib '

Читать полностью…

Python

More a topic for @pythonofftopic. When you post there, please remove your post from here.

Читать полностью…

Python

hi every one
I am working on Python for Data Science and am looking for a partner to help me along the way and study together.

Читать полностью…

Python

Read this please:
http://www.catb.org/~esr/faqs/smart-questions.html

Читать полностью…
Subscribe to a channel