top of page

Weekend 1 Accomplishments/Learnings


Week 1 of project season FLEW by. I sank a good amount of time into trying to incorporate Google's OAuth into my app, gaining first-hand experience as to why it's synonymous to a curse word. It bested me this week.. but it will be mine!

Here is what I accomplished and learned this week:

  • How to send myself an email from Python's built-in (meaning it doesn't need to be installed) library SMTP. Check out my HB_Project repo in Github (@yfalcon8) under sendnotif.py if you want to learn about this amazing feature :)

  • Flask's documentation is easy to understand now! A month ago, I had no idea what all of this meant. This is not my achievement though, it is Hackbright's achievement. Kudos to their accelerated curriculum and brilliant staff!

  • Reviewed the lecture notes related to Flask and added comments/notes to my project's code accordingly. As a result, my files are sprinkled with verbose comments, but hopefully other newbie programmers (and future Hackbright-ers) will find it useful.

  • Redid the Madlibs lab to practice Flask routes, creating HTML pages and playing around with Jinja variables. It's under the repo 'Madlibs' on my Github if you're in the mood for a quick game!

  • Web frameworks are libraries that help with a lot of repetitive, common tasks for web apps like handling web requests, producing HTML, handling forms, handling cookies, connecting to databases, providing user login/logout, and more.

  • When importing pdb and using pdb.set_trace() in a Python file, press 'c' + Enter in the console to follow your code. Enter alone does nothing.

  • Don't use double quotes in SQL. SQL likes singles only.

  • The result of executing a SQL query is called a cursor. It's the mechanism used to look at the rows contained in the result from the query.

  • The fetchone() method returns a tuple of a row out of a database table.

  • A traceback error is a synonym for runtime error. They refer to the fact that an error occurred while running your code.

  • The arguments for a GET request are a set of key/value pairs that the user can send to the web server via the url. Example: http://127.0.0.1:5000/?key1=val1&key2=val2. The question mark after the url tells the server that the remainder of the line is not part of the url. The pairs are separated by ampersands. In Flask, the set of pairs gets converted into a dictionary which is an attribute on a 'request' object. For GET requests, this dictionary is called 'args' and for POST requests, the dictionary is called 'form'. The key for a value that is inputted by a user (via HTML form) is stored on the HTML element as the name attribute. Example: <input type="text" name="github">.

  • The common thread among all web apps is that there's one page for displaying a form and there's another page for processing the form. The pages all link with HTML <a> tags.

Heading to bed to dream about code now :)

Recent Posts
Archive
bottom of page