Docker | How to Dockerize a Django application (Beginners Guide)

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

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

  • @veryacademy
    @veryacademy  3 года назад +34

    #####
    CAN YOU SPOT THE ERROR IN THIS TUTORIAL? It is April 1st here don't forget! 😜
    The docker ignore file does not have 2 dots 😂 - just .dockerignore and should read venv not */venv
    #####

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

      HAHAHAHAHA SO FUNNY !!!! HE CHANGED THE NAME OF THE FILE OMFG 😂😂😂😂😂😂😂😂😂😂😂😂

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

      @@olivierchabaut6515 a kto to przyszedł? pan maruda niszczyciel dobrej zabawy pogromca uśmiechów dzieci

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

      thanks for all

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

      And this took me an hour to figure out :(

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

      vs code doesn't allowed to save file as double dot..i was wondering at first haha

  • @ReneAshu-fb5fd
    @ReneAshu-fb5fd 10 месяцев назад +3

    This guy is the BEST teacher. He is a MUST WATCH and follow. Don't go anywhere else. Save this guy at all cost. We who are self thought all know the frustration of looking for a teacher who syncs with you. You have found it here, don't waste your precious time elsewhere.

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

    Couldn't find a simpler explanation absolutely great stuff , Thank you

  • @hassanelabdallah5013
    @hassanelabdallah5013 3 года назад +11

    2 days i asked you about docker, and you posted a video about it today.
    Thank you very much ❤️

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

      Sorry you waited so long! 😜👍

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

      @@veryacademy sir , sir we are faceing many issue in pytest ....is there any blog or someyhing to help ? plz plz i badly need it

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

      @@saikatmukherjee8095 Sorry I don't have a blog or anything

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

      @@veryacademy okk sir...but your videos ...are very helpful

  • @DS-bz4mz
    @DS-bz4mz 2 года назад +4

    Brilliant tutorial: easy to follow, explaining everything you need to know to get started without getting into unnecessary details and, I can't stress this one enough - the font is zoomed in enough to be readable in split screen. Thank you

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

    honestly, this is the best content I could find on youtube about the topic, Thanks!!!

  • @moondays7907
    @moondays7907 3 года назад +6

    I don't get it why you have just 159 likes, guys make it 10K immediately!!

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

    This is outstanding- appreciate you explaining in a simple way

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

    This series is gold!! Thank you so much. I’ve been looking for an awesome Docker course. Now I have one.

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

    This video was really helpful. Docker file is different from a programming language or framework to another. It's also depends on the dependencies and requirements of a specific project. So, it was very important to me find a tutorial that helps me configure docker file for my Django project. Thank to Zander I managed to run my first docker container.

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

    I just got to your channel ... I'm going to enjoy this excellent docker tutorial ... I think your channel has excellent audiovisual quality, I'm subscribed Zander..! I´ll enjoy all your content ... thanks so much once again ... and a lot success!

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

    hooked on your tutorials....nice and easy pace..thanks

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

    thank you so much for this useful tutorials.

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

    I had lots of ambiguities about Docker and tried many times to download it and then delete it because I didn't know how to use it and what it is used for. This is by far the best tutorial about Docker for beginners. I thank you for making this video.

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

    We need more this kind of video, Please consider making a video on docker-compose. Thank You.

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

    Great tutorial! I've used a more recent Python image and followed it on a Mac, but it all worked for me. Many thanks for doing this!

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

    the best video on docker and django !!!

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

    EXTREMELY USEFUL.. THIS REAALLY GOT ME TO UNDERSTAND.. THANKSSS

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

    Thank you Very much. This tutorial saved a lot of my time. Kudos to you for such a neat and simple explanation!!

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

    Thank you for a great video explanation!

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

    Thank you for all the great tutorials👏👏👏

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

    This is an amazing tut!! Thank you

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

    Your explanation is very good, thank you!

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

    thank you as always!! amazing explanation

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

    Great Video, Thanks for your effort

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

    So thanks you

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

    Well Explained Mate Thanks You!

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

    OMG yes so simple and sweet thank you!

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

    Thank you sir. This tutorial work to my application 👍👍

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

    Very good, thank you!

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

    Thanks Zander for amazing content. This is the most amazing channel when it comes to python tutorials. You are real gem contributing to the community. Cheers and keep up the good work.

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

      You're very welcome! Thank you!

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

    Thanks for this video, so many tutorials out there seem to be copied from the same source, and all try to crutch on compose files without actually explaining them, this is the one place on the internet where it's explaned how to run a django project in a regular Dockerfile setup, rather than compose.

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

    What an amazing course!! Thank you very much! You are excellent teacher!

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

    What a clear tutorial I really loved it. Thank you so much

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

    Great job man, thank you very much!

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

    Awesome as always 👍😀

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

    easy to follow. brilliant explanation.

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

    Awesome tutorial!

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

    Oh this is GREAT !

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

    Another great video! Many thanks. I tried Docker a while ago but ran t the deep end and it just seemed overly complicated.. but starting with a basic project has been a great way to see it.

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

    really helpful! thank you

  • @phichayaphakphiphitphatpha3695

    Very thank Zander, good content.

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

    pretty explaination dear ... :)

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

    Awesome, thanks! Well explained.

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

    Thank you Zander!! Badass name btw

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

    golden! thank you!

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

    Dude thank you !!!!!

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

    Great tutorial, I really appreciate your explanation. 👍👍

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

    Excellent .

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

    Thanks bro, God bless

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

    Very clear explanation, thanks alot 😊

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

    Awesome

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

    you are very generous !

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

    that's great ... thanks a lot.

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

    Excelent!!😀

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

    Thank you very much.

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

    Thanks a lot

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

    Amazing!!!

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

    Can you add a follow up video showing how to serve static/media files ?

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

    as always, you've explained it all so well.
    I'll be trying this on a raspberry pi 🙏

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

      Long time no see - hope you are well. Let me know how you get on! Presume you have a newer version with enough RAM 👍

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

      ​@@veryacademy Thank you Zander. All is well, I hope you are doing good too.
      It all worked fine but yes the RPi3b is a little slow at take off :-) I have a pi4 too I will try it on.
      might be worth mentioning that people can run the command using -d to leave the terminal window free to do other things or shut down.
      On to your next tutorial ... Thanks again for all your brilliant tutorials and keep up the great work

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

    @Zander Thanks for this tutorial. Please what's the difference between virtual environment and docker? thanks.

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

      Here is a good resource - if not get back to me
      www.simplilearn.com/tutorials/docker-tutorial/docker-vs-virtual-machine

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

      @@veryacademy The article was informative now I clearly understand the difference. Thanks.

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

    thank you!

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

    Super

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

    python: can't open file '/a/manage.py': [Errno 2] No such file or directory

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

    thank you man

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

    so good, ty a lot

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

    thank you sir

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

    Thanks a lot!

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

    how can i configure jenkins job for cicd. it would be really helpful if you can make video for same. thanks in advanse

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

    [lease can you make video on how we deploy django with docker

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

    I can't wait to finish all the courses in your channel but i dont get enough time! ugh.

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

      I know how you feel! I want to get them finished!

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

    Thank you for sharing such a great video. It helped me alot to understand many ways. I would request to post one video on docker with celery, rabbitmq, nginx

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

    Thanks 👍👍 ...
    Waiting for the database integration with django and docker

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

      Will record that tonight if all goes well. That is part 2 - Docker compose. Will go straight into PostgreSQL setup. Then part-3 using volumes so that you can work with docker in a 'live container environment'.

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

      @@veryacademy thanks a lot

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

      @@veryacademy How about a part four: "deploying django in a docker container"? :)

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

    How does one use docker to deploy Django to a service like Linode, Heroku, Etc?

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

    Huge thanks

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

    Is there a way to run Vm without hyper-v? i got this situation where my pc cant have hyper-v

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

    Finally, some blue 🚬..
    Thanks Sir

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

    Great tutorial, saved my life.
    Since my Django project was way bigger I had some requirements which were not been able to build, if anyone comes across same error adding this code to Dockerfile worked for me:
    RUN apt-get update && apt-get install -y --no-install-recommends \
    unixodbc-dev \
    unixodbc \
    libpq-dev

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

    Thank you for this! But I imagine this is not usable during development, right? I mean, we have to rebuild every time we make changes to see those. Or am I missing something?

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

      I will show you the way in part 3 😎 sure you can 👍

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

      @@veryacademy Cool! Looking forward!

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

    Every time I install a new package the compose run again and I should wait for it too long? is that how it works or there is some wrong ?

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

    Thnaka

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

    Question: Is it absolutely necessary to create venv and instat django? Is it not possible to install djangk in docker and create files locally?

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

    if i run your docker file on a server, how do I make it accessible by others ? do I need something like nginx ?

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

    Make a series on Flask just like you made one for Django

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

      Thanks Rahul, when the time comes I will do more Flask, I have such a small windows of time to make these it is impossible to do to much at the minute. 👍

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

    It is not correct to say that if a django app runs fine on the local machine and after containerizing it if the container runs on AWS/Azure then the app will run fine on AWS/Azure. Not true. In docker we are just talking about running the container on different environments so as to collaborate. But there is no guarantee that the app will run the same in the runtime environment of the server as it ran on the localhost

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

    hello when I run docker run --publish 8000:8000 aljon-django after the build. Disregard the image name the result is Watching for file changes with StatReloader

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

    when you use COPY . .
    is it going to COPY again the requirements.txt that you already copied before?
    Why is it necessary to COPY the requirements.txt before the overall command COPY . . ?

  • @ExponiendoalosLacayosMen-tw2no
    @ExponiendoalosLacayosMen-tw2no 6 месяцев назад

    I could experience the problems of not using Docker very clearly one day. I developed one django app in my linux machine. Then I thought I could just copy the entire project and make it run on windows machine using pycharm. Catastrophic, all kinds of errors, I could not launch the application, it would not even recognize the python interpreter.

  • @anilyadav-ln8qu
    @anilyadav-ln8qu Год назад

    thnx u

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

    Hello,
    Can you share .env.sample :)

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

    some things might be not so easy on WIN10... for instance, when several installations of python are present on computer. .\venv\Scripts\activate for instance, default port might be forbidden and some other can be used. It was somewhat messy while defining settings, uls, views and templates file. Maybe gitignore would be an option if everything is versioned... When building image, it can be seen it was already run in the terminal... however, more clear syntax would be: docker build -t 'python-django' -f Dockerfile . In video, when running container, it is not clear which port is host, and which is container. Besides that, very nice explaining, I would dare to say the best available on this topic. However, I would suggest to mention more possible issues that could appear during the process.

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

    /bin/sh: 1: [python, : not found....? And yes i used double quotes instead of single in CMD.....any help?

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

    when I provide docker run --publish 8000:8000 python-django,
    I am stuck at this :
    "Watching for file changes with StatReloader" .
    How to fix this ? Thanks ! :)

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

    I thought that runserver was really built for development and is not wise to use in production

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

    Hi, please help
    After command: docker build --tag python-django .
    I have: 'docker' is not recognized as an internal or external command,
    operable program or batch file.
    How fix this?

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

      if you just installed docker - might need restart. Else docker is not in the path so you cant call it from the terminal, one of many solutions. Try installing docker again.

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

    Is this something I could follow on linux?

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

      Noted. I did aim to also perform the same tasks on linux.

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

    Hello, when I try to do docker build it gives me the following error "Could not find a version that satisfies the requirement rest_framework==latest (from versions: none)" and I have no idea what should I do. Could anyone help please?

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

    Could you explain how to solve ''You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, sessions." ?

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

      Python3 manage.py migrate (type this in terminal)

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

      @@veryacademy Thank you so much for the reply. Could/should we include this command in our Dockerfile/docker-compose? Should we do this with `docker exec` in the container Or do we just do this manually before we build a new container?

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

    Is there any reason why you are renewing this tutorial? I have already watched the old one.

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

      These will be the 2021 refresh - I will remove the old ones eventually. I am building a whole course also at the minute which will lead us on to Kubernetes. I also missed a few important points in the first tutorials and had some other feedback which will guide me on the next few tutorials. I also want to keep the google algorithm happy with content. This content is also quick to build at night when I am tired and can’t focus on anything too heavy. 👍

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

      @@veryacademy It's awesome, no complaints from me. Are you also going to add daphne for deployment of django channels app? BTW I tried to deploy a docker app using your and some other tutorials and codes but I got an error that I don't have permission to create or change the sqlite file. I couldn't find any solution to my problem. I didn't know what I was missing, I was using the root user.

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

    i didnt understand docker ignore file

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

      If there are any files you don’t want to be part of your docker image you define it in the docker ignore file. So for example you might make a new docker image from a project folder, in that folder you have some notes files you use to help you work, you don’t want this part of your docker image when you build one, so you ignore those files by defining in the ignore file