Skip to content

Python kitchen

Always cooking something nice!

  • contact us

Category: flask

How to implement beautiful notifications in Flask
flask shopyo

How to implement beautiful notifications in Flask

Since you already know how to implement notifications, let’s see how to implement beautiful notifications in Flask. Using boostrap, we…
February 24, 2021 Abdur-Rahmaan Janhangeer
How to implement notification in Flask
shopyo flask

How to implement notification in Flask

Implementing notifications in Flask goes way beyond using flash. You have to add this snippet in your templates: <div id="flashed-messages">…
February 24, 2021 Abdur-Rahmaan Janhangeer
How to prevent the Open Redirect vulnerability with the next parameter in Flask
flask security

How to prevent the Open Redirect vulnerability with the next parameter in Flask

Let’s say someone codes a url like this: http://domain.com/do/something?next=http://domain.com/homepage Now an attacker can craft the url like that: http://domain.com/do/something?next=http://evildomain.com/homepage If…
February 24, 2021 Abdur-Rahmaan Janhangeer
How to define global template variables in Flask
flask

How to define global template variables in Flask

Let’s say you want to have some variables available in all templates by default. There’s how you do it: @app.context_processor…
February 24, 2021February 24, 2021 Abdur-Rahmaan Janhangeer
How to disable csrf protection for particular routes in Flask-wtf
flask

How to disable csrf protection for particular routes in Flask-wtf

Flask-wtf recommends using @csrf.exempt to disable csrf protection for particular routes as in the case of APIs. Now this is…
February 24, 2021 Abdur-Rahmaan Janhangeer
How to use Flask-admin with Flask-login
flask

How to use Flask-admin with Flask-login

Steps: Have a login route accept a next parameter Define your model view and admin index view Register models In…
February 24, 2021 Abdur-Rahmaan Janhangeer
How to correctly use the next parameter in login and logout in Flask
flask shopyo

How to correctly use the next parameter in login and logout in Flask

Here is a sample login and logout route taken from the shopyo web framework. You can learn here how is…
February 24, 2021February 24, 2021 Abdur-Rahmaan Janhangeer
How to run a Flask Linux-only  App on Windows – The AFPy Site
flask

How to run a Flask Linux-only App on Windows – The AFPy Site

There are in the Python world many Flask Linux-only apps. However in many case, with some twerking we can make…
November 9, 2020November 9, 2020 Abdur-Rahmaan Janhangeer
An Advanced Flask App: Shopyo
flask

An Advanced Flask App: Shopyo

Shopyo is an Open Source Flask-based, Python-powered inventory solution and upcoming point of sales. It’s aim is to help small…
February 25, 2020October 14, 2020 Abdur-Rahmaan Janhangeer

Newsletter Signup

WordPress Theme: BlogGrid by TwoPoints.