Skip to content

Instantly share code, notes, and snippets.

cuongitl / python-flask-catch-all
Created June 21, 2022 13:16
Python Flask Catch-all route
View python-flask-catch-all
"""It may be useful to have one catch-all view where you handle complex logic yourself based on the path.
This example uses two rules:
- First rule specifically catches
- Second rule catches arbitrary paths with the built-in path converter.
The path converter matches any string (including slashes)."""
@app.route('/', defaults={'u_path': ''})
def catch_all(u_path):
cuongitl / python_flask_nginx_befhind_cloudflare.conf
Created September 15, 2021 09:02
python flask nginx behind cloudflare
View python_flask_nginx_befhind_cloudflare.conf
server {
listen *:80;
client_max_body_size 100M;
proxy_read_timeout 600s;
proxy_buffers 16 4k;
proxy_buffer_size 2k;
location ^~ /.well-known/acme-challenge/ {
cuongitl /
Created July 12, 2021 04:53
Mysql connector with python

First of all you have to start your xamp server

Install Package

pip install mysql-connector-python

Connection Establishment Code