25 November 2020 Updated 25 November 2020
Setting Flask's SERVER_NAME can give 404 errors if you are using subdomains.
30 September 2020 Updated 30 September 2020
By sharing the code and (optionally) templates we avoid making copies and reduce maintenance time.
25 July 2020 Updated 25 July 2020
Using Pytest fixtures and hooks and Flask test_client we can run tests and manually approve texts.
29 May 2020 Updated 29 May 2020
Use a Jinja icon macro to put icons on your pages and use <symbol> to define icons once and use multiple times on the same page.
12 May 2020 Updated 12 May 2020
By avoiding duplication your code becomes smaller and better maintainable.
26 April 2020 Updated 30 June 2020
Create scripts to automate the conversion. They will save you time and prevent unnecessary errors.
16 April 2020 Updated 16 April 2020
Sometimes you want to block IP addresses immediately. This post describes a method how you can do this.
24 March 2020 Updated 25 March 2020
Using a view class instead of view functions is better because it allows us to share code instead of duplicating and modifying it.
10 March 2020 Updated 11 March 2020
The lifetime of many open source components can be short. Write your own if you want to make sure your software lives on.
29 February 2020 Updated 29 February 2020
You should always check if CSRF protection is working. With Flask this is not obvious.
22 February 2020 Updated 22 February 2020
Returning a rendered form to the client means the client does not need to know much about the form and reduces client side coding.
15 February 2020 Updated 18 February 2020
Adding a WTForms textarea widget looks easy but differences between Linux and Windows cause unexpected problems.
8 February 2020 Updated 16 February 2020
30 January 2020 Updated 30 January 2020
The application context is initialized, pushed and popped, for a first time user things can be confusing. Time to start reading.
24 January 2020 Updated 24 January 2020
By modifying the WTforms RadioField ListWidget and using Bootstrap 4 buttons we can build a nice image picker.
6 January 2020 Updated 9 January 2020
This post describes a method to generate Javascript language files de.js, en.js, etc. and how to add them to your multilanguage Flask app.
27 December 2019 Updated 27 December 2019
Penetration testing is an easy way to check if your site is vulnerable to malicious attacks.
24 November 2019 Updated 24 November 2019
Python kwargs is an easy way to pass data to a function. Using the double asterisk for unpacking we can pass this data to another function.
13 November 2019 Updated 15 November 2019
In this post we discuss several conditions when processing the language in the url, using a default language and using a list of available languages.
18 October 2019 Updated 18 October 2019
The method described requires you can be root, meaning it is not universal but may be sufficient if you are the system administrator.
9 October 2019 Updated 16 October 2019
Using Werkzeug's dispatcher middleware we combine two apps into a larger one with dispatching based on a prefix in the url.
28 September 2019 Updated 11 October 2019
When the page content comes from a database you will want to add a contact form using a tag.
15 September 2019 Updated 15 September 2019
In a multilanguage website with multilanguage slugs we can no longer use <a href="{{ url_for('pages.about') }}">{{ _('About') }}</a>.
14 September 2019 Updated 14 September 2019
Keep the translated title and slug in one place and mark them valid so they can be used even if the remainder of the item is not valid.
29 August 2019 Updated 30 August 2019
Reduce the carbon dioxide (CO2) emissions of your web app using query result caching and template caching.
7 August 2019 Updated 30 August 2019
Not many examples exist for multilanguage Flask. Here we follow the suggestions from the Flask documentation.
29 July 2019 Updated 29 August 2019
Checking timing is another way of looking for errors
26 July 2019 Updated 13 August 2019
Application config must be static, application settings must be dynamic
4 July 2019 Updated 29 August 2019
Let’s burn their deeplearning GPU’s.
13 February 2019 Updated 31 August 2019
ISPConfig is a great hosting control panel but it does not support Python applications out of the box. This post shows how you can do it using Docker.