Okay, this is going to be a brief summary of my first web app – called Elsinore – because that kind of got out of control with all the changes and edits that I made to it. This won’t dive deep into the the code; instead it will function more as an overview.
The purpose of this project was twofold. I wanted to create an accessible shopping list and also a to do list, hosted somewhere that I could add things to them, either via my phone or iPad or other device. Ideally, it should be accessible over the internet, too. Because it might be accessible over the internet, I felt that it should have some kind fo
Getting Started
The first thing that I created as a __init__.py file This created the app, iniitialised the database (using SQLAlchemy), and loaded the login manager. This divided the app into two parts auth and main, depending on whether the user was authorised or not.
Routes
Next I created the main.py file. This file uses the Blueprint from Main (see previous paragraph). It also defines the routes for each of the pages on the app – e.g. the to do list, the shopping list, the profile page and the home page. It also recognises that there are post routes, too, when people add information to different forms in the app. Finally it also uses the decorator @login_required to show which routes require log in.
The auth.py route looks after logging in and user verification. It includes functions for people to log in, sign up and checks against whether the user already exits. there is also a log out function..
Models
The models.py file links the database with the different classes used within the app.
Templates
I created a base.html template, which I used to extend others.
Deployment
The next step was to deploy the app to heroku. This was quite tricky. Mostly, it came down to what I put in the procfile – my app was actually named project, and it existed within a project folder, rather than the examples that were all embedded at root level, and called, rather imaginatively, app.
Problems
Once I had worked through the challenges that I was facing with Heroku, I could deploy the app. On the desktop, everything worked fine, but on mobile devices, the menu bar was not visible. Apparently, this is a known issue with Bootstrap (which Bulma is based on, I think).
You can see the final code here: https://github.com/kheggart/elsinore_app
And you can see the finished web app here: https://sleepy-citadel-91204.herokuapp.com