Python Microservices Web App (with React, Django, Flask) - Full Course

Поделиться
HTML-код
  • Опубликовано: 24 июл 2024
  • Using Python microservices allows you to break up your apps into smaller parts that communicate with each other. This can make it simpler to scale the application based on the traffic. Also, the separation of concerns makes it easier to work on just one part of the app at a time.
    💻 Code - Python Microservices: github.com/scalablescripts/py...
    💻 Code - React: github.com/scalablescripts/re...
    ✏️ Course developed by Scalable Scripts. Check out their channel: • Laravel Microservices ...
    ⭐️ Course Contents ⭐️
    ⌨️ (0:00:00) What are Microservices?
    ⌨️ (0:02:29) Project Introduction
    ⌨️ (0:05:29) Django Setup
    ⌨️ (0:06:31) Adding Docker Files
    ⌨️ (0:12:32) Connect Django with MySQL with Docker
    ⌨️ (0:19:12) Models & Serializers
    ⌨️ (0:23:11) Rest APIs with ViewSets
    ⌨️ (0:35:07) User Endpoint with APIView
    ⌨️ (0:37:53) Flask Setup with Docker
    ⌨️ (0:42:13) Connect Flask with Mysql
    ⌨️ (0:44:00) Models
    ⌨️ (0:47:41) Flask Migrations
    ⌨️ (0:51:44) RabbitMQ
    ⌨️ (0:52:15) Django Producer and Consumer
    ⌨️ (0:57:54) Flask Producer and Consumer
    ⌨️ (0:59:25) Queue Service
    ⌨️ (1:04:18) Data Consistency
    ⌨️ (1:14:36) Internal Http Requests
    ⌨️ (1:18:06) Finishing the python apps
    ⌨️ (1:25:51) React Setup
    ⌨️ (1:42:04) Products CRUD
    ⌨️ (2:08:44) Completing the Main App
    ⭐️ Special thanks to our Champion supporters! ⭐️
    🏆 Loc Do
    🏆 Joseph C
    🏆 DeezMaster
    --
    Learn to code for free and get a developer job: www.freecodecamp.org
    Read hundreds of articles on programming: freecodecamp.org/news

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

  • @nikunjmishra5817
    @nikunjmishra5817 3 года назад +46

    One of the best microservice tutorial in python till date....I have been waiting for any such tutorial for soo long....great work done...

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

    Nice tutorial! I am just starting off with learning Python Microservices, and your demo is lucid. I like that you didn't cut off the mistakes part, correct it, and showcase it. The build-up is step-by-step so that we can follow you. Brilliant work!

  • @mhh5002
    @mhh5002 3 года назад +31

    Waiting for Microservices with Python course for some time. Glad it came out.

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

    came to learn about microservices, ended up with way way more valuable things. thanks man!

  • @this.is.lapc506
    @this.is.lapc506 3 года назад +8

    You gave me back hope to return to my college career in software engineering after 5 years with this real life demo of Docker!

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

    I just love watching this Implementations and builds...POWERFUL.

  • @r4riaz
    @r4riaz 3 года назад +31

    Amazing tutorial by Scaling Scripts. Keep up the good work. I am learning a lot. One request, can future tutorials also show the best development practices used in enterprises. Like unit testing, how to organize the code etc. This will give a solid foundation. Just a suggestion. This end2end tutorial is awesome anyways.

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

    Waiting so long for this course.
    Loved it..!!

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

    This seems to be amazing video. I was looking exactly for this kind of material. Thank you!

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

    One of the best microservice tutorial using python and reactjs

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

    amazing content, not only microservices but a good docker tutorial within.

  • @swetavivekdwivedi6991
    @swetavivekdwivedi6991 16 дней назад

    Awesome tutorial with detailed coverage on each and every aspect of developing microservice. Easy to follow. Thanks buddy.

  • @PatrickIrungu
    @PatrickIrungu Месяц назад +1

    Doing this tutorial now is not only fulfilling having to google how the new packages are working because most logic has become obsolete. I have to stop and google around fixing libraries and get moving again. I have learnt a lot and thank you tutor for putting this together.
    Some gaps are there for the learner to figure out and learn on their own, so don't let that be a frustration or a blocker.
    Another thing, following the tutor into his confusion on why the unique constraints isn't working when he implemented product likes api, if you are keen you'll remember or go to that /users api in the other service and find he had randomized the api to return random user id which introduces a bug in his logic of using that api to implement like functionality.

  • @carlfranz6805
    @carlfranz6805 3 года назад +28

    Somewhere between Django setup and add Docker files our presenter completely missed a step. very frustrating. He goes to a screen/app he has not shown yet. Is that part of Docker? Is that something we need to have installed already? Is there a list of prerequisites?

  • @srisonkadariya1754
    @srisonkadariya1754 3 года назад +21

    Thank you for this amazing course! Could you please release another course with authentication for microservices using JWT?

  • @usmanmunir1559
    @usmanmunir1559 3 года назад +8

    always waiting for such a cool content ... appreciated this work byAnotonio

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

    Thank you! This was indeed much needed

  • @freedagoman29
    @freedagoman29 3 года назад +5

    I wish my boss knows just a little bit of programming, especially CRUD operations. His motto is “You should make a website that even a child can also use”. He expects all CRUD to be done in one single page for a list of different fields that can all have CRUD operations. After I finished that project, I felt sick and satisfied at the same time.

    • @SagarSagar-ro3fj
      @SagarSagar-ro3fj 2 года назад +4

      Only technology people should deal with tech business. 😂These idiots make life hell..they can even ask to make a person alive after death by creating the some website

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

    Very clean explanation! Thank you very much for that.

  • @yadhukrishna9673
    @yadhukrishna9673 3 года назад +5

    thank you so much... im working on a react project rn and this is soo helpful...

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

    Exactly what I was looking for!!

  • @BekBrace
    @BekBrace 3 года назад +4

    Great job there Antonio !

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

    Exactly what I was looking for! Thxs!

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

    Going to go ahead and thumbs up now just based on the comment section.
    Thank you ahead of time for this feast.

  • @zekariastayehirpo8711
    @zekariastayehirpo8711 3 года назад +4

    This video is really amazing. I would recommend for everyone.

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

    This is crazy awesome! Thank you!

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

    Great video... Your example is really nice!

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

    Excellent video! Congratulations!

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

    Anyone else having trouble connecting to the db at 19:10? I'm getting an error message saying "can't connect to MySQL server on db'

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

    It is so great to have so much knowledge for free

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

    Wow. just wow. understood so many things. thank you.

  • @alsiyonealternate
    @alsiyonealternate 3 года назад +8

    1:20:00 is the "docker.for.mac.localhost" name constant for everyone, or is this a user defined name for your docker instance?

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

      In docker 20.10 is now 'host.docker.internal' , and doen not work in linux. In linux use the docker ip: 172.17.0.1 and add that IP to your allowed host on Django settings.pt, like this: ALLOWED_HOSTS = ['172.17.0.1']

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

      @@ivan6navi Thank you very much!
      You saved my sanity after realising choosing to develop this on Ubuntu was a mistake as there is not "docker.for.linux.localhost" equivalent. Changing the ALLOWED_HOSTS = ['172.17.0.1'] in admin\settings.py worked and Postman executed the def like() method like a charm! :D

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

      @@ivan6navi Thanks! It worked on Linux

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

    @Scalable Script Hello, when i use python manage.py migrate, it doesn't generate those tables in the video. Do you know how to fix that?

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

    Thanks a lot 🙏🙏🙏.I wanted to learn micro services . I am a java developer

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

    I'm having problems in the path, I try to retype de urls.py but the problem is circular imports or no data structure.

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

    Wonderful & awesome. Thanks a billion times.

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

    Great Tutorial, thank you.

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

    How can I run that consumer.py file without docker and docker container?
    Is it possible?
    Implement this in normal django project with rest API without docker?

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

    I came form java and spring and this tutorial was like a breeze, but please share the prerequisites like plugins and other stuff.

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

    Why did you write the DB credentials in settings.py file when you wrote them as environment variables in the DockerCompose? Shouldn't we be reading them from the environment?

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

    @scalable Scripts, thanks for the video. How about the Angular part?

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

    So excited for this

  • @user-mf1tg6df4k
    @user-mf1tg6df4k 3 года назад +2

    I have a question.
    Product model properties
    - admin: id title image likes
    - main: id title image
    so, (2:11:45) we can't use "likes" because the product fetching by "localhost:8001/api/products" don't have "likes" properties.
    why does it work?

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

      I have the same question!
      And because of that i don't get the like numbers shown in my main "localhost:3000/" page.... because main does not have "likes" properties.
      can some tell me why it works in the video?

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

    How are you updating the running apps to reflex your code changes? I don’t see you restarting anything when you edit code. Do you have some tool that automatically restarts (apps/containers?) on file changes?

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

    I really liked. Thanks for share!

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

    Which theme for pycharm are you using?

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

    Hello, a question why I connect to the database and when consulting the database it does not bring me any table, it appears empty, but if you believe me and list me in the application?

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

    can't run flask app in docker container
    it works fine outside but can;t run it inside
    the flask server starts in the container but i can't see a response on localhost

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

    Do we have microservice packages similar to spring cloud in Python as well?

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

    following this when I created products through dckr-cmps exec I got permissions denied when trying to overwrite models. I changed it to something like 644 and it work. I'm just curious about the security implications here, if I should have done it differently?

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

    why did not use api manager to manage two different api sources?

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

    why you use Flask ? you could complete the project with Django and Django Rest framework

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

    Hi,
    I am unable to resolve this error (@1:24:33)
    "django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings."
    In the video, he resolved the error by adding this line
    "os.environ.setdefault("DJANGO_SETTINGS_MODULE", "admin.settings")
    django.setup()"
    However, this does not work for me. Any ideas on how to resolve this?

    • @zbigniew.stankowicz
      @zbigniew.stankowicz 3 года назад +3

      the resolution suggested in the video works - but only if you add it before the other import statement "from products.models import Product"; which means you would not have all your imports on the top of the file

  • @davitavetikyan9652
    @davitavetikyan9652 3 года назад +3

    how do you open a connection to the database in VS code? Is there an extension? If so which one is it?

  • @user-ov1ps7go4m
    @user-ov1ps7go4m 7 месяцев назад

    50:00 db migrations made and necessary files are added

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

    Sorry and how do you demostrate microservices architecture here?:)

  • @JesseD-hq6ne
    @JesseD-hq6ne 6 месяцев назад

    at 12:43 , that means that the db is running with docker? it's not an external server?

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

    excellent, thank you very much!

  • @alvaromartin6301
    @alvaromartin6301 3 года назад +3

    Really in 2 hours all those topics? Oh my god, this will be interesting!

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

    @15:30 on Windows I pulled MySQL into Docker Desktop but I am receiving the vague error "validating docker-compose.yml: services.backend Additional property db is not allowed", does anyone know how to fix this behaviour?

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

    what are the prerequisites to start the tutorial?

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

    very interesting tutorial, thanks

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

    i didnt get the django connect with databse part. from whhere does that window popped up

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

      @@ScalableScripts 😅 yeah I resolved it with MySQL extension in vscode

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

    May I know how to change DB to progres SQL

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

    Which IDE was used here?

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

    Having an issue with React application not loading data at: 1:44:45 of the tutorial. Have not found a solution. Any direction would be greatly appreciated. Thanks. Receiving Cross-Origin Request Blocked and Uncaught (in promise TypeError: NetworkError when attempting to fetch resource.

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

    docker-compose up , not running giving error no such file in directory

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

    i dindn't get my requirements.txt installed after running docker-compose up can someone help me please

  • @PP-tc1zp
    @PP-tc1zp 3 года назад

    Hi,
    Is this project work in python 3.8?

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

    It's a good tutorial but I came to realize that it has a bit of coupling... when the django app goes down or when a message is sent and fails to reach the consumer in the flask app..the message might get lost and thus not updating the user table

    • @this.is.lapc506
      @this.is.lapc506 3 года назад

      I think it's part of the demonstration and made on purpose, otherwise all the communication would be done 100% via RabbitMQ

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

    Why did we not create Publisher in flask app ? Am i missing something ?

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

    while inspecting 1:44:49 i am getting error
    its not able to get data
    Failed to load resource: net::ERR_CONNECTION_REFUSED
    Products.tsx:15 Uncaught (in promise) TypeError: Failed to fetch

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

    Nice tutorial..but why don't you make two totally different services, like users and posts where by a sure has to be authenticated through jwt to create a post.

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

    Oh my god. I don't know the frontend can become so difficult now!

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

    Those who are having problem with windows. Go to virus and threat protection and add the parent project folder into exclude list.

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

    how can one deploy microservices like this on a server?

  • @AlfonsoNeilJimenezCasallas
    @AlfonsoNeilJimenezCasallas 3 года назад +8

    Is it possible to deploy this solution on AWS, GCP or any cloud PAAS?

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

      yes easily

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

    how do i access the Database in pycharm? at 16: 00, you said to connect to our ID but idk what you did to open that window

    • @2radix774
      @2radix774 3 года назад

      you need to download mysql, then when you run your docker container with database, you can connect to it using the mysql you downloaded
      to connect use
      mysql --port=33066 --user=root --password=root
      im assuming that your mysql is added into PATH

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

      @@2radix774 how do you connect it in vs code?
      I am getting an error
      so what I did is I took the whole project from Github and ran the docker file
      its giving the index error

    • @2radix774
      @2radix774 3 года назад

      @@jayvadera9615 if you download mysql it is idependent of visual studio code, its a app that you run from cli

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

      @@2radix774 were you able to run the whole project?

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

      @@2radix774
      while running the docker file its giving me this error
      backend_1 | IndexError: list index out of range
      queue_1 | IndexError: list index out of range

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

    Sir plz make a video on how to build advance level zoom meeting clone using python from scratch

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

    Thankyou "free code camp"

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

    Hi getting error while connecting to mysql like in database navigator or cmd shows ssl error unsupported
    ERROR 2026 (HY000): SSL connection error: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol

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

    I heard ' I am your new papa for this tutorial ' 😆

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

    I am trying this out but migrateCommand not working...kindly help

  • @snirisl
    @snirisl 3 года назад +4

    Hey, great course thank you!
    I have one problem, I can't get the logs from the queue container in the main app to show the events of creation/updating/deleting a product. The db gets updated but I don't see the events and my print statements in the terminal. only db_1 and backend_1 logs. What can I do?

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

      same issue here !

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

      Had the same issue.
      Make sure your ENV variable in the Dockerfile is called "PYTHONUNBUFFERED" and set to 1.

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

      @@carloss1199 Gracias Carlos, me pasaba lo mismo! Thanks for your answer!

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

    Around 31:44, what is the tool used for the test of post api?

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

      postman. Web version is available.

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

    You are boon to us❤️

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

    bummed at 34:19 ! After I do an update, and do a PUT request, it's throwing gibberish. Basically assertion error. Expected a `Response`, `HttpResponse` or `HttpStreamingResponse` to be returned from the view, but received a ``
    Any idea why?

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

    There is product app inside admin project.
    This admin is created using django.
    Inside product app there is product model that maps with product table in main app.
    This main app is created using flask.
    ----Operations---
    Changes in product table in admin app should be reflected in product table in main app using rabbitmq.
    Code is in views.py of product app in admin project.
    Then the like operation over product is done from main app and the change is reflected over product table of admin app using (admin queue).
    Code is in main.py of main app in main project.(Function name is "like")

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

    Great but it needs some more explanation, not everything but at least you can talk about the mechanims how all those connect, maybe with diagrams.

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

    is it possible to generate tokens Api in python?

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

    Comments so I remember to watch this in the morning.

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

    what is the tool used to connect the database at 16:02 ?

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

      I think it’s the built in database explorer that comes with pycharm

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

    Great tutorial.

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

    Great video freeCodeCamp, just one thing. In Flask migrations the terminal throws me this:
    Traceback (most recent call last):
    File "manager.py", line 3, in
    from flask_script import Manager
    ModuleNotFoundError: No module named 'flask_script'
    Can anyone help me please? :)

    •  3 года назад

      It's 2 months old, but in case you couldn't figure it out you might want to check the instalation of your pip packages, I was having a similar problem and turns out I had 2 python versions installed (3.8 and 3.9) and pip was installing the packages in the wrong place (3.8) so it was causing the "module not found" error

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

    what ide he is using?

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

    anyone tell me which tech stack he use I mean IDE and dependencies

  • @2radix774
    @2radix774 3 года назад

    18:32 how does django know that "db" will refer to our databse? i know thats how we called it in compose, but how is "db" converted into ip address?

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

      It is converted by docker internal DNS

    • @2radix774
      @2radix774 3 года назад

      @@unixlike7968 thanks

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

    It was a really great tutorial for Microservice using Python. Thanks!!!

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

      are you currently studying to become a software engineer?

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

      @@alexomaset5044 Actually I filled up my python skill to find a job. How about you?

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

      @@mabeleain3320 thats nice, I am also currently searching for a job but I initially attended a bootcamp

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

    Need to increase the font size or use the zoom feature of the screen capture or do both, so that we can easily see the code or the texts. Other freecodecamp videos do that but some just don't even bother to do it. It just add another layer of difficulty in the learning process when it's hard to see the code or the text.