Thank you all for providing valuable answers. 

1. My case was actually related to the permission issue on 
~/www-data/example.com/static folder as mentioned by @Asamoah Emmanuel. 
2. Though I changed the ownership of the folder with 
siteUser:www-data ~/www-data/example.com/static
the problem was not resolved, but resolved with the next step.
3. So I had to add siteUser in nginx.conf file and then restarted gunicorn 
and nginx

Here is the solution lead me fixing my 
issue: 
https://stackoverflow.com/questions/44918725/django-301-and-403-forbidden-errors-on-my-static-files-in-production

Best Regards,
~Ram


On Thursday, February 29, 2024 at 2:32:19 PM UTC-7 Mordecai Etukudo wrote:

> First install white noise and collect static you are good to go 
>
> On Thu, Feb 29, 2024, 7:38 PM ASAMOAH EMMANUEL <[email protected]> 
> wrote:
>
>> I faced this issue before and I know how frustrating it can be. after 
>> sifting through several results, this worked. sudo usermod -aG username 
>> www-data
>> sudo chown -R :www-data /home/username/projects/personal
>>
>> On Thu, Feb 29, 2024 at 6:37 PM ASAMOAH EMMANUEL <[email protected]> 
>> wrote:
>>
>>> Replace your username with this and run this code: sudo usermod -aG 
>>> username www-data
>>> sudo chown -R :www-data /home/username/projects/personal
>>>
>>> On Thu, Feb 29, 2024 at 2:15 PM Amitesh Tripathi <[email protected]> 
>>> wrote:
>>>
>>>> Your website is in debug mode??
>>>>
>>>> On Thu, 29 Feb 2024, 11:54 Ram, <[email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> We are able to deploy our pre-production site successfully using 
>>>>> jenkins deployment and as part of the deployment we do the following:
>>>>>
>>>>> 1. Django application with runserver
>>>>> 2. Gunicorn restart
>>>>> 3. Nginx restart
>>>>>  
>>>>> But our web application loads with distorted layout and we have this 
>>>>> setting for staticfiles
>>>>>
>>>>> STATIC_URL = '/static/'
>>>>> STATIC_ROOT = os.path.join(BASE_DIR, 'static')
>>>>>
>>>>> We are wondering what is missing?
>>>>>
>>>>> Best Regards,
>>>>> ~Ram
>>>>>
>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "Django users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to [email protected].
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/django-users/CA%2BOi5F2xrz-hiJphYeuGX56hU26wWJGduUZHNibTUXVs-KtjeA%40mail.gmail.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/django-users/CA%2BOi5F2xrz-hiJphYeuGX56hU26wWJGduUZHNibTUXVs-KtjeA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/CAFJ1wEUvJK_Ur_6JpLeMVMXK4TMH_ryUy7gLWqjXG8a0%2B_o2VA%40mail.gmail.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/CAFJ1wEUvJK_Ur_6JpLeMVMXK4TMH_ryUy7gLWqjXG8a0%2B_o2VA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>>
>>> -- 
>>> I don't stop when I'm tired, I only stop when the job is done.
>>>
>>
>>
>> -- 
>> I don't stop when I'm tired, I only stop when the job is done.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CABFHQYx%3DsSpZZo3gbXctqFC9Nrdyb49WvbxL6CYo%3DiZ%2B_dqOVQ%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/django-users/CABFHQYx%3DsSpZZo3gbXctqFC9Nrdyb49WvbxL6CYo%3DiZ%2B_dqOVQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5d38a298-723a-4065-90c0-e33d5e7f979fn%40googlegroups.com.

Reply via email to