2018-02-16T22:25:45Z

The New Way To Generate Secure Tokens in Python

Authentication Tokens

When working with web applications, it is often necessary to generate passwords, tokens or API keys, to be assigned to clients to use as authentication. While there are many sophisticated ways to generate these, in many cases it is perfectly adequate to use sufficiently long and random sequences of characters. The problem is that if you are doing this in Python, there is more than one way to generate random strings, and it isn't always clear which way is the best and most secure.

You would think that adding yet one more method to generate random strings would confuse things even more, but unlike all the other options, the new secrets module introduced in Python 3.6 is actually designed for this specific use case, so from my part it is a welcome addition to the Python standard library. In this short article I'm going to give you an overview of this new module.

1 comment

2018-02-13T15:36:23Z

The Flask Mega-Tutorial Part XI: Facelift

This is the eleventh installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to replace the basic HTML templates with a new set that is based on the Bootstrap user interface framework.

22 comments

2018-02-06T15:11:28Z

The Flask Mega-Tutorial Part X: Email Support

This is the tenth installment of the Flask Mega-Tutorial series, in which I'm going to tell you how your application can send emails to your users, and how to build a password recovery feature on top of the email support.

27 comments

2018-01-30T18:07:32Z

The Flask Mega-Tutorial Part IX: Pagination

This is the ninth installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to paginate lists of database entries.

17 comments

2018-01-23T20:01:33Z

The Flask Mega-Tutorial Part VIII: Followers

This is the eighth installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to implement a "followers" feature similar to that of Twitter and other social networks.

47 comments

2018-01-16T20:22:10Z

The Flask Mega-Tutorial Part VII: Error Handling

This is the seventh installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to do error handling in a Flask application.

29 comments

2018-01-09T17:32:42Z

The Flask Mega-Tutorial Part VI: Profile Page and Avatars

This is the sixth installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to create the user profile page.

39 comments

2018-01-02T17:20:33Z

The Flask Mega-Tutorial Part V: User Logins

This is the fifth installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to create a user login subsystem.

82 comments

2017-12-26T19:34:07Z

The Flask Mega-Tutorial Part IV: Database

This is the fourth installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to work with databases.

122 comments

2017-12-19T19:08:21Z

The Flask Mega-Tutorial Part III: Web Forms

This is the third installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to work with web forms.

76 comments