In this video, I’m going to be showing you how to make a website with Python, covering Flask, authentication, databases, and more. The goal of this video is to give you what you need to make a finished product that you can tweak, and turn into anything you like. We’re going to also go over how you create a new user’s account, how you store those in a database, how to log into those user accounts, how to log out of them, and how you associate that information with a specific user.
🔥 Sign up for a FREE TypingDNA Developer Account! https://www.typingdna.com/clients/signup.
Try the TypingDNA Demo: https://www.typingdna.com/#demo
📝 Code for this tutorial: https://github.com/techwithtim/Flask-Web-App-Tutorial
📺 Fix Pip on Windows: https://www.youtube.com/watch?v=AdUZArA-kZw&t=10s
📺 Fix Pip on Mac: https://www.youtube.com/watch?v=E-WhAS6qzsU
⭐️ Timestamps ⭐️
00:00:00 | Video Overview
00:01:50 | Project Demo
00:04:35 | Directory Structure
00:06:40 | Flask Setup & Installation
00:08:55 | Creating a Flask App
00:14:01 | Creating Routes/Views
00:21:50 | Jinja Templating Language & HTML Templates
00:47:22 | Sign Up Page HTML
00:52:14 | Login Page HTML
00:54:31 | HTTP Requests (POST, GET, etc.)
00:57:05 | Handling POST Requests
01:03:14 | Message Flashing
01:12:42 | Flask SQLAlchemy Setup
01:15:46 | Database Models
01:23:42 | Foreign Key Relationships
01:29:10 | Database Creation
01:34:14 | Creating New User Accounts
01:43:16 | Logging In Users
01:49:17 | Flask Login Module
01:56:03 | Checking if User is Logged In
01:58:54 | Notes HTML
02:02:41 | Adding User Notes
02:05:48 | Deleting User Notes
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
💰 Courses & Merch 💰
💻 The Fundamentals of Programming w/ Python: https://tech-with-tim.teachable.com/p/the-fundamentals-of-programming-with-python
👕 Merchandise: https://teespring.com/stores/tech-with-tim-merch-shop
🔗 Social Medias 🔗
📸 Instagram: https://www.instagram.com/tech_with_tim
📱 Twitter: https://twitter.com/TechWithTimm
⭐ Discord: https://discord.gg/twt
📝 LinkedIn: https://www.linkedin.com/in/tim-ruscica-82631b179/
🌎 Website: https://techwithtim.net
📂 GitHub: https://github.com/techwithtim
🔊 Podcast: https://anchor.fm/tech-with-tim
🎬 My YouTube Gear 🎬
🎥 Main Camera (EOS Canon 90D): https://amzn.to/3cY23y9
🎥 Secondary Camera (Panasonic Lumix G7): https://amzn.to/3fl2iEV
📹 Main Lens (EFS 24mm f/2.8): https://amzn.to/2Yuol5r
🕹 Tripod: https://amzn.to/3hpSprv
🎤 Main Microphone (Rode NT1): https://amzn.to/2HrZxXc
🎤 Secondary Microphone (Synco Wireless Lapel System): https://amzn.to/3e07Swl
🎤 Third Microphone (Rode NTG4+): https://amzn.to/3oi0v8Z
☀️ Lights: https://amzn.to/2ApeiXr
⌨ Keyboard (Daskeyboard 4Q): https://amzn.to/2YpN5vm
🖱 Mouse (Logitech MX Master): https://amzn.to/2HsmRDN
📸 Webcam (Logitech 1080p Pro): https://amzn.to/2B2IXcQ
📢 Speaker (Beats Pill): https://amzn.to/2XYc5ef
🎧 Headphones (Bose Quiet Comfort 35): https://amzn.to/2MWbl3e
🌞 Lamp (BenQ E-reading Lamp): https://amzn.to/3e0UCr8
🌞 Secondary Lamp (BenQ Screenbar Plus): https://amzn.to/30Dtafi
💻 Monitor (BenQ EX2780Q): https://amzn.to/2HsmUPZ
💻 Monitor (LG Ultrawide 34WN750): https://amzn.to/3dSD7tS
🎙 Mic Boom Arm (Rode PSA 1): https://amzn.to/30EZw9m
🎚 Audio Interface (Focusrite Scarlet 4i4): https://amzn.to/2TjXsih
💸 Donations 💸
💵 One-Time Donations: https://www.paypal.com/donate?hosted_button_id=CU9FV329ADNT8
💰 Patreon: https://www.patreon.com/techwithtim
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
⭐️ Tags ⭐️
– Build a website
– Python tutorial
– Flask
– Learn Python
– How to use Python
– HTTP requests
– HTML Python
– User accounts Python
⭐️ Hashtags ⭐️
#PythonWebsite #TechWithTim
source
He coded so much in python !! but where is output ? the app i mean or the website ?
I tried asking this here and my question seemed to disappear. The tutorial was great. I have enjoyed all the Tech with Tim ones I have done. I have a rather large website I built following along with this. But now I have massive problems as it tells me this is a development server but I have no idea how to make it a production WSGI and despite signing with a firm advertising themselves as Python web hosting specialists they don't seem able to help. Anyone who can point me to some Tim-level instructions on getting from point A to point B would be amazing. I am worried at this point the whole site I built is for nothing cause people would have to come to my house to use it.
thank you tim
Great course!, thanks so much for putting the time and effort to create this! had a great time following along 😛
I have tried to include an update function but it does not work.
My update function ->
note = Note.query.get_or_404(note_id)
if request.method == 'POST':
data = request.form['note']
note.note = data
db.session.add(note)
db.session.commit()
flash('Note updated!', category='success')
return redirect(url_for('views.home'))
return render_template('update.html', user=current_user)
i can skip 21:57 – 47:00 if i already made a site right? So i just put my site data inside the template folder right?
There is no need for that create_database function in __init__.py. SQLAlchemy will already not overwrite an existing file, and the only time the database wouldn't be created is if it raised an error.
db.create_all(app) ? any suggestion I keep getting error that it is not irritable. I was on part of addind daatbase but it looks like the create all is not wokring
getting this error after changing to use with app.app_context(), raise sa.exc.UnboundExecutionError(message) from None
sqlalchemy.exc.UnboundExecutionError: 'SQLALCHEMY_DATABASE_URI' config is not set. Bind key 'None' is not in 'SQLALCHEMY_BINDS' config.
Thank you very much for this video! I learnt a lot with it.
You shouldn't apologize for making a long video, since every minute was good and full of information and straight to the point.
TypingDNA is a very terrifying piece of software. I'ts going to completely destroy privacy and the freedom of speech on the internet – mass surveillance at it's best. 😞
This video is pretty old so if you follow it, you may get errors.
When creating the database,
use this:
with app.app_context():
db.create_all()
instead of this:
db.create_all(app=app)
For those who got an error while creating a database, try replacing line:
db.create_all(app=app)
with
with app.app_context():
db.create_all()
How I got these frameworks using pycharm?
Has anybone been able to fix the following : "RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." when attempting to create the SQLalchemy database?
what if we forget our user password?
Tim, you're a legend for this one! Many thanks!
Thak you very much tim, Highly recoomend this video for beginners.
What format code you use in this video?
Confusing..
If you get 'app' is not recognized then put this:
with app.app_context():
db.create_all()
instead of create_database(app)
Fantastic tutorials, thank you Tim! Also hearing Tim struggle with "vehr -k ts-oi-g" was hilarious =)
from syria i thank you very much .. this is the first time that i have understood how i design a web page
the cmd run doesnt work : AttributeError: 'NoneType' object has
no attribute 'run' what to do pls
Thank god your not Indian. Such a nice change of pace to hear someone's voice
Wouldn't it be nice if this just made sense
Thank you very much sir, wanted to learn about this as I'm hoping to deliver some automation tools for internal uses for the company next year and it will definitely give me a jump start as I am not a professional developer and had no ideas about how to develop a functional website.
Thank you for another wonderful tutorial!
the code is saying 404 not found instead of 405 method not alloud
My JavaScript for deleting the notes isn't working. The onClick on Home.html is having errors (just like in the tutorial) and I just can't delete the notes. Can anyone help please?
This is great for someone starting up on python. However, please what if i want convert a user input to QR code and safe to the Database?
Thanks. very enjoyable learning experience
Amazing tutorial! I had some experience with sql server and power bi, and web dev but not together. Super easy to follow!
HI, I followed through your tutorial, but when i ran the app, it says :TypeError: create_all() got an unexpected keyword argument 'app' . It seems that in the create_database(app) function, db.create_all(app=app) is giving me a TypeError. I have tried git clone to run the exact copy of his version, but it still gives me the same error. Could someone please explain why am i getting this error?
Amazing tutorial!. This is the best instructional video for programming I have ever seen!
SQLAlchemy.create_all() got an unexpected keyword argument 'app'