Flask Testing – Unittest and Coverage

Software 
Flask Testing – Unittest and Coverage I have been experimenting with Flask recently. I am interested in learning about test driven development. This looked like a good opportunity to merge the two together. Test driven development is based around writing tests before you write the code. That way you write the code to pass the test, not the test based on the code. There are a few modules I use to test my flask apps.
Read more →

Django Notes – Part 3

Programming  Tutorials 
API Access to the Notes To give our web application an API we are going to be using the REST framework. For our API to work correctly we need to provide ways for the application to serialize data, that is, convert the database objects into JSON. We will need to create a serializer object for each of the data objects we want to be able to access. Firstly, we need to create the directory structure so go ahead and create the following directories/files inside our notes/ folder:
Read more →

Django Notes – Part 2

Programming  Tutorials 
Securing the Application Now that we can view our notes on the website, we are going to want a login system. Currently anyone can navigate to our website and see all of our notes. Not ideal. To secure our site we will be using a combination of Djangos built-in auth module and crispy forms. First off we will add the auth modules URLs to the project so open up the URLs file in the project directory and add the following.
Read more →

Django Notes – Part 1

Programming  Tutorials 
Creating the Application To start, we will create a virtual environment for our project and install the required libraries mkdir DjangoNotes cd DjangoNotes python3 -m venv venv source venv/bin/activate pip install -r requirements.txt Now that we have our environment setup we can create out Django application. django-admin startproject DjangoNotes python manage.py startapp notes Whilst we are still doing some admin setup, we need to initialise our database and create ourselves a superuser.
Read more →

Flask API Template

Programming 
Flask API Template I often use Flask when I am writing a small web interface for an application. Flask proved to be a very simple easy to use framework and so I decided I would write an API. The end goal is to have a database back-end and a simple interface for retrieving and storing notes. However, this post is just about setting up a template and authentication for the API.
Read more →