That is, if there is a closest match to return. I'm almost to the point where I can test whether DejaVu works well in the relevant domain, which has little in common with overproduced pop music. If it works I'll be back in the next few days to report on my success. If not, I'll be back to tell you about how I wasted the week on a huge failure :)
After some trial and error (and Googling) I was able to implement a simple email notification system using Flask-Mail. Check out my code on GitHub if you want to see how I did it.
Whenever someone signs up they get a nice welcome message in their inbox, and I get a notification saying that I have a new user. I also get a notification whenever someone comments on a post. For the welcome message, I log in the new user after adding him or her to the database. That way I can immediately use
current_user.email from the Flask-Login module to personalize the messages before leaving the signup function.
I've learned a lot about web app development while turning this into a functional blog. I'm satisfied with the backend for now. My next tasks are mostly cosmetic--it's looking a little bland around here! I also think I should add an About view to give general information about this project and what I hope to learn by continuing to modify it.
Something went wrong with my database migration script, so I spend a good chunk of the evening fussing with the database. Since I only had two posts it seemed reasonable to destroy the database and start fresh with a new one. The posts below are copies I made just in case the migration didn't work. I should read the documentation for Alembic and try to understand what went wrong before trying that again.
The good news is that I was able to implement all of the features I listed in the earlier post. You can now sign up and post comments if you want. I'm still kind of new to programming, so any constructive criticism or suggestions would be very helpful!
One feature I want but didn't have the time to implement: a welcome email for folks who sign up to write comments. I see that Flask has a mail module, so I don't think it will be too difficult to make that happen. Email authentication would be nice too. That seems like it would be more involved, though. Anyone already know how to pull that off?
I've identified the features I want to add to the blog before I move on to the next part of the course. It should allow other users to sign up for an account, comment on my posts, and edit or delete their comments. Here are some of the practical things I need to do to make this happen:
I think that's it. This may take me some time, since I've got some important academic stuff coming up next week and will have to put coding on hold for a few days. I'll write more as I go if anything of note happens along the way.
I just deployed my first functional web app (this blogging application) to Heroku.
The app is a python script that generates the html you see using templates that are filled in based on user input. If you're signed in, you get to add, edit, and delete your posts. The python script also manages a PostgreSQL database that houses posts and user information.
I wrote this app as a project for Thinkful's "Programming in Python" course. I plan to update it regularly with posts about my progress as a burgeoning software developer. I also hope to add comment functionality and other bells/whistles to this app in the near future. When I do, I'll tell you what I did and how I did it.