Skip to main content

Posts

Showing posts with the label flask

Flask, uWSGI, and NGINX - a saga

I have been creating a web page for my wife. It is a booking site for her business and is written in a combination of jquery, HTML, CSS, CouchDB, and python. For the python side of the house I am using Flask. This micro-framework works well for me and allowed me more freedom than I saw reading about Django. It has taken some time, but the app works well. It can retrieve bookings from CouchDB, display them in a calendar, and accept new bookings from a form on the same page. Jquery handles the calendar display, as well as the AJAX call to populate it. Flask handles the data collection from Couch, the data, and the writing of new data to Couch. For cleanliness, two repositories are used for bookings: one for confirmed bookings and one for requests that have not been reviewed. Another repository provides a client list, but is not accessible from the website. Then came the fun part. To serve a website with Flask, the internal web server is insufficient. You need additional tools. In my...

Project time

My wife is a sports coach. She does this at multiple levels, including personal training. What that means is the need to manage training sessions. So, smart-guy here said "I could probably build you a simple booking app". Well, if I'd been listening harder I probably would have heard the sound of all the things I didn't know about web development about to fall on me. So, let's start at the start. HTML, CSS, and Javascript. Good, good, and meh. But JS is simple enough that me and Stackoverflow can muddle by. So, I think, that's the client side. So what about the backend? Well, I think, I know Python. What about that? I looked at Django and Flask and decided that it's relative simplicity meant Flask was the framework for me. Well, it turned out that it does work for me and the way I think, but suddenly I'm finding that the client/backend split is not clean in the world of Flask. Two weeks later and I have several functions that render the pages...