Keath Milligan

On software development, quality, security and broken racecars

Tag: python

A “shrink-wrap” Python project template and development pattern

Javascript development certainly has its ups and downs, but one of the good things about its ecosystem is the ability to easily share projects and quickly get other developers up and running. With most projects, it is simply a matter of cloning the repo and running “npm install” and you are ready to go without needing anything else pre-installed on your system besides NodeJS/NPM. With python, it’s usually not quite that simple.

Python, LDAP and macOS

The Python LDAP packages (python-ldap and pyldap) mostly work on macOS, but if you try to use some options and APIs, you will run into trouble. For example:

RESTful Flask application quick-start

flask-quickstart

 

With the rise of the single-page application (SPA) web front-ends and mobile apps, the backend of many web applications is a collection of RESTful interfaces that provide JSON data rather than generating HTML. The rendering is up to the client side. While there are some drawbacks to this approach (heavier client, slower initial page loads, etc.), there are also a number of advantages, not the least of which is better separation of concerns since the front-end and back-end code are completely independent of one another.… Read More...

Debugging a Flask 0.11 app in Visual Studio Code

Update July 30, 2017: a new simplified method that works for both Linux/MacOS and Windows with no changes to your Flask project required.

Visual Studio Code with the the Python extension makes for a great Python development environment – especially if you work on blended Python/Javascript web apps. Here’s how to debug a Flask 0.11.x (or later) app without having to add files or modify your project code. See “Solution 2” here for debugging an older version of Flask.

First, be sure you have your virtual environment configured in VSCode (you are using a virtual environment, right?).… Read More...

What’s new in Flask 0.11.x?

It had been a while since I last started a Flask-based project, so I decided to have a look at what’s. new in the current release. Earlier this year, Flask and several other Python web development projects were organized under the Pallets Projects open source community and governance model. Along with the move, Flask 0.11 was released with several improvements and new features.

So what’s new? Flask 0.11.x brings several JSON-related fixes and improvements, making it easier to build apps that primarily provide RESTful JSON APIs.  … Read More...

© 2017 Keath Milligan

Theme by Anders NorenUp ↑