Python Flask From Scratch [Part 3] - Login & Access Control

preview_player
Показать описание
In this video we will program the login functionality in our Flask app and add some access control

CODE: Code for this video

Python Crash Course:

SUPPORT: We spend massive amounts of time creating these free videos, please donate to show your support:

FOLLOW TRAVERSY MEDIA:
Рекомендации по теме
Комментарии
Автор

Great tutorial, Thank you Brad, what I liked the most that you have enough courage to say "I don't know" when you have to, this is very rare.

JafarJabr
Автор

10:43 was gold! XD

Thanks for the video Brad! I'm glad you kept in the small mistakes as otherwise it's not a realistic development process.

DMoots
Автор

Regarding 23:58: *args allows you to pass a variable number of arguments, whereas **kwargs allows you to pass keyworded variable length argument list eg. func(a=2, b=3), that is what 2 stars preceding kwargs stand for(key value pairs) So func(*args, **kwargs) basically stands for: "pass anything into this function".
Great tutorial by the way sir!

arpanagarwal
Автор

With the wrapper function, the *args allows for the passing of tuples into the wrapper, and the **kwargs allows for the passing of dictionaries into the wrapper. Basically, the way the wrapper works is you pass the session dictionary (in this case), into the function through the kwargs var.

draakisback
Автор

great mini series, helped a lot with a project i'm working on. btw *args is for passing a variable amount of arguments to a function and **kwargs is passing variable amounts of keyword arguments. mainly useful when u are gonna have a undetermined about of variables being passed to ur function.

anyways great work! very helpful.

bjhazelwood
Автор

*Usage of *args:*
*args and **kwargs are mostly used in function definitions. *args and **kwargs allow you to pass a variable number of arguments to a function. What does variable mean here is that you do not know before hand that how many arguments can be passed to your function by the user so in this case you use these two keywords. *args is used to send a non-keyworded variable length argument list to the function.

*Usage of **kwargs*
**kwargs allows you to pass keyworded variable length of arguments to a function. You should use **kwargs if you want to handle Key Word named arguments in Dictionaries in a function.

divusiulius
Автор

*args is a placeholder that allows positional arguments (arguments whose use in the function depends on the order in which they are presented) to be passed through to other functions. **kwargs works the same, but for args which are defined by a keyword (like 'render(article=articles[0], user=user)') and are as such position independent. Much like this binding in js (or =>) these overcome issues of variable scope.

**disclaimer- I'm not an expert by any means on decorators.

porcupine
Автор

Hello, as I understand from Corey Schaffer, *args are positional arguments and **kwargs are keyword arguments (like key=>value pairs).

andreiindries
Автор

Thank you for making the videos. It has been very helpful in seeing the big picture of basic front end and back end development.

josephmartinez
Автор

Hello World,

First of all thanks a lot Brad for uploading this video. Its amazing and at the same time it engages the reader.

For all the flask-sql module users instead of flask-sqldb, please call the tuple by the number like password=data[4], it will work. Because there is no option to set cursor class to dictionary in the old model.

Thanks
Aritra

aritrachatterjee
Автор

I feel like I am learning from someone who is very close to me :)

OyaUna
Автор

In case anybody is interested in understanding what python decorators actually do I found there is a brilliant tutorial by Corey Schafer explaining decorators in detail

jfish
Автор

thanks a lot Brad. brilliant tutorial, really helped.

sayonarasun
Автор

Awesome. In 30 minutes all you need =). Thanks.

BOBIKcool
Автор

Thanks a lot for the videos. very realistic, the process, speed and practical logic.

simplepycodes
Автор

Great tutorial, thanks man. I have a question. I think the variable 'msg' in the _messages.html file is doing nothing. I mean, you can change its name for another one, e.g 'success_message' and it's still working, showing successful messages.

sebastiancadena
Автор

thank you Brad, it is very helpful for beginner like me !

Virdevir
Автор

When I try to login "ValueError: expected sha256_crypt hash, got sha256_crypt config string instead". Please help!

mochammadalifpratama
Автор

I don't know wats error in program login is not working for 2 conditions

harshitharaj
Автор

how did you implement access control? Can you please explain?

ajaykumark