Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't elastic beanstalk render css for the django admin site?

I am following this guide on deploying a django app to AWS Elastic Beanstalk : https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html

After running eb open, the css for the admin site does not render. It works when running the development server at 127.0.0.1:8000/admin but not when deployed to EB.

I have followed this guidance but it is still not working Elastic Beanstalk does not load the Django admin static files

Can someone explain why this is happening?

like image 410
Peter Parker Avatar asked Oct 27 '25 04:10

Peter Parker


1 Answers

You can create a .ebextension/djnago.config in your project root dir. And code for loading static assests is below:

option_settings:
  aws:elasticbeanstalk:environment:proxy:staticfiles:
    /static: static

I used this for django 4.0 on Amazon Linux 2

like image 111
Manoj Kumar Avatar answered Oct 29 '25 22:10

Manoj Kumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!