Re: Static files is not loading while deploying the project to AWS ec2

2022-11-08 Thread Nishant Sagar
Thank you everyone for the help, it solved the issue On Sun, 6 Nov 2022 at 8:43 AM, Malcolm MacKinnon wrote: > Using elastic beanstalk, I run the command manage.py collectstatic in a > .config file during deployment. The config file is located in the > .ebextensions > folder. > > In

Re: Static files is not loading while deploying the project to AWS ec2

2022-11-07 Thread James
It sounds like nginx doesn't know where your static files are being served from. If you don't want to bother with NGINX you can use Whitenoise. Django doesn't serve staticfiles in production; something that isn't overly apparent. You still need something like apache or nginx or whitenoise to

Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread Malcolm MacKinnon
Using elastic beanstalk, I run the command manage.py collectstatic in a .config file during deployment. The config file is located in the .ebextensions folder. In settings.py STATIC_URL = '/static/' STATIC_ROOT = 'static'

Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread David Nugent
An article I wrote on this topic last year for fellow developers at work who were similarly confused. HTH! *Django - Statically Confusing* I started learning Django several years ago (and am still doing so today!), and for some time had a real sense of confusion as to how static files worked.

Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread led zee
As a recent Django new user I was having a lot of trouble with static files as well. Basically couldn't get Admin CSS to work. We are using whitenoise now. Apparently that is helping solve the problem. On Saturday, November 5, 2022 at 12:35:31 AM UTC-7 nishan...@gmail.com wrote: > Hi all, > >

Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread Lakshyaraj Dash
You can use sebuckets to store your static files... On Sat, Nov 5, 2022, 13:04 Nishant Sagar wrote: > Hi all, > > I deployed the django project to AWS ec2 instance using nginx and gunicorn > but the static file is not loading at all. > > Can someone suggest where did I do wrong? > > Note - I've

Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread Ashutosh Mishra
I had faced same problem but collectstatic worked for me,, On Sat, 5 Nov, 2022, 1:15 pm Nishant Sagar, wrote: > Hi Ashutosh, > > Yeah I tried that as well, still not working. > > On Sat, 5 Nov 2022 at 1:10 PM, Ashutosh Mishra < > ashutoshmishra...@gmail.com> wrote: > >> Did you tried, python

Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread Nishant Sagar
Hi Ashutosh, Yeah I tried that as well, still not working. On Sat, 5 Nov 2022 at 1:10 PM, Ashutosh Mishra wrote: > Did you tried, python manage.py collectstatic? > > On Sat, 5 Nov, 2022, 1:05 pm Nishant Sagar, > wrote: > >> Hi all, >> >> I deployed the django project to AWS ec2 instance using

Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread Ashutosh Mishra
Did you tried, python manage.py collectstatic? On Sat, 5 Nov, 2022, 1:05 pm Nishant Sagar, wrote: > Hi all, > > I deployed the django project to AWS ec2 instance using nginx and gunicorn > but the static file is not loading at all. > > Can someone suggest where did I do wrong? > > Note - I've

Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread Nishant Sagar
Hi all, I deployed the django project to AWS ec2 instance using nginx and gunicorn but the static file is not loading at all. Can someone suggest where did I do wrong? Note - I've not created Profile before deploying Here is my settings.py file STATIC_URL = 'static/' STATIC_ROOT =