Databases & SQLAlchemy - Flask Tutorial Series #7

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • In this episode of the Flask tutorial series, we will learn how to work with databases and SQLAlchemy.
    ◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
    📚 Programming Books & Merch 📚
    🐍 The Python Bible Book: www.neuralnine...
    💻 The Algorithm Bible Book: www.neuralnine...
    👕 Programming Merch: www.neuralnine...
    💼 Services 💼
    💻 Freelancing & Tutoring: www.neuralnine...
    🌐 Social Media & Contact 🌐
    📱 Website: www.neuralnine...
    📷 Instagram: / neuralnine
    🐦 Twitter: / neuralnine
    🤵 LinkedIn: / neuralnine
    📁 GitHub: github.com/Neu...
    🎙 Discord: / discord

Комментарии • 24

  • @wonkywombat
    @wonkywombat 5 месяцев назад +6

    Great episode. I too will need to redo this with an existing MySQL db.

  • @cvicvicvi
    @cvicvicvi 5 месяцев назад +1

    Hey, thank you so much for this tutorial series, it's very well thought and easy to understand for beginners like me. Currently trying to develop my first web app, that's exactly what I needed.

  • @leonardomoreiralouzas3995
    @leonardomoreiralouzas3995 Месяц назад

    Relly good! I changed the detail and delete to a single view to make it less code, I think it looks better that way. All the code is in my github repo

  • @gerlannoharrisson9210
    @gerlannoharrisson9210 7 дней назад +1

    top! thank you bro!

  • @samannwaysil4412
    @samannwaysil4412 3 месяца назад +1

    Keep these tutorials coming brother!

  • @jayewastaken9486
    @jayewastaken9486 5 месяцев назад +1

    I love this series!

  • @kylec.5476
    @kylec.5476 4 месяца назад +2

    Great series!

  • @spaff_hazz
    @spaff_hazz 3 дня назад

    after sending a post request, if i reload the page, i get the form resubmission alert and if i continue it takes the data that i last filled the form with even though it's not in the input field. how do i prevent this?

  • @johnraz99
    @johnraz99 5 месяцев назад +1

    Thank You. I just need to get it to work with my MySQL database now!

    • @johnraz99
      @johnraz99 5 месяцев назад

      Got it working with MySQL. Just had to change SQLALCHEMY_DATABASE_URI prefix to 'mysql+mysqlconnector://'. I also installed mysql-connector-python

  • @mhmmdalfatehhishahmuddin2670
    @mhmmdalfatehhishahmuddin2670 3 месяца назад +2

    My problem is when migrating SQL when I run the command: flask db init it say 'Could not import 'db'. How to fix it?

    • @dishuu2714
      @dishuu2714 Месяц назад

      same

    • @user-iu7en5ti3x
      @user-iu7en5ti3x 19 дней назад

      @@dishuu2714 1. Make a clean vevn
      2. install flask, flask-sqlalchemy, flask-migrate
      3. run the flask db commands (it should work now)
      4. make sure you have sqlite3 installed
      5. pay attention to pycharm advices to install sqlite3 related content if it's the first time you are using sqlite3
      6. Add a new sqlite3 data source clicking the plus icon in the database window that you can access in at the right of your screen inside pycharm
      7. Set the sample database 'testdb.db' in the file field browsing your directories
      8. Test Connection
      That worked for me.

  • @eklownr4566
    @eklownr4566 5 месяцев назад +1

    Nice tutorial.

  • @FrozenShield
    @FrozenShield 5 месяцев назад +1

    Thanks for the tutorial, it helped me understand flask-sqlalchmey! I am trying to understand at 15:10 you mentioned that it loops from the other python files. Is it necessary to loop it like that? I also looked at the quick start instructions for flask-sqlalchemy and it looks like you can do it all in app.py. When you write flask run in the terminal it looks for app.py to run that so is it best practice to keep everything in app.py or split it out like how you did it?

    • @MilitaryInfo4
      @MilitaryInfo4 3 месяца назад

      Hi, I think it's a better practice to split

  • @RocketLR
    @RocketLR 5 месяцев назад

    my problem is with the db.Model classes is that the __init__ does not do anything when creating a object from those classes..
    So i have to make classes that inherit from Base. But then they dont get created as far as i can tell..
    As im writing this, im wodnering if should create a db.Model table then another class that inherins from that class that inherited from db.Model..

  • @mugomuiruri2313
    @mugomuiruri2313 Месяц назад

    good see u again

  • @aafan.kuware
    @aafan.kuware 5 месяцев назад

    27:56 was not htmx will be the best choice to do this crud operations instead of writing these long JS?
    if possible, please make one separate video and all futher operation with HTMX.

  • @michaelrobson3092
    @michaelrobson3092 4 месяца назад

    Awesome , could you show how we could use a DB like Redis with SQLite & SQLAlchemy

  • @saulvera5469
    @saulvera5469 2 месяца назад

    dont know why but when I try to migrate it doesn't add any table, I ended up creating it in SQL

  • @masoooomx
    @masoooomx 3 месяца назад

    which OS and which IDE ????

    • @bengaltiger8401
      @bengaltiger8401 3 месяца назад

      Popos with pycharm professional edition