title: Django staticfiles not loading in AWS ec2
body: <p>I've deployed a django webiste in AWS ec2 with the help of this <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-22-04" rel="nofollow noreferrer">digitalocean blog</a> but the static files like css and javascripts are not loading after deployment.</p>
  <p>This is my django static code:</p>
  <pre><code>STATIC_URL = '/static/'
  
  MEDIA_URL = 'media/'
  
  MEDIA_ROOT =  'media/'
  
  STATIC_ROOT = 'staticfiles/'
  
  STATICFILES_DIRS = [
     os.path.join(BASE_DIR, 'static')
  ]
  </code></pre>
  <p>and this is my nginx code:</p>
  <pre><code>server {
      listen 80;
      server_name mydomain.com;
  
      location = /favicon.ico { access_log off; log_not_found off; }
      location /staticfiles/ {
          root /home/sammy/project/myproject;
      }
  
      location / {
          include proxy_params;
          proxy_pass http://unix:/run/gunicorn.sock;
      }
  }
  </code></pre>
  <p>And I'm using AWS S3 to host my static files.</p>