How i can chnage source code of django site with nginx and gunicorn

Posted September 8, 2021 245 views

Hi everyone. i am facing problem while updating source code of my site through filezilla. i made many changes to the source code but these changes dosnt change any thing in my site. please help. i am new here

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi there,

Once you upload your new changes, you might also have to restart the Gunicorn service so that the new changes could be reflected:

sudo systemctl restart gunicorn

Hope that this helps!

  • Thank you bobbyilive.
    It’s work for me.

    But I have another problem I hope u will help me.

    My django admin css not working. I also run the python collectstatic command but still css not working. Is my email. I will send you some screenshots

    Please help

    • Hello,

      No problem at all!

      Regarding the CSS, have you defined the STATIC_ROOT and STATIC_URL?

      You can find the steps on how to do that here:

      Let me know how it goes!

      by Erin Glass
      Django is a powerful web framework that can help you get your Python application or website off the ground. Django includes a simplified development server for testing your code locally, but for anything even slightly production related, a more secure and powerful web server is required.
      • I follow the same steps while deploying the site.

        server {
        listen 80;
        servername serverdomainorIP;

        location = /favicon.ico { access_log off; log_not_found off; }
        location /static/ {
            root /home/sammy/myprojectdir;


        Basically there is no user in my vps. and my site is inside a directory name “projectdir”.

        root /projectdir/static is the correct path for my static path.??

        • Hello,

          If you are visiting your_ip/projectdir to see your project via your browser, then it should be like this:

          STATIC_URL = '/projectdir/static/'
          import os
          STATIC_ROOT = os.path.join(BASE_DIR, 'projectdir/static/')

          As per the tutorial, this needs to be adjusted in the ~/myprojectdir/myproject/ file.

          • Hi sir. My site css worked now.

            But I have another problem. I purchased domain from godaddy. I used that domain for another droplet and now I destroy the droplet. I want to link the domain with another droplet but when I add domain to my new droplet an error is generated.

            Error is. This domain already exists. What I do now.

          • Hello,

            Happy to hear that it is all working now!

            Regarding the new problem that you are seeing, I would recommend getting in touch with the DigitalOcean support team and they will be able to assist you with this account problem.