{"id":19342673,"url":"https://github.com/adamyala/flask_user_example","last_synced_at":"2026-06-13T13:32:28.557Z","repository":{"id":70105757,"uuid":"88552675","full_name":"adamyala/flask_user_example","owner":"adamyala","description":null,"archived":false,"fork":false,"pushed_at":"2017-04-17T21:43:17.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T08:48:39.651Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamyala.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-17T21:32:30.000Z","updated_at":"2021-02-24T01:28:47.000Z","dependencies_parsed_at":"2023-02-28T19:30:43.752Z","dependency_job_id":null,"html_url":"https://github.com/adamyala/flask_user_example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adamyala/flask_user_example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamyala%2Fflask_user_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamyala%2Fflask_user_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamyala%2Fflask_user_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamyala%2Fflask_user_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamyala","download_url":"https://codeload.github.com/adamyala/flask_user_example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamyala%2Fflask_user_example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34286975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T03:35:53.213Z","updated_at":"2026-06-13T13:32:28.530Z","avatar_url":"https://github.com/adamyala.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask User Example \n\n## What is this?\n\nThis is a Flask app that lets a user signup, logout, and login. It is the simplest way I could find to do it. \nNo fluff. No BS. Just information in plain English. This is not meant for production. This is a mini guide explaining \nwhat certain words and concepts mean.\n\n### Who is this for?\n\nThis is for folks who are learning to write python web apps for the first time. This is for folks who didn't get CS\ndegrees. If you don't know anything about storing passwords, this is for you. If you don't know anything about using \na database with Flask, this is for you. This doesn't explain SQL fully. I hope to add that in the future. This is for \nsomeone who knows a little bit of Flask, but hasn't connected it to a database. \n\n### Why did you make this?\n\nI made this because when I first started learning web development I didn't have anything like this example. People tried to \nteach me but they used fancy phrase like \"password hashing\", \"salting\", \"user sessions\", and \"type coercion\". That didn't help me.\nI wanted a way for people to learn that didn't use spooky words. I wanted something in plain English.\n\n### What do I need to know before using this?\n\nYou need to know how to run a Flask app. You need to understand how to write a couple lines of SQL. If you're rusty on \nSQL, keep reading, hopefully this will shed some light.\n\n## The Basics\n\n### Python\n\nThis repo uses the `.format()` function. Seasoned python users forget how uncommon `format` is among new coders.\n\nThe `.format()` function is a function that every string has. It replaces brackets like `{}` with a variable. For \nexample:\n\n```python\nthe_authors_name = 'Adam'\ngreeting = 'My name is {}'.format(the_authors_name)\nprint(greeting)\n# \u003e\u003e\u003e 'My name is Adam'\nfriends_name = 'Bob'\nfriendship = '{} is friends with {}'.format(the_authors_name, friends_name)\nprint(friendship)\n# \u003e\u003e\u003e 'Adam is friends with Bob'\n```\n\nWhy should you do this instead of `the_authors_name + ' is friends with ' + friends_name`?\n\nThe example above only worked because the variables were strings. If you did `1 + ' is less that ' + 2`, it would throw \nan error. `'{} is less than {}.format(1, 2)` will not throw an error. The fancy name for what this is doing is called \n\"type coercion\". That's a fancy way of say \"changing the type so things don't error\". You should always use `.format()` \nfor building things like sentences. I use them in this project to build our SQL queries, which are just sentences.\n\n#### Python 3.6.X\n\nI'm going to talk about something called \"f-strings\". This is only supported in python 3.6+, but it's good that people \nsee it as often as possible so we can all move to new versions of python together. Below is the exact same as the above code, \nbut it uses the \"f-string\" style.\n\n```python\nthe_authors_name = 'Adam'\ngreeting = f'My name is {the_authors_name}'\nprint(greeting)\n# \u003e\u003e\u003e 'My name is Adam'\nfriends_name = 'Bob'\nfriendship = f'{the_authors_name} is friends with {friends_name}'\nprint(friendship)\n# \u003e\u003e\u003e 'Adam is friends with Bob'\n```\n\nDon't worry about \"f-strings\" too much. I just want people to see them bit by bit until they become more mainstream in python.\n\n### Passwords\n\n#### Hashing\n\nWhen you go to Facebook and type in your password, Facebook doesn't know your password. They know a scrambled version \nof your password called a \"password hash\". The one of the reasons you store a password this way is that if Facebook ever got \nhacked the hacker would only have hashes, not real passwords.\n\nMost _hashed_ passwords are impossible to reverse into their plain passwords. How is this possible? How can Facebook know your password \nis right if they don't know the real thing? Scrambling, or _hashing_ a password is destructive. It removes information from what is being scrambled. \n\nImagine your password was `abcdefghijk`. Lets say our scrambler removed every other letter. The scrambled password or _hash_ would be `acegik`. If someone \nstole this hash, they would have no idea what your full password is. If you came to our site and provided the correct password \nwe'd be able to remove every other letter and it would match the hash we stored. *This only works if the scrambling process is the same every time.*\n\nDoesn't that mean someone could use a password like `a1c1e1g1i1k` and get into our site? Yes. That's because our hashing example  \nis simple. Websites use a much more complicated method of destruction.\n\nThe method of destruction is called a _salt_. In the example I just gave, our salt was removing every other letter. In web apps \nthe salt usually uses the application's _secret key_ to determine how to scramble. Lets say our secret key was `abefij` and our \nsalt method was \"remove every letter from a password that is in our secret key\". If our original password is still `abcdefghijk`, \nthen our sale would be `cdghk`. As you can imagine, salting/hashing can get really complex really quickly.\n\n### Talking to the internet\n\nWhen an app sends information to the internet or gets information, the info is usually in the form of an _http request_. Lets say \nI'm a user and you're a computer. If I want to _get_ information from you, I might send you a text that says \"What's up?\". Me asking \nyou for info is called a GET. The text I sent you is an HTTP Request. If you response and say \"Not much, just hanging out.\", that \nis an HTTP Response. \n\nIf I want to _give_ you information, like \"Lets grab lunch tomorrow at noon\", that is a POST. When you reply \"Sounds good\", that \nis also an HTTP Response.\n\n# READ ME TODOS: \n\ndb connections\nspooky syntax like the unused exception and all the decorators\nsetup application\nconnection and cursor\ndatabase commits and why\ndatabase close connection\nwhy not doc strings","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamyala%2Fflask_user_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamyala%2Fflask_user_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamyala%2Fflask_user_example/lists"}