Deploying Django with Docker Compose, Gunicorn and Nginx

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • How to deploy a Django project in a production environment using Docker Compose.
    Django is run in production using a WSGI server such as Gunicorn and a web server such as Nginx.
    Code on Github: github.com/dot...
    Resources:
    testdriven.io/...
    vsupalov.com/d...

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

  • @exganza
    @exganza Год назад +5

    Thank you

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

      Many thanks!

    • @hernansaa
      @hernansaa 27 дней назад

      @@djangoroad couldnt agree more. No BS, just good profesional content. Thanks a lot!

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

    This is the most simple tutorial I have seen. I found the mistake I was mounting the wrong config in nginx container. Thank you very much.

  • @adrianregister3967
    @adrianregister3967 15 дней назад +1

    without your video I'd have probably thrown my PC out the window by now. fantastic, thank you so so much

  • @irfanhazza
    @irfanhazza 3 года назад +10

    This vid is literally godsent, thank u so much!

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

    Thank you very much for this tutorial on deploying Django under Docker, Nginx as reverse-proxy and Gunicron as python web server. Really, it is perfect. Clear and efficient!

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

      serious this was clear nice and correct. thanks @Dot JA ruclips.net/user/DotJA

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

    This content is what I have been looking for, tons of thanks to you, keep going.

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

    Love you! Whoever you are!

  • @user-de9xw2bi8p
    @user-de9xw2bi8p 4 месяца назад

    Thanks a lot, it would be interesting to see using postgres as there are issues in deploying two containers and the communication between them

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

    one of the integral tutorials i have ever seen on django . thank you so much !

  • @i-am-learning-life
    @i-am-learning-life 3 года назад

    I was planning to go live and here you are 💓💓💓💓💓. I love this lady ❤️❤️❤️

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

    I am learning docker, and this is a gold inform I just got! Thank you for sharing it.

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

    One of the best content, and have quick bytes for ease to understand. Hats off to you. Keep up and make like these contents.

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

    Fantastic video, really helped solidify my understanding (or lack thereof).

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

    Muchisimas gracias!!! llevaba un rato atorado con con Django y sus estilos que no se cargaban, Muchas gracias

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

    This is exactly what i was looking for! I really can't stress enough how this has EXACTLY the information I was looking for! :D thanks a lot!
    this was my google search "docker django nginx gunicorn project tutorial" and i was hoping to see the creation of those files to understand what to write in them and why!

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

    That's real knowledge sharing. No begging for subscribers and likes as others do by compromising real knowledge sharing.
    Really appreciate, Thanks
    Subscribed ✅
    Liked ✅
    Commented ✅

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

      Thank you I appreciate it.

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

    Omg its amazing, thank you)

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

    Well prepared for the video and straight to the point !

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

    I noticed you don't respond to non-technical questions, So here it is, I don't yet know how to deploy local Django Project to AWS LightSail, You seem like someone knows how to do just that, So if you will, Make a video about it, Happy to learn from you.

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

    explanation is so simple. please make more this type of videos.

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

    Thank you very much for such a clear, elegant and efficient explanation. I was looking for a long time for the most suitable combination for my project and yours was the best, I really appreciate it a lot !!

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

    Thanks.....for guiding on Docker in layman terms.

  • @NekoManAICore
    @NekoManAICore 25 дней назад

    Te amo!!, muchas gracias!

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

    Crisp and clear … just awesome!!

  • @user-fs8vl4yi5w
    @user-fs8vl4yi5w 9 месяцев назад

    Briliant. Thank you very much for this tutorial!

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

    I can also say this works fine on windows 10 using WSL2 (linux app on windows). I used docker desktop to login and authenticate, and a Kali linux app to install nginx and then build the docker compose file

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

    Helpful, and your voice is relaxing.

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

    exactly what I'm looking for

  • @PradeepYadav-if7ty
    @PradeepYadav-if7ty 3 года назад +1

    you have such an awesome voice

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

    This video is very useful. Thank you so much, Dot JA!

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

    Very much helpful, Keep up the great work!

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

    Explanation is really good

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

    Greatly explained... Thanks a lot

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

    Thank you very much ! I love love your this guide.

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

    This is super useful, saved me so much time. Thank you!

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

    a godsent for my nearing exams!

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

    This video is very clear,thank you so much!❤

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

    Thank you very much. It's works perfect

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

    Short and to the point

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

    Thank you for this excellent tutorial, was super useful!

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

    Thanks for the content! You have a sweet voice ❤️

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

    thank u so much, It's very clear and it's very easy to understand.

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

    💯💯💯simplest nginx config

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

    Very cool, very easy. Thank's a lot for this good explanation (I like it even much more than the linked testdriven.io reference!)

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

      Thanks! I'm glad you liked it.

  • @Michael-nc3lp
    @Michael-nc3lp Год назад

    thanks for that.... really good and useful

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

    Very nice tutorial!!. Thank for this..

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

    I learned a lot from your videos. Thank you!

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

    This is fantastic, thank you dot ja

  • @user-db5sk7lf9m
    @user-db5sk7lf9m 3 года назад +1

    THIS VIDEO IS AWESOME!!

  • @nikosanapliotis9862
    @nikosanapliotis9862 2 года назад +5

    Since you are creating a docker image, is it necessary to include the creation of a virtual environment within it?

    • @mai_vaibhav
      @mai_vaibhav 9 месяцев назад +2

      i don't think there is a need for a virtual environment in docker image

    • @berndof
      @berndof 6 месяцев назад

      Nops

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

    you helped me a lot) thanks for useful info and pretty voice!

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

    thanks a lot, it works perfectly!

  • @user-ll2io6cs3r
    @user-ll2io6cs3r 3 года назад

    Fantastic tutorial!!! Huge thanks!!!

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

    Nice tutorial, thanks!

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

    Fantastic, straight to the point. Thank you.

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

    Thank you so much! You're awesome!!!!

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

    perfect! thank you very much!

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

    Amazing, it was really short nice and simple way of explaining whole scenario. Thanks a lot. 👀 You just made me to hit the subscribe button.

  • @user-mx4nt1hz4u
    @user-mx4nt1hz4u 3 года назад

    It is great! Thank you very much!

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

    Great explaination

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

    nice :) super clear video!!! Thanks a lot............

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

    Great vedio with clear concepts thanks a lot really helped me a lot :)

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

    Love your voice

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

    I should have found this sooner. Best tutorial in this regard so far. Do you mind making a tutorial for GitHub actions building this image and pushing it to docker hub?

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

      Hi, thanks for the feedback! I've a video about Github Actions here ruclips.net/video/oCu3_JKsYYc/видео.html
      Maybe you'll find it useful.

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

    Amazing, thank you so much.

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

    Thanks you so much!

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

    Wow you are excellent 😍😍

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

    Hey, thanks for teh video, but am getting this error , 'nginx: [emerg] host not found in upstream "django_gunicorn:8000" in /etc/nginx/conf.d/default.conf:2', What could be my mistake

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

      hi there, I have been having this same problem, did you end up finding out?

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

    awesome and clear, thanks

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

    Thanks so much

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

    Nice and clear. 👌👌

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

    Hello, really really nice video on django and docker deployment beats the 2hrs long some videos I have come accros on youtube. One question though, running this example on a remote server, will the gunicorn expose the django project to the remote host? Or how to do this on a remote host and use this like an actual deployment.

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

    Very nice. Fantastic

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

    Very informative video, kinda life saver :)

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

    Great content! What about setting up domain and let's encrypt SSL to ubuntu server?

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

      That would be great!!

  • @user-xd3zu3ks7o
    @user-xd3zu3ks7o 10 месяцев назад

    Thank you for your clear tutorial. It's really helpful. I would like to ask what if you don't want to expose gunicorn 8000 to outside, just via Nginx. How can we limit that?

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

    You should also shown the static content for the page because i followed tut and loading the admin site static file not for templates

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

    thnx so much....

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

    Thanks for this

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

    First of all Thank you very much for the good content. I have a question about not found /static/admin/css/base.css how to fix it

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

    Sorry but I missed something, I expected to be able to login in the admin but I do not manage. I guess I am overlooking something stupid because your presentation is very precise and informative.

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

      No worries, I think you need to create a superuser. This is usually done using 'python manage.py createsuperuser' but there are ways to do that programmatically so that it would be ready for you to use when you spin up the Docker container.

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

      @@djangoroad ok, so if I understand it correctly that should be an additional run instruction in the dockerfile?

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

      Yes in the case where you want everything to come into existence when you spin up the containers. This might be useful: stackoverflow.com/questions/30027203/create-django-super-user-in-a-docker-container-without-inputting-password

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

    You are awesome!

  • @juanseg5562
    @juanseg5562 9 дней назад

    ey men, can you do a video that explain how deploy django whit ngnix, daphne, docker and kubernetes

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

    It was amazing!

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

    Thanks for amazing content. Just one question, how can we configure redis and celery with this project..?

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

      I will try to make some content on that in the future.

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

      @@djangoroad Thanks so much

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

    Please, make a video tutorial using traefik + django + gunicorn + nginx

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

    Those who face problem while spinnig up container , replace below line FROM nginx:1.22.0-alpine
    on nginx docker file

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

    Nice

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

    Nice tutorial, What about I have a ubuntu server running nginx, so If I open the port 80 of the container on port 80 of the server shouldn't I get error? Can't we just pass the static files path in Gunicorn?

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

    Realy fantastic video but what about database configuration plz

  • @shibainu5089
    @shibainu5089 11 дней назад

    Can I use nginx to serve media file? I mean, media uploaded by user

  • @ShubhamKumar-fy1fl
    @ShubhamKumar-fy1fl Год назад

    My static files are not loading. I followed the same and very precise with giving the location of static files and volume mapping. Can anyone help me on that part?

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

    Hello! I can only enter my app from port 8000, without the position as you do, I get an error 504

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

    How should I stop this 8000 port? my code is running in 80 and 8000 then it is not good practice

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

    I follow your tutorial and made some changes. I used only one container for gunicorn and nginx. But one problem I am facing is after calling gunicorn in entrypoint.sh upcomming next command not working. Fot that reason my nginx not starting I have to start nginx manually. Any Suggestion from your side?

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

    hi my static files are not served can you please guide me for this.

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

      Do you want to have a look at the repo on Github github.com/dotja/django-docker-compose

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

    tnx

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

    Hi. It works well for me but I can't see the volume or images when I run `docker volume ls` or `docker images`. It works fine and can clearly see in the logs that the images are created but I don't know why I can't see the volume or the image.

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

      Already resolved.
      I just need to do "sudo" in every command and everything works well.
      Thank you!

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

    Thanks for the contents,
    I am facing one problem
    I have a one data folder in project directory. It contains some files that requires for running some apps reading data from that files.
    Should I keep that files in django container or create another volume for the files?

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

      A docker volume is used for persistent data for example any data that your app generates or modifies and that you want to preserve.

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

    ModuleNotFoundError: No module named 'myown_nproject' after docker-compose up,, can you help me?