Deploy a Django web app with Nginx to Amazon EC2

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 พ.ย. 2024

ความคิดเห็น • 322

  • @CloudWithDjango
    @CloudWithDjango  ปีที่แล้ว +19

    Sample gunicorn.conf:
    [program:gunicorn]
    directory=/home/ubuntu/elevate
    command=/home/ubuntu/env/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/elevate/app.sock elevate.wsgi:application
    autostart=true
    autorestart=true
    stderr_logfile=/var/log/gunicorn/gunicorn.err.log
    stdout_logfile=/var/log/gunicorn/gunicorn.out.log
    [group:guni]
    programs:gunicorn
    Sample django.conf:
    server{
    listen 80;
    server_name ;

    location / {
    include proxy_params;
    proxy_pass unix:/home/ubuntu/elevate/app.sock;
    }
    }
    IMPORTANT NOTE:
    Hi all,
    Please note that you will have to setup your static and media files as well - I'd suggest using Amazon S3.
    Here is a tutorial on how to setup Amazon S3:
    th-cam.com/video/JQVQcNN0cXE/w-d-xo.html
    You will also have to setup your database as well - I'd recommend using a PostgreSQL database.
    Here is a tutorial on how to setup a PostgreSQL database with Render for FREE:
    th-cam.com/video/AgTr5mw4zdI/w-d-xo.html

    • @bawer_my
      @bawer_my ปีที่แล้ว

      Thank you!!
      *if you pin on top this comment it will be more visible

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว +1

      @@bawer_my My pleasure. Thank you for letting me know, I forgot to pin it.

    • @joshijax
      @joshijax ปีที่แล้ว

      i think i have a solution this hsould work
      sudo supervisorctl restart guni:*
      sudo service nginx restart
      sudo nginx -t
      sudo supervisorctl reload

  • @toddgilbey3979
    @toddgilbey3979 6 หลายเดือนก่อน +1

    Thanks to you, I have now managed to deploy my site without needing the server running in the background. One of the few tutorials here that actually works!
    Amazing content

    • @CloudWithDjango
      @CloudWithDjango  6 หลายเดือนก่อน

      It's a great pleasure! Thank you for your comment! Glad you liked it!

  • @defendersart3051
    @defendersart3051 11 หลายเดือนก่อน +1

    One or 2 thing I wanted to learn more.
    1. How to put custom domain with ssl protection?
    2. With provided guide, will it manage static files too? Like image uploading of users , staffs, or media files?
    Kindly reply!

  • @burakcankurtarr2751
    @burakcankurtarr2751 ปีที่แล้ว +8

    Can you make a video about "How to setup SSL and domain name on AWS ?" And maybe a video about "How to setup database and email service(SMTP) on AWS ?". You're really teaching in a simple way and i like it. And it works when I do the same steps as you did on the video(People who watch tutorials will understand it :DD)

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว +5

      Hi Burak,
      Thank you for your suggestions. I will try to look into that If I manage to get some time. The "How to setup an SSL certificate and a domain name on AWS" is a very good recommendation that I would like to cover. A few other people have also asked me to cover it.
      I do have some video's on that which you can find in my AWS fundamentals playlist. However, I would like to cover this if I can with an EC2 instance though - so that it is more complete.
      Thank you, I appreciate your feedback! I'm glad that you are enjoying my content and that you can follow them nicely. Hahaha... I get what you mean. Yes, I triple check my videos before I upload them to ensure that anyone who can read and type can do it.
      Patience is the name of the game, and I'm glad that you and many are (when it comes to following tutorials and learning) :)
      All the best,
      Arno

    • @mecrayavcin
      @mecrayavcin 3 หลายเดือนก่อน

      ACM servisi ile ssl alirsan yaparsin bedava

  • @Md.-Tazul-Islam
    @Md.-Tazul-Islam 7 หลายเดือนก่อน

    A lot of thanks to you because I deployed a website successfully.

    • @CloudWithDjango
      @CloudWithDjango  7 หลายเดือนก่อน +1

      Thank you so much! Glad that you managed to get your website deployed!

  • @KlausBentes
    @KlausBentes ปีที่แล้ว +8

    For anyone having the same issue I was having with FATAL or BACKOFF or STARTING errors, the only thing that worked for me was first installing what was in my "requirements.txt" file.
    1. cd into the project folder then run this:
    pip install -r requirements.txt
    2. Make sure your "gunicorn.conf" is correct and then try checking the status again.
    Remember to replace the "elevate.wsgi:application" part with "[your folder name that includes wsgi].wsgi:application".

    • @leggo15
      @leggo15 ปีที่แล้ว

      You sir, are awesome

    • @manishgohel5723
      @manishgohel5723 10 หลายเดือนก่อน

      worked thank you@@leggo15

    • @palnetfamily8772
      @palnetfamily8772 6 หลายเดือนก่อน

      How can I setup a django project that uses websockets? ASGI_APPLICATION.

    • @ianalpha1917
      @ianalpha1917 2 หลายเดือนก่อน +1

      This worked for me thanks! Though i had to restart supervisorctl processes with 'sudo supervisorctl restart all'

    • @hroman_codes
      @hroman_codes 8 วันที่ผ่านมา +1

      @@ianalpha1917 Yes this last command really helped I was stuck after installing my requirements.txt thank you!

  • @elixar_
    @elixar_ 5 หลายเดือนก่อน +1

    Please create a SSH key, its just the matter of a single click, and no harm is done. It will be a lot harder to set it up after the instance is created. The SSH key will be needed to access the instance from our terminal. it is far better than connecting from aws website.

    • @CloudWithDjango
      @CloudWithDjango  5 หลายเดือนก่อน

      Thank you for your input and suggestion!

  • @dharmrajmagdum9093
    @dharmrajmagdum9093 ปีที่แล้ว

    best...far better than all other complex processess in blogs😃🙂🤗

  • @for_we9296
    @for_we9296 8 หลายเดือนก่อน

    in my first attempt i have host website because of your video

    • @CloudWithDjango
      @CloudWithDjango  8 หลายเดือนก่อน

      Hi,
      Thank you for your feedback. I'm glad that you managed to deploy your first website! All the best to you!

  • @Yacine.Benchabane
    @Yacine.Benchabane 2 หลายเดือนก่อน

    Thank you , Is this how it is done in practical environments?

    • @CloudWithDjango
      @CloudWithDjango  หลายเดือนก่อน

      My pleasure! It's a start, but you will still need to configure environment variables as well, set up static files/media files etc. as well

  • @theodorechoi9184
    @theodorechoi9184 ปีที่แล้ว +9

    I just did this tutorial and everything works up until the end. I still get a bad request(400). I thought maybe it was the ALLOWED_HOSTS, but I added the ALLOWED_HOSTS and it still gets the bad request. Does it have to do with HTTP?

    • @victorvincent1247
      @victorvincent1247 10 หลายเดือนก่อน +1

      I face the same issue. Watch many tutorial about gunicorn and nginx to deploy my websites. But in the end I also get bad request (400). Have you found the sollution for it?

    • @michaellai327
      @michaellai327 8 หลายเดือนก่อน

      Same

    • @ifeanyinnoka1961
      @ifeanyinnoka1961 7 หลายเดือนก่อน +2

      Had the same issue. Restarting gunicorn using 'sudo supervisorctl restart all' while in the '/etc/nginx/conf.d' directory worked for me.

    • @Fede_uyz
      @Fede_uyz 2 หลายเดือนก่อน

      ​@@ifeanyinnoka1961 im getting a 502, maybe the same?

  • @gregocanepa
    @gregocanepa ปีที่แล้ว +4

    dude your tutorials are amazing! first time setting up nginx manually, learnt lots of stuff today

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Thank you so much, Gregorio! I appreciate it.
      I'm glad that you are learning a lot :)

  • @elmflor4365
    @elmflor4365 11 หลายเดือนก่อน

    I've stumbled upon your channel and its you've been a godsend THANK YOU SO MUCH. I cant wait to start your Udemy course if it's anything like your tutorials. I'm not religious but god bless you.

    • @CloudWithDjango
      @CloudWithDjango  11 หลายเดือนก่อน

      Thank you so much for your kind and sincere message. I'm glad that you've been enjoying the content and that you have enrolled in my Udemy course! I really appreciate that! Happy learning to you!
      Haha, thank you so much!
      All the best!

  • @gera3769
    @gera3769 11 วันที่ผ่านมา

    18:00 keep run in the background your EC2

  • @HasanMoni-q2g
    @HasanMoni-q2g 9 หลายเดือนก่อน

    Special thanks brother from another mother.
    You save my time.
    I will buy a ice cream for you.

    • @CloudWithDjango
      @CloudWithDjango  9 หลายเดือนก่อน

      Haha, thank you I appreciate your sense of humour too!
      Anytime, it's a pleasure!

  • @ramn4775
    @ramn4775 ปีที่แล้ว +1

    I have developed new django project,want to deploy it on ec2 where another django project is alreday deployed..Could you please tell me how to deploy new project and how to configure the APIs

  • @InformatikEinfachGemacht
    @InformatikEinfachGemacht 7 หลายเดือนก่อน

    could you please make a final video about the domain configuration? Thanks a lot for the great video

    • @CloudWithDjango
      @CloudWithDjango  7 หลายเดือนก่อน +1

      Thank you for the suggestion and for the support.

  • @ahmadumar9387
    @ahmadumar9387 ปีที่แล้ว +2

    very usable for every django developer

  • @vangauce3864
    @vangauce3864 ปีที่แล้ว +1

    Thanks for the video, easy to understand and very complete, you deserve many more visits my king.

  • @g33kgu
    @g33kgu 10 หลายเดือนก่อน

    Thanks a lot for your advise.
    I could not set up the py env; at the end, I create a gunicorn service

    • @CloudWithDjango
      @CloudWithDjango  10 หลายเดือนก่อน

      No worries.
      Okay, well I'm glad that you found a solution that works for you

  • @enricosaccheggiani3192
    @enricosaccheggiani3192 ปีที่แล้ว +3

    Great video, well explained in every single detail . Thanks a lot

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      My pleasure, Enrico! :)
      Thank you for your feedback!

  • @nimish8775
    @nimish8775 ปีที่แล้ว +1

    how to deploy multiple django projects on single ec2 instance, what changes we need to make?

  • @NoxuzBlog
    @NoxuzBlog 9 หลายเดือนก่อน

    great step by step tutorial

  • @jacobrivera405
    @jacobrivera405 11 หลายเดือนก่อน

    Awesome Video! How do you go about creating a superuser. Do I have to do that in the Nginx/guincorn connection window?

    • @CloudWithDjango
      @CloudWithDjango  11 หลายเดือนก่อน +1

      Thank you!
      If you are connected to your production database locally. You can simply in django write like normal the command for creating a superuser. A lot simpler.

  • @sanketkumar_coder
    @sanketkumar_coder ปีที่แล้ว

    Its literally started working really well...except not serving static files

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi Sanket,
      I'm glad that you got your app deployed, but the static files part is something that you need to configure separately. The app demonstrated also doesn't have static files.
      Please see the pinned comment for more detail.

  • @miltondossantosarmando9738
    @miltondossantosarmando9738 ปีที่แล้ว

    All this steps are easy and i can do even sleeping, so bring a video of how to enable static file on production and tell the difference between django project in dev vs prod for the context of static files

  • @gagikkhalafyan8731
    @gagikkhalafyan8731 3 หลายเดือนก่อน

    A life saving tutorial! Thank you so much!

    • @CloudWithDjango
      @CloudWithDjango  3 หลายเดือนก่อน

      My pleasure! Glad that it helped!!

  • @eneseren8332
    @eneseren8332 ปีที่แล้ว +2

    For the
    guni:gunicorn BACKOFF Exited too quickly (process log may have details)
    OR
    guni:gunicorn FATAL Exited too quickly (process log may have details)
    error. I've did some search from the forms and finally found my solution.
    change this:
    command=/home/ubuntu/env/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/[your top level folder]/app.sock [your folder name that includes wsgi].wsgi:application
    to this:
    command=/home/ubuntu/env/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/[your top level folder]/app.sock [your folder name that includes wsgi].wsgi.dev:application
    That simple word solved my error also i read from the forms that most of the errors are about typos. So check your directory, file and folder names double.

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว +3

      Thank you for providing additional clarity for others!

    • @khanhmai7057
      @khanhmai7057 ปีที่แล้ว +1

      I was also getting this BACKOFF error because of wsgi file is nested in my project repo
      my filetree looks like this:
      projectName
      -->backend
      -->wsgi file
      so I had to change my directory value to directory=/home/ubuntu/projectName/backend
      everything else in my gunicorn.conf i followed the tutorial. thank you for this video! and thank you to the OP that posted this comment. super helpful

  • @defendersart3051
    @defendersart3051 11 หลายเดือนก่อน

    Is 13:01 it mandatory to say python3 , of If someone wants to move ahead with latest python version. Or it is the only way?
    Your reply will helpful for me & for others too.
    Thanks for making django deployment videos.

  • @financelab_ai
    @financelab_ai ปีที่แล้ว

    Awesome! Everything is up to date and working.

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Thank you so much! I'm glad that you enjoyed the content!

  • @kennysaenz1789
    @kennysaenz1789 8 หลายเดือนก่อน

    you're an excellent teacher bro.! i can do it without problems love u :3

    • @CloudWithDjango
      @CloudWithDjango  8 หลายเดือนก่อน

      Thank you so much! I'm really glad to hear that you can manage with ease! :)

  • @bijudonbosco
    @bijudonbosco 7 หลายเดือนก่อน

    What's the use of supervisor & gunicorn?

    • @CloudWithDjango
      @CloudWithDjango  7 หลายเดือนก่อน

      Hi,
      Supervisor is a process control system for Unix-like operating systems, which helps to manage and monitor processes, ensuring they stay up and running even after unexpected failures or crashes.
      Gunicorn (Green Unicorn) is a Python WSGI HTTP server for Unix, which allows you to run Python web applications. It's often used to deploy web applications written in frameworks like Django or Flask, providing concurrency and scalability to handle multiple requests efficiently.

  • @binhnguyen-hb4lp
    @binhnguyen-hb4lp 4 หลายเดือนก่อน

    It is so great! Thank you so much. Hope you teach how to install SSL for https with ec2

    • @CloudWithDjango
      @CloudWithDjango  4 หลายเดือนก่อน

      Thank you! Of course, It's my pleasure! I appreciate the suggestion, thank you!

  • @prudhvisuryapuluri7028
    @prudhvisuryapuluri7028 11 หลายเดือนก่อน

    Even AI tool was unable to expalin clearly...Thank you so much for your explanation Love From India
    please help with mern project as well on aws server...thanks a lot

    • @CloudWithDjango
      @CloudWithDjango  10 หลายเดือนก่อน

      Thank you for your comment and for the suggestion!

  • @trippybunn
    @trippybunn 8 หลายเดือนก่อน

    thanks for the video!
    one question: this works if I associate my instance with an elastic ip and put that ip in the server name field?

    • @CloudWithDjango
      @CloudWithDjango  7 หลายเดือนก่อน

      You're welcome! Using an Elastic IP and inputting its address into the server name field should work for associating your instance with a static IP address for various services, such as hosting websites or remote access like SSH or RDP. However, the specific functionality and setup would depend on the requirements of your application or service.

  • @chetanvashisth3005
    @chetanvashisth3005 11 หลายเดือนก่อน

    Can you do one with Apache???? That'll be very helpful. As there are none explaining the same

    • @CloudWithDjango
      @CloudWithDjango  11 หลายเดือนก่อน

      Thank you for your suggestion!

  • @palnetfamily8772
    @palnetfamily8772 6 หลายเดือนก่อน

    How can I deploy my django backend that consists of channels, websaockets

  • @Nikhil-Tomar
    @Nikhil-Tomar ปีที่แล้ว +1

    Isn't root in nginx a security issue also we can change folders permission to www-data so nginx could read files or we can rename www-data with current logged in user, I feel root is not the most secure way to go.

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi,
      Thank you for your question.
      Not necessarily, it all depends on your architecture and how many users you will have working on your application. Besides, the idea is to get you started with deployment. There are plenty of other things that I would've liked to cover, but it would've made for too much of a long video in one. So, if you would like to add some extra things, you will need to do some additional research on-top of this.

  • @eldjdiestro
    @eldjdiestro 11 หลายเดือนก่อน

    Hello, the video is excellent, it helped me a lot but I have a problem, I bought a domain on route 53 and linked it to the IP that ec2 gives us but it does not show me my site, it only shows me the main screen of nginx, if I access The IP shows me the site, I don't know if I have a little information to ensure that my site is displayed correctly, I thank you in advance for your tutorials

    • @CloudWithDjango
      @CloudWithDjango  11 หลายเดือนก่อน +1

      Hi,
      Thank you very much!
      Please ensure that the Nginx server block for your domain in the configuration file specifies the correct server_name matching your domain. Additionally, confirm that the DNS settings in AWS Route 53 point to the correct EC2 instance's public IP address.

  • @fastpanda
    @fastpanda 11 หลายเดือนก่อน

    As you cloned a repo from Github, that's fine for a new project. However, I wanted to ask - how do you apply updates to your Django project from the updates pushed to your repo on the Github? Thanks

    • @CloudWithDjango
      @CloudWithDjango  11 หลายเดือนก่อน

      Hi,
      The simple way to do so would be to re-clone your GitHub repo as a means of grabbing updates.
      A more advanced way would be to set up a pipeline of sorts for automation.

  • @marookegberosamuel
    @marookegberosamuel ปีที่แล้ว +1

    This was super helpful. Thank You!
    I get this response:
    guni:gunicorn BACKOFF Exited too quickly (process log may have details)
    When I run the supervisor status command.
    Any pointers as to what might be the cause please ?

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว +1

      No problem, glad to help.
      Ah, so this is because you configured your settings wrong. I'd recommend retrying the process and taking your time, it is very easy to make a small mistake. It happened to me a lot.
      I'd recommend that you double check your gunicorn.conf file. It needs to be exact. Then it'll work.

    • @marookegberosamuel
      @marookegberosamuel ปีที่แล้ว

      @@CloudWithDjango Thank You !

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว +1

      @@marookegberosamuel My pleasure!

    • @Mrg33446
      @Mrg33446 ปีที่แล้ว +13

      i know it was 3 month, but i write this for new viewers, add in the .conf file " startsecs=0 before autostrat=true"

    • @marookegberosamuel
      @marookegberosamuel ปีที่แล้ว +1

      @@Mrg33446 oh, thanks ! I fixed it already. Thank you for help !

  • @warisruzi
    @warisruzi ปีที่แล้ว +1

    This was super helpful for me. Thank You!
    But when I enter the command 'sudo supervisorctl status', it displays 'STARTING' instead of 'RUNNING'. (#24:52 )
    and page show :
    __________
    502 Bad Gateway
    nginx/1.18.0 (Ubuntu) error.
    _______
    i also check it
    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf test is successful
    it's fine .
    Do you have any suggestions on how to fix this issue? Any help would be appreciated.

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว +1

      Hi,
      Thank you for your feedback it is appreciated.
      I would recommend double checking your django.conf settings as well.
      Unfortunately, it can only be a configuration issue.
      It is very easy to make even the smallest mistake with Nginx. It took me a long time to set it up correctly the first time.
      So, I'd recommend re-watching the video tutorial and checking everything meticulously from a space to a line to a semi-colon.
      Good luck!

    • @dragonixZXgames
      @dragonixZXgames ปีที่แล้ว

      Did you ever solved this? I keep doable checking the file and all looks the same. But I still get STARTING.

  • @sunnysolanki
    @sunnysolanki ปีที่แล้ว

    Thanks for such a detailed tutorial. Really appreciate it.

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      It is a great pleasure! I'm glad that you enjoyed it!

  • @razorhxh7371
    @razorhxh7371 ปีที่แล้ว

    Hi Sir. If I make changes to my django application and push the changes to GitHub, how do I update the changes on the terminal? Would be great if you can make a video on setting up a CI/CD pipeline on AWS to automate that process.

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว +1

      Hi.
      You would need to re-clone your application, and ensure that supervisorctl is running. To update the change.
      I appreciate the suggestion on CI/CD with AWS.

  • @bibinkunjumon
    @bibinkunjumon ปีที่แล้ว +1

    Seriously...do we need this much setup to run one app????

  • @majidbenam1328
    @majidbenam1328 10 หลายเดือนก่อน

    Amazing job man. I loved that.

    • @CloudWithDjango
      @CloudWithDjango  10 หลายเดือนก่อน

      Thank you so much! I'm glad that you found it helpful!

  • @rakeshmali1727
    @rakeshmali1727 11 หลายเดือนก่อน

    can you also explain the app.sock file for beginners?

    • @CloudWithDjango
      @CloudWithDjango  11 หลายเดือนก่อน

      Hi,
      Sure, I can give a brief description. The "app.sock" file typically represents a Unix domain socket used for communication between a web server and a web application, facilitating efficient and secure data exchange.

    • @rakeshmali1727
      @rakeshmali1727 11 หลายเดือนก่อน

      @@CloudWithDjango ohh..thanks for the info. and your quick reply! :)

    • @CloudWithDjango
      @CloudWithDjango  11 หลายเดือนก่อน

      No worries at all! :)

  • @mufarofungurayi5568
    @mufarofungurayi5568 11 หลายเดือนก่อน

    Thank you very much. Your tutorial(s) are top tier. Be blessed

    • @CloudWithDjango
      @CloudWithDjango  11 หลายเดือนก่อน +1

      My pleasure! Thank you so much! I'm glad that you are enjoying the content! All the best to you!

  • @soundaryavadavi5813
    @soundaryavadavi5813 10 หลายเดือนก่อน

    I purchased a domain on GoDaddy,pls explain me how to host my django application on ec2 with my custom domain

    • @CloudWithDjango
      @CloudWithDjango  10 หลายเดือนก่อน

      Hi,
      You would need to first of all refer to AWS Route 53 and set your dns records there, and then refer to Amazon Certificate manager for the ssl/tls certificate. Only after that you can you set your domain name in allowed hosts within your django application

  • @thehitboy7602
    @thehitboy7602 7 หลายเดือนก่อน

    Hi! If I make changes to the code, what should I do after I pull them in the AWS console? Should I reconfigure my Django file? Should I restart something?

    • @CloudWithDjango
      @CloudWithDjango  7 หลายเดือนก่อน

      Hi,
      All you'd need to do is reclone your project from github as you initially did

    • @thehitboy7602
      @thehitboy7602 7 หลายเดือนก่อน

      @@CloudWithDjango Correct me if I’m wrong to assume that by recloning you mean deleting the existing project and cloning another one, since you can’t reclone two identical projects. If you meant pulling the changes and modifying the existing project directory, is this the only thing I need to do?

    • @CloudWithDjango
      @CloudWithDjango  7 หลายเดือนก่อน

      Hi,
      Recloning typically refers to deleting the existing project directory and then cloning it again from the source repository; however, if you meant pulling changes and modifying the existing project directory, updating it with the latest changes from the repository would be sufficient.

  • @BroloCholo
    @BroloCholo 6 หลายเดือนก่อน

    Thank you for this! Question: I am having an ALLOWED_HOSTS issue. I have the hosts set to ALLOWED_HOSTS = ['*', '54.204.100.74']. I updated with get pull and restarted the nginx server but it still wont allow me to connect. I also confirmed that IPv4 incoming addresses are good and the config files seem right. is something wrong with the allowed hosts syntax or something?

    • @CloudWithDjango
      @CloudWithDjango  6 หลายเดือนก่อน

      Hi,
      It's no problem.
      So, please verify that you have indeed saved the settings file correctly after making changes and that the correct settings file is being used by Django. Double-check that your web server (NGINX) and application server (such as Gunicorn) are properly configured and restarted after changes. Ensure that any environment-specific settings or environment variables are set correctly if you are using them.If using Docker or another containerization tool, confirm that the container has the updated settings file and that it's being rebuilt and redeployed correctly. Finally, look into the server logs (both Django and NGINX) to identify any specific errors that might give more context on why the connection is not being allowed.

  • @Ahmedesmail07
    @Ahmedesmail07 ปีที่แล้ว +1

    Amazing, thanks for your great content, keep up the good work.

  • @chemobaza
    @chemobaza หลายเดือนก่อน

    Thanks so much for sharing! This is exactly what I was looking for.

    • @CloudWithDjango
      @CloudWithDjango  หลายเดือนก่อน +1

      My pleasure! I'm glad that you found the video to be of use!

  • @johng2587
    @johng2587 8 หลายเดือนก่อน

    Why create venv? In dev, a person might want to work on multiple apps. But the server instance is 1 instance. WHy use venv? what problem does this solve? what is the benefit?

    • @CloudWithDjango
      @CloudWithDjango  8 หลายเดือนก่อน

      Hi,
      That is true, but sometimes people just want to work with one application, so creating a singular virtual environment is necessary. We use It since it is a best practice for the use case in the video. The problem that it solves is that your packages and dependencies aren't stored globally everywhere, which is also a benefit for compartmentalisation

  • @vicentefarias2013
    @vicentefarias2013 11 หลายเดือนก่อน

    muchas gracias por este tutorial, saludos desde chile, muy bien explicado.

  • @mlsandreas
    @mlsandreas ปีที่แล้ว +2

    Great video! Thank you!

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Thank you, Andreas! I'm glad that you liked it!

  • @HasanMoni-q2g
    @HasanMoni-q2g 9 หลายเดือนก่อน

    I followed your this video deployment but after deployment when we use ip address for testing in browser it show ' not secure'.
    Please make a video on...
    How to secure Django application on ec2 instance using ssl certificate?

    • @CloudWithDjango
      @CloudWithDjango  9 หลายเดือนก่อน

      Hi,
      Yes, we don't go into detail with HTTP and HTTPS for this video.
      Thank you for your video suggestion.

  • @aromalkannan6824
    @aromalkannan6824 ปีที่แล้ว

    Thanks but how do we get to set the static file for superadmin

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Sure thing!
      You would need to set your static files with Amazon S3 or with whitenoise.

    • @aromalkannan6824
      @aromalkannan6824 ปีที่แล้ว

      @@CloudWithDjango thanks 👍

  • @jacobrivera405
    @jacobrivera405 ปีที่แล้ว

    How would you go about putting Enviorment variables within nginx?

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว +2

      Hi Jacob,
      Thank you for reaching out.
      There are many ways to do this, but you will need to do some research on the method that best works for you.
      Here is some inspiration to get started (with the first option you can create a variables.conf file):
      stackoverflow.com/questions/12554964/nginx-how-can-i-provide-variable-for-paths-in-nginx-configuration
      Additional resources:
      stackoverflow.com/questions/61454239/how-to-access-and-set-environment-variables-any-production-nginx-and-gunicorn
      stackoverflow.com/questions/66090831/nginx-uwsgi-django-does-not-use-environment-variables-set-in-venv-activate-s
      Good luck!

  • @blackhatthuku7055
    @blackhatthuku7055 ปีที่แล้ว

    This is the kindd of content Ive been waiting for

  • @cooper6470
    @cooper6470 ปีที่แล้ว

    can you please share the git repo url which you have used in this video, i dont see it anywhere in the description or comments?

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi,
      Thank you for reaching out.
      Unfortunately, that repo is not available. You should use your own Django project. You can follow the same steps for you own repo.

  • @sarthakbhan1562
    @sarthakbhan1562 11 หลายเดือนก่อน

    Great video, can you tell me why when i check status, uptime is always 2seconds or less than that. it keeps restarting

    • @CloudWithDjango
      @CloudWithDjango  11 หลายเดือนก่อน

      Hi,
      If it keeps restarting that would probably mean that you haven't configured supervisorctl correctly.

    • @sarthakbhan1562
      @sarthakbhan1562 11 หลายเดือนก่อน

      Hi @@CloudWithDjango thanks for replying.
      i have copy pasted the code in the description. replaced the project name with my project. still it's giving issue
      [program:gunicorn]
      directory=/home/ubuntu/CapriWay
      command=/home/ubuntu/env/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/CapriWay/app.sock CapriWay.wsgi:application
      autostart=true
      autorestart=true
      stderr_logfile=/var/log/gunicorn/gunicorn.err.log
      stdout_logfile=/var/log/gunicorn/gunicorn.out.log
      [group:guni]
      programs:gunicorn
      this is my gunicorn file
      Regards

    • @sarthakbhan1562
      @sarthakbhan1562 11 หลายเดือนก่อน

      hi @@CloudWithDjango ,
      so afte debugging a lot, i found out that the issue was with the packages installed. after fixing that it started working automatically.
      Thanks for this video. really helpful

    • @CloudWithDjango
      @CloudWithDjango  11 หลายเดือนก่อน

      No worries!
      I'm glad that you managed to get things working, and that you found the video to be of help.
      My pleasure!

  • @burakcankurtarr2751
    @burakcankurtarr2751 ปีที่แล้ว +1

    This video helped me a lot. Thank you so much!

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      My pleasure, Burak!
      I'm glad that it proved to be of value to you.
      All the best!

  • @ferduarte5769
    @ferduarte5769 ปีที่แล้ว

    Hi,
    Im getting this on my supervisor log, after getting the STARTING and BACKOFF error when asking for the status:
    CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to ru>
    WARN No file matches via include "/etc/supervisor/conf.d/*.conf"
    Do I need to change/add something on my supervisor.conf?
    The WARN message confuses me a little bit tbh.
    Thx!

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว +1

      Hi,
      The reason that you are getting this error is because you haven't configured your gunicorn.conf and supervisor settings correctly. Please double check them.

  • @fareedyarkhan8462
    @fareedyarkhan8462 ปีที่แล้ว

    how can i setup celery , celery beat and channels with this please

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi,
      You would need to look into the Elasticache service for this use case.

  • @kosyokeke5598
    @kosyokeke5598 ปีที่แล้ว +1

    This was really helpful, Thanks a lot

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว +1

      My pleasure! I'm glad that it helped you!

  • @mann5544
    @mann5544 5 หลายเดือนก่อน

    can you please provide your Git Repository

    • @CloudWithDjango
      @CloudWithDjango  5 หลายเดือนก่อน

      There is no repository for this video

  • @Sandeep-tn8mz
    @Sandeep-tn8mz 6 หลายเดือนก่อน

    Do i need to make Any changes for Allowed hosts? i am having trouble there

    • @CloudWithDjango
      @CloudWithDjango  6 หลายเดือนก่อน

      It would depend. Usually, if you have a domain name, you'd need to add it in or the ip address associated. For this project in the video you do not.

    • @Sandeep-tn8mz
      @Sandeep-tn8mz 6 หลายเดือนก่อน

      @@CloudWithDjango Thank you for your response. by making allowed hosts = ['*']worked for me.
      i had one more question.... Basically, when I shut my ec2 to save cost and restart whenever needed, the public IP will change, so I have to change that IP in the django.conf file as well. So Is there any solution for that?

    • @CloudWithDjango
      @CloudWithDjango  6 หลายเดือนก่อน

      My pleasure. So, yes, you can use an Elastic IP address with your EC2 instance to maintain a static public IP address even when the instance is stopped and started.

  • @R0074dm1n
    @R0074dm1n ปีที่แล้ว

    Thank you very much for this tutorial. Very help and insightful.

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      It is a great pleasure! Thank you very much for your feedback!

  • @juliaallerite5504
    @juliaallerite5504 ปีที่แล้ว

    when I type the sudo supervisorctl status my gunicorn status is STARTING. What should I do about it?

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi Julia,
      Please double check your gunicorn.conf file. This is usually the reason for it saying STARTING.

  • @boaz5742
    @boaz5742 7 หลายเดือนก่อน

    Is this viable for production?

    • @CloudWithDjango
      @CloudWithDjango  7 หลายเดือนก่อน

      Of course, it would be suggested to add in https as well and additional settings, but yes it serves as a good starting point for production

  • @kvrkvr932
    @kvrkvr932 ปีที่แล้ว

    Well explained thanks for your video. You save me dude. Thanks again.

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Thank you for the feedback. I'm glad that it helped you!
      My pleasure! :)

  • @bibinkunjumon5998
    @bibinkunjumon5998 ปีที่แล้ว

    One doubt if we restart instance,what happens ? what all commands needed to run after that

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว +1

      Hi,
      The best way would be to test it and see.
      Generally speaking, you wouldn't need to restart your ec2 instance. Supervisor in the backend will keep it running as long as your ec2 instance is still active. So, just make sure that you don't terminate your ec2 instance then you will be fine.
      You don't need additional commands.

  • @razorhxh7371
    @razorhxh7371 ปีที่แล้ว

    SIR CAN YOU PLEASE PLEASE SHOW HOW TO ASSIGN A CUSSTOM DOMAIN TO THIS AND A HTTPS URL??????

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi,
      You would need to use Amazon Route 53 and Amazon Certificate manager. There is content on the channel to do this.

    • @razorhxh7371
      @razorhxh7371 ปีที่แล้ว

      @@CloudWithDjango Thank you soooo much. Also another question, I followed the previous video of deploying it to ec2 but the terminal needs to stay running for that one to work. I am using s3 for my image storage, but i still have static files for my app.js and styles.css file. Will this tutorial work for me to deploy my django application? The previous one, the app works perfectly when deployed. I am clarifying because i saw some comments saying their web page styles are not working.

  • @Waseem-f7n
    @Waseem-f7n 7 หลายเดือนก่อน

    my confusion is that, what if i have new changes in my code, then how i will update this aws instance?
    can you help me regarding this?

    • @CloudWithDjango
      @CloudWithDjango  7 หลายเดือนก่อน +1

      Hi,
      You'd reclone your github code, as you initially did it the first time

    • @Waseem-f7n
      @Waseem-f7n 7 หลายเดือนก่อน

      @@CloudWithDjango ok thank for your response

    • @CloudWithDjango
      @CloudWithDjango  7 หลายเดือนก่อน +1

      My pleasure!

  • @eneseren8332
    @eneseren8332 ปีที่แล้ว

    Thank you so much for all your efford to explain this to us..

  • @Khallypha_10
    @Khallypha_10 ปีที่แล้ว

    Hey I used your settings and they worked perfectly. But the problem I'm facing is I'm trying to use Cloudflare. I already purchased a domain name but it isn't working. When i type my domain name in the browser it shows the welcome to nginx page but when I type in the IP address my website shows. Please how can I solve this?

    • @david0411
      @david0411 ปีที่แล้ว

      How did you solve it?

    • @Khallypha_10
      @Khallypha_10 ปีที่แล้ว

      @@david0411 on Django allowed hosts list, you type in your domain name.

  • @secretr5024
    @secretr5024 ปีที่แล้ว

    This tutorial worked perfectly for me and I got my application running :D
    but one question. If I wanted to specify a better server name what would I put in the djang.conf file? also if I edited that would I need to use that to find my website? also do I use http or https

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      I'm glad to hear that everything worked for you!
      You can create a domain name and associate that with the server name in the django.conf file and also in your settings.py file for allowed hosts.
      Yes, whatever the server name is, will usually be where you can reach your website.
      It is recommended to use HTTPS if possible.

  • @Buzoqchauz
    @Buzoqchauz ปีที่แล้ว

    thank you soo much! good luck with your next favors

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว +1

      My pleasure! I'm glad that you enjoyed the video. Thank you.

  • @blackhatthuku7055
    @blackhatthuku7055 ปีที่แล้ว

    How to host a Dockerized Django App on AWS?

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi,
      I have a docker playlist available on the channel. You will find more information there.
      Good luck!

  • @KadimDostlarGaming
    @KadimDostlarGaming 9 หลายเดือนก่อน

    Thanks for the video.

  • @drakata27
    @drakata27 4 หลายเดือนก่อน

    Hi I have s3 set up but my static files are not loading please help

    • @CloudWithDjango
      @CloudWithDjango  4 หลายเดือนก่อน

      Hi,
      Please ensure that you setup your S3 files before deployment.

    • @drakata27
      @drakata27 4 หลายเดือนก่อน

      @@CloudWithDjango For some reason gunicorn and nginx do not recognise my env vars. If I use runserver command everything works fine

  • @MuhammadUsman-wc5nk
    @MuhammadUsman-wc5nk ปีที่แล้ว

    How i can clone your elevate project for practice it asking for username and password

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi,
      You would need to use your own project.

    • @MuhammadUsman-wc5nk
      @MuhammadUsman-wc5nk ปีที่แล้ว

      @@CloudWithDjango I am using my own project but at the end it is showing internal server error on browser I'm was wondering that I missed something during configuration but i tried 4 to 5 times but error is still in the place. Is this error related to my project or something else?

  • @hadesunseen6388
    @hadesunseen6388 ปีที่แล้ว

    thank you for sharing your knowledge, saved my day. thanks brother

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      My pleasure! :)
      I'm glad that you managed to find the video useful.
      All the best!

    • @hadesunseen6388
      @hadesunseen6388 ปีที่แล้ว

      @@CloudWithDjango one question. How do we access static files in django on EC2? Do you have any video related to it ? checked your video list but not able to find it. thanks

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi,
      I would suggest that you utilize Amazon S3 for this use case.
      Here are the docs to learn more:
      django-storages.readthedocs.io/en/latest/backends/amazon-S3.html
      Good luck!

  • @Raju-mh2em
    @Raju-mh2em 9 หลายเดือนก่อน

    can we deploay asgi application with gunicorn

    • @CloudWithDjango
      @CloudWithDjango  9 หลายเดือนก่อน +1

      Hi,
      The best way to know would be to try it out and see what happens

  • @Fede_uyz
    @Fede_uyz 2 หลายเดือนก่อน

    Im getting a 502 error message on the very last step, any idea???

    • @CloudWithDjango
      @CloudWithDjango  2 หลายเดือนก่อน

      Hi,
      I'd suggest re-checking your steps, especially where supervisorctl is concerned

    • @Fede_uyz
      @Fede_uyz 2 หลายเดือนก่อน

      ​@@CloudWithDjango i dont know really, i deleted the instance, re did it carefully, same issue.
      Re deleted it, re did it and it worked.
      But now it stopped loading! It was working (except it didnt load css) and a few hours later it simply stopped loading

  • @stixbunny
    @stixbunny ปีที่แล้ว

    Thanks a ton! 😄

  • @saratmahapatra4858
    @saratmahapatra4858 ปีที่แล้ว

    Nice video can u please upload video for github action with same project

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi Sarat,
      Thank you for your feedback.
      This is a good idea, if I have time, I can possibly look into this.

  • @ezhinind3724
    @ezhinind3724 7 หลายเดือนก่อน

    hi , im facing 502 bad gateway error what i do ? what it means?

    • @CloudWithDjango
      @CloudWithDjango  7 หลายเดือนก่อน +1

      Hi,
      Please double check your steps and that you've configured supervisor correctly

  • @aryan_kyatham
    @aryan_kyatham 10 หลายเดือนก่อน

    how to convert http domain to https tried certbot but didnt workout & thanks a lot for these videos learnt to deploy django from YOU :) ?

    • @CloudWithDjango
      @CloudWithDjango  10 หลายเดือนก่อน

      Hi,
      I'd suggest that you use Amazon Certificate Manager for your HTTPS binding to your domain name and DNS records - not certbot.
      My pleasure, I'm glad that you've been enjoying the videos! :)

  • @prudhvisuryapuluri7028
    @prudhvisuryapuluri7028 10 หลายเดือนก่อน

    May I know where is the source code for the above project

    • @CloudWithDjango
      @CloudWithDjango  10 หลายเดือนก่อน

      Hi,
      There is no source code for the above project

  • @JohnMorrison-i4t
    @JohnMorrison-i4t 10 หลายเดือนก่อน

    how can I update the django code once its up there?

    • @CloudWithDjango
      @CloudWithDjango  10 หลายเดือนก่อน

      Hi,
      You can pull the github code again as we initially do the first time.

  • @boopathys6356
    @boopathys6356 ปีที่แล้ว

    bro it show 502 bad gateway nginx/1.18.0 (Ubuntu) how to resolve it please reply soon as much as possible am in internship am responsible for production server setup

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi,
      Please double check your settings, and path.

  • @sushantshirke
    @sushantshirke ปีที่แล้ว

    Invalid HTTP_HOST header: 'my public ip'. You may need to add 'my public ip' to ALLOWED_HOSTS.
    please help me

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi,
      You need to either allow all hosts in your allowed hosts setting or add in the public IPv4 address for your ec2 instance.

  • @raju_bugude
    @raju_bugude ปีที่แล้ว

    Failed to load resource: the server responded with a status of 502 (Bad Gateway).
    I'm getting this error what to do???????????

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi,
      If you are getting a 500 error. There is most likely an error with your application.
      If you are getting a 502 error, then you configured your settings wrong, I'm afraid. Most likely because your directory structure is different from how I demonstrate it in the video.

    • @dhruvpatel8928
      @dhruvpatel8928 ปีที่แล้ว

      Is your problem resolved?

    • @diazutube
      @diazutube ปีที่แล้ว

      ive got this one too, actually I think the problem was on my app.sock?

  • @kwamenadadson
    @kwamenadadson ปีที่แล้ว

    hello so if I want to restart the service after making some changes to the django application what do I do ?

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi,
      You don't need to restart the service, it is automatically configured with supervisor for this exact purpose.
      All you need to do is git pull from your GitHub repository as we did in the beginning when we grabbed our application. It will be the same process and in the exact same way.
      Good luck!

    • @kwamenadadson
      @kwamenadadson ปีที่แล้ว +1

      @@CloudWithDjango yes solved it by killing the process
      But since supervisor is always running it will
      Create another process
      And boom it will
      Update the Django app

  • @MuhammadMuzammilIrshad-y8y
    @MuhammadMuzammilIrshad-y8y ปีที่แล้ว

    you should have to share link of repository

    • @CloudWithDjango
      @CloudWithDjango  ปีที่แล้ว

      Hi,
      All you need to do is create a small project in terms of the project structure shown in the video.

    • @TheIvanlisi
      @TheIvanlisi ปีที่แล้ว

      is the some thing special in setings that need to be writen? maybe in all
      owed hosts@@CloudWithDjango

  • @breadbreadbreader
    @breadbreadbreader ปีที่แล้ว +1

    I get DisallowedHost at / even though I added public IPv4 address to ALLOWED_HOST. What might be the cause of it? Also, when I access public IPv4 DNS, I get "Welcome to nginx!" page. I am quite sure that I have followed your step thoroughly. What might I be missing?

    • @sangeethshyam4881
      @sangeethshyam4881 9 หลายเดือนก่อน

      After adding IPv4 to ALLOWED_HOST you should restart the gunicorn, This helped me when I met this same situation.
      To restart use cmd
      Sudo supervisorctl restart guni:gunicorn
      This may help

  • @gustavo_atayde9553
    @gustavo_atayde9553 2 วันที่ผ่านมา

    thanks a lot!

  • @wonganitembo5521
    @wonganitembo5521 11 หลายเดือนก่อน

    How can i configure my static files

    • @CloudWithDjango
      @CloudWithDjango  11 หลายเดือนก่อน +1

      Hi,
      Please read the pinned comment for more information

    • @wonganitembo5521
      @wonganitembo5521 11 หลายเดือนก่อน

      ​@@CloudWithDjango Thanks

    • @CloudWithDjango
      @CloudWithDjango  11 หลายเดือนก่อน

      My pleasure!