Most of our functionality is there, but we still need to make sure that we can delete items from our shopping list. To d this, we will add a new /ID/delete route that accepts POST requests, similar to the edit() view function. This new delete() view function will receive the ID of the post to…
Wiki Category: Coding and Programming
PROJECT: Shopping List (part eight)
So now that we’ve created a view and template for creating a new form, we can also make sure that we can edit and modify items. That’s what we will do here. 9. Editing items 9.1 Editing the app.py file. To do this, we need to add a new route to the app.py file. It…
PROJECT: Shopping List (part seven)
We’ve now created an index page with all of our items, and also individual pages for each item. We will need to do some formatting on these template pages to make sure they look right and make sense, and I will also need to find out how to make sure that the purchased checkbox (if…
PROJECT: Shopping List (part six)
Now that we’re able to display a list of all the items on the shopping list, the next step is to be able to display single items. This will lead us into being able to update these items, too. 7. Displaying a single item 7.1 Explanation What we’re going to do is create a new…
PROJECT: Shopping List (part five)
Now that we have a database, and a web server, we can start to think about how we might best display our information. THat’s what we’re going to do now. 6. Displaying our results 6.1 Modifying the app.py file Firstly, we’re going to modify our app.py file. To do this we will add the following…
PROJECT: Shopping List (part four)
So we have a very basic web app in action. The next step will be to set up our database to store our data. We’re cgoing to use SQL, and particularly sqlite3 as it’s available with Python. 5. Setting up the database 5.1 The schema.sql file The first thing that we need will be a…
PROJECT: Shopping List (part three)
Now that we’ve set up a basic route and rendered an index page, we can really start working on developing the website a little more fully. Of course, the way we’ve served the current index page is fine, but if we have lots of dynamic content, we will rapidly run into some troubles. So we…
PROJECT: Shopping List (part two)
So far, we’ve set up our project, having installed flask, set up a virtual environment and set up a remote repository. We’re now going to start work on the project itself. 3. Creating the home or index page 3.1 Creating app.py for the routing The next step is to start working on the actual app…
PROJECT: Shopping List (part one)
So, I’ve been playing around with Node.js, and now I am going to switch over to developing a similar kind of application, but this time with Flask and Python. The database I will use will be SQL, and I will deploy it using Heroku, which I hope will go a little more smoothly Effectively,…
PROJECT: Node ToDo List (Version 2)
For quite a while, I’ve been trying my hand out at developing web applications that are capable of having some form of persistent data. This is somethign that I’ve wanted to be able to do for quite a while, but it’s proven to be quite challenging, mainly due to the range of different tools available…