FastAPI with PostgreSQL and Docker

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

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

  • @iamrithmic
    @iamrithmic  3 года назад +9

    🔴- If you enjoyed this video please leave a Like and Subscribe :)

  • @Darweesh84
    @Darweesh84 2 года назад +28

    Thanks for the video. Few remarks:
    1- It would be nicer if you explained what were the flags you used when configured postgres. For example, why you used `-d` (detached mode)? why it's important to set the ports inside the container.
    2- Create DockerFile: better for maintenance, control over commands\versions and packaging.
    3- Create `requirements.txt` for python packages, for the same reasons and integration with docker.
    4- I don't recommend to rename all imported package with underscore.

  • @iamrithmic
    @iamrithmic  9 месяцев назад

    👽 Join the Discord Server (link in the description)

  • @wanamuhanga9745
    @wanamuhanga9745 7 месяцев назад

    I watched this tutorial last year and it's still relevant. Great Job Rithmic.🐐

  • @kimsspencer
    @kimsspencer 8 месяцев назад +1

    YOU ARE PERFECT. thank you for this tutorial

    • @iamrithmic
      @iamrithmic  8 месяцев назад

      Im really glad this was useful!

  • @trigocuantico
    @trigocuantico 2 года назад +2

    Dude I just needed this, thanks for all of your vids, they are gold

    • @iamrithmic
      @iamrithmic  2 года назад

      Glad you enjoyed 👾👾

  • @timklymenko2612
    @timklymenko2612 2 года назад +2

    Great video thanks! One recommendation would be for you to put your docker and bash SQL queries in a text files to viewers don't have to copy these off the video and try and find the right section etc. Couldn't see them in your repo's readme either

  • @voloduhe
    @voloduhe 2 года назад +1

    a big thanks to you. this tutorial is the most understandable in youtube. it would be totally useful to see a tutorial to docker-compose!!

    • @iamrithmic
      @iamrithmic  2 года назад

      Thank you very much for the comment! Yes I’m currently looking into more Docker related tutorials. Stay tuned ;)

  • @Lerklinten
    @Lerklinten 2 года назад +4

    Another great video, congrats on 1k subscribers. Could you do a video on SQLModel from Trianglo, creator of FastAPI

    • @iamrithmic
      @iamrithmic  2 года назад +2

      Yes will look into it, saw it a few weeks back and has peaked my curiosity of trying it out

  • @farzadmf
    @farzadmf 3 года назад +2

    Congratulations on 1k subscribers 🚀 well deserved
    I remember you mentioned in one of your videos why you import packages with underscores, can you remind me why? 😛

    • @iamrithmic
      @iamrithmic  3 года назад +2

      Thank you so much!
      The reason is so that it comes across as protected. Pylint would raise a warning that you are importing something with an underscore if you making use of some python file

    • @farzadmf
      @farzadmf 3 года назад

      So, you mean if there's another file trying to import this "underscore-ified" package from this file? 🤔

  • @roobsonsants
    @roobsonsants Год назад +1

    You really helped me! Thank you very much ;D

  • @alvin3171997
    @alvin3171997 3 года назад +7

    hi rithmic, can you teach us on how to do migration in production with alembic correctly?
    Thank you so much for all the fastapi tutorials 💯

    • @iamrithmic
      @iamrithmic  3 года назад +2

      You're more than welcome! Thanks also for the suggestion...will be planning for one :)

  • @josepicon7877
    @josepicon7877 Год назад +1

    que elegancia de video, gracias por ofrecer contenido de valor

  • @Etogg_
    @Etogg_ 2 года назад +1

    thank you so much for the tutorial ! keep up the good work ! you help people :)

    • @iamrithmic
      @iamrithmic  2 года назад

      Thank you for the comment !

  • @abdullahshahzad4408
    @abdullahshahzad4408 13 дней назад

    Why you mentioned docker in the title? when you don't you use it in the video

  • @aruncanra2084
    @aruncanra2084 2 года назад +1

    How do i connect to an existing postgres database to a fastapi app running on a docker container?

  • @coghi100
    @coghi100 Год назад +1

    Muito obrigado pelo seus ensinamentos, você me explicou com clareza e tirou a minha duvida, fico muito agradecido e me desculpe em falar em português kkkkkk

  • @ryansilva8121
    @ryansilva8121 2 года назад +2

    the command "psql -h localhost -p 5432 postgres", is it really necessary? when calling it nothing is displayed as usual in postgres bash. I got the connection without using this command! could you explain to me about?

    • @carloskuhn1344
      @carloskuhn1344 11 месяцев назад

      we actually cannot run that command from inside of the database, and running from outside also does not work. I am having a problem when I am following the instruction, I am getting the error that relation "table name" does not exist

  • @MejiMaru
    @MejiMaru 3 года назад +2

    Nice one

  • @alexCh-ln2gw
    @alexCh-ln2gw 10 месяцев назад

    aren't you supposed to NOT run postgres inside a docker container due to statelessness/access issues/etc ?

  • @KarolSikorski-z8u
    @KarolSikorski-z8u 6 месяцев назад

    has anyone tried to connect to exisitng database using docker? I have created a database through pg admin. I have a database named Rest from public schema. I used postgres 15.3 image. When enterning the container and going to psql -U postgres I can see database Rest but I can't see any tables inside it :((

  • @gunahawk6893
    @gunahawk6893 3 года назад +1

    Thanks man

    • @iamrithmic
      @iamrithmic  3 года назад +1

      More than welcome :) Hope it is of use

  • @astronemir
    @astronemir 2 года назад

    What’s with the nonstandard underscore naming scheme?

  • @judahtamirirashechisare758
    @judahtamirirashechisare758 Год назад

    where is the docker part, cant see it

  • @collegeinvestor7095
    @collegeinvestor7095 3 года назад +1

    Second the request: migration tutorial would great!

    • @iamrithmic
      @iamrithmic  3 года назад

      Yep seeing this more and more haha. Will start to plan for one at some point

  • @arturocdb
    @arturocdb 2 года назад +1

    Awesome, really great video, .., i want to learn that level of skill, can recommend me a course or a institute?, thanks in advance…

    • @iamrithmic
      @iamrithmic  2 года назад

      Best place I can recommend is RUclips. Other great content sources such as Traversy Media and FreeCodeCamp

  • @pipi_delina
    @pipi_delina Год назад

    Can you do a video on alembic migrations

  • @muasx1985
    @muasx1985 2 года назад +1

    what's the theme you use ?

  • @romanalilov4648
    @romanalilov4648 2 года назад +2

    I had a problem with "sqlalchemy.exc.ProgrammingError: (psycopg2.errors.InsufficientPrivilege) permission denied for schema public" while creating a table .
    For me worked: "grant all on schema public to 'username' "

    • @builtin0
      @builtin0 Год назад +2

      GRANT CREATE ON SCHEMA public TO myuser; //give more persion to the user this will do🤙

  • @ryansilva8121
    @ryansilva8121 2 года назад +1

    help me bro, exit: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: FATAL: password authentication failed for user "ryanl"

    • @pedrosok3648
      @pedrosok3648 2 года назад +1

      I get the same

    • @ryansilva8121
      @ryansilva8121 2 года назад

      @@pedrosok3648 still with error?

    • @prashants3309
      @prashants3309 2 года назад +1

      ​@@ryansilva8121 i had the same issue. Collogue of mine helped me to fix this issue. If you got postgres locally installed on your laptop you have to delete it. Because when you try to create the tables it does not know which postgres it has to connect to. I hope this solution will also work for you!

    • @johnpaulpolicarpio2755
      @johnpaulpolicarpio2755 Год назад

      @@prashants3309 how to delete it?

  • @ahoymatey1234
    @ahoymatey1234 Год назад

    There must be a missing step " sqlalchemy.exc.ProgrammingError: (psycopg2.errors.InsufficientPrivilege) permission denied for schema public
    LINE 2: CREATE TABLE contacts ("

    • @ahoymatey1234
      @ahoymatey1234 Год назад +1

      If anyone runs into this I solved it by doing "grant all on schema public to myuser;"

    • @iamrithmic
      @iamrithmic  Год назад

      That's annoying, I'm not sure why this wasn't picked up whilst recording. Thanks for the comment!

    • @ahoymatey1234
      @ahoymatey1234 Год назад

      Unfortunately there are just too many issues with this tutorial to finish it now. I would recommend adding a requirements file next time

    • @iamrithmic
      @iamrithmic  Год назад

      @@ahoymatey1234 There is a requirements file. Check the GitHub link

    • @cuturbs
      @cuturbs 10 месяцев назад

      @@ahoymatey1234 I tried giving every access possible to myuser, but I still can't even create the models. I really don't know how to fix it