Form Validation With Flask-Meld

Posted on Fri 18 December 2020 in flask-meld • Tagged with python, Flask-Meld, Flask-WTF, Flask, WTforms, Meld

Real-time form validation with Flask-Meld  

Flask-Meld now integrates with Flask-WTF to handle form validation.

What's the big deal? Real-time form validation without writing any Javascript!

Flask-Meld form validation

Of course I wouldn't leave you hanging without a way to try it yourself! Here's a link to the demo

Building your form

While you …


Continue reading

Flask-Meld, ditch JavaScript frameworks for pure Python joy!

Posted on Fri 04 December 2020 in flask-meld • Tagged with python, Flask, Flask-Meld, Meld

Introducing a new way to build web applications: Flask-Meld  

Flask-Meld demo

Try the demo yourself

Before we dive in, I would like to give credit where credit is due. This extension was heavily inspired by the following projects and people:


Continue reading

OAuth with Digital Ocean and Flask

Posted on Tue 03 November 2020 in conveyor • Tagged with python, conveyor, flask

The OAuth flow can be confusing the first time you do it. This article and example project should help you feel more comfortable specifically for people who would like to use OAuth with Digital Ocean.

The code for this application can be found at https://github.com/mikeabrahamsen/flask-digitalocean-oauth-example

Conveyor …


Continue reading

How to structure Flask applications part 2 - Growing up

Posted on Fri 16 October 2020 in python • Tagged with python, flask, webdev

My first introduction to Flask was Miguel Grinberg's original Flask Megatutorial. After using Django as my framework of choice for several years. Miguel's simple use of Flask allowed me to see just far enough under the hood that I started understanding much more of the web stack, hidden in some …


Continue reading

How to structure Flask applications part 1 - Small Apps

Posted on Fri 02 October 2020 in python • Tagged with python, flask, webdev

One of the benefits of using Flask is it is straightforward to get an application up and running. When you are first starting, you can create your application with a single file. The structure of the application is left entirely up to the developer.

Starting with a single file application …


Continue reading

Building Dynamic Web Applications with Python primer

Posted on Fri 18 September 2020 in python • Tagged with python

If you are a full-stack developer, whether you like it or not, you are going to use Javascript. It's an incredible language that allows developers to create dynamic applications. The amount of Javascript you use is up to you. Javascript can be used to power an entire application or it …


Continue reading

Adding reCAPTCHA to a Flask site

Posted on Sat 20 June 2020 in dev-journal • Tagged with developer journal, flask, conveyor, python

This post will explain how to add Google reCAPTCHA to a Python Flask application using Flask-WTF.

The first thing you will need to do is get your SITE KEY and your SECRET KEY from Google reCAPTCHA Make sure to create a reCAPTCHA version 2 site. Version 3 takes much more …


Continue reading

Helping Python Developers Deploy Applications

Posted on Wed 27 May 2020 in dev-journal • Tagged with conveyor, python, deployments

The goal with Conveyor is to help Python developers deploy their code.

To help serve this mission, Conveyor.dev is going to allow Flask developers to deploy an api or application to a Linode or Digital Ocean server without the need for a subscription.

Allowing users in without a subscription …


Continue reading

Gemini Trading Script

Posted on Mon 11 May 2020 in dev-journal • Tagged with developer journal, crypto, python, api

Created a short script today to make trades on the gemini platform. Simple, not DRY, and it works. One improvement I will probably make the next time I use this is to change the buy function to accept units of a currency other than dollar.

import requests
import json
import …

Continue reading

The pythonic way to deploy applications

Posted on Wed 06 May 2020 in conveyor • Tagged with conveyor, deployments, linux, python, flask, django

Pythonic - an idiom used for the python programming language that encourages code readability while striving for an optimal solution to a problem.

This idiom drove a lot of decisions when building conveyor.dev

To try to make a simple solution that works for most applications.

No container orchestration, no docker …


Continue reading

Developer Journal: 15 April 2020

Posted on Wed 15 April 2020 in dev-journal • Tagged with developer journal, python, redis

Spent some time today trying to use Redis as a way to store a python dictionary. Given my lack of understanding of Redis, I struggled with how to do this and ended up just making a new key with the new value I wanted to store.

So now while the …


Continue reading

Getting started with Conveyor

Posted on Mon 30 March 2020 in conveyor • Tagged with python, flask, django, deployments

Before you start

Before you get started with Conveyor you will need the following:

  • A domain name
  • A Github account
  • Digital Ocean or Linode account

Create a Conveyor.dev account

To get started you will need to create an account on Conveyor.dev

When you log in for the first …


Continue reading

Enforcing login on all Flask blueprint routes

Posted on Wed 26 February 2020 in posts • Tagged with python, flask

I found this tip on the Flask subreddit, such a simple solution to make sure you don't forget to add a @login_rquired to a route. You can enforce user login with Flask-Login by using the @before_request decorator.

@bp.before_request
@login_required
def handle_route_permissions():
    # just used to enforce login required on all …

Continue reading

Github apps: Securing webhooks with Python in Flask

Posted on Wed 15 January 2020 in github apps • Tagged with python, flask, github, conveyor, webdev, webhooks

Once you have your Github webhooks working you will want to add a bit of security to make sure that the requests are actually coming from Github. One way to do this is to verify the signature Github sends matches the digest of the message.

Here is an example of …


Continue reading

Github apps: Receiving webhooks with Flask

Posted on Tue 14 January 2020 in github apps • Tagged with python, flask, github, conveyor, webdev, webhooks

Once you have your Github app created you can start receiving webhooks when events occur.

If you want to test this locally you can use an ngrok.io address to route the request to your local computer. Instructions on how to do that can be found at https://developer.github …


Continue reading

Github apps: Creating and installing an app with Flask

Posted on Sat 21 September 2019 in github apps • Tagged with python, flask, github, conveyor, webdev, webhooks

Create a Github app to integrate with Github

demo

Using a Github app is the preferred way integrate with Github. By creating a Github app you can give your users more granular control of what you have access to. By transitioning Conveyor.dev to use a Github app the level of …


Continue reading

Create a navigation sidebar with flask

Posted on Wed 28 August 2019 in flask • Tagged with python, flask, sidebar, conveyor, webdev

Sometimes pages grow to a point that the need a little help in order to keep it intuitive for the user. I want to share one way that I have been able to keep pages organized and intuitive to the user by using a sidebar with Flask. No javascript involved …


Continue reading

Conveyor Early Access now open

Posted on Wed 21 August 2019 in conveyor • Tagged with python, conveyor

Conveyor.dev early access

Early access to Conveyor is now available.

Visit conveyor.dev to apply.

Conveyor simplifies deployments and lets you focus on building applications

Automatic server provisioning

Site management and deployment

Create PostgreSQL and MySQL databases

Manage your application workers


Pelican static site on Netlify

Posted on Tue 14 May 2019 in python • Tagged with python, pelican, static, netlify

Setup the project

$ mkdir pelican-netlify-cms && cd $_

# create and activate a virtual environment for your project, for example:
$ python -m venv venv
$ source venv/bin/activate

Create a requirements.txt file. This is important as Netlify will look for this file to determine dependencies. In the file:

pelican …

Continue reading

South migration - table already exists

Posted on Tue 24 September 2013 in Python • Tagged with python, django, south

I was recently adding a slug field to a model in a Django application when I ran into this error when doing the South migration:

Error in migration: test_app:0002_auto__add_field_category_slug
DatabaseError: table "_south_new_test_app_category" already exists

When South makes changes to an existing table, it creates a new table with a …


Continue reading