Tuesday, September 21, 2021

Re: Deploy help

Please provide the absolute path for static files does so that Django will be able to find and collect before putting to static root.

On Tue, 21 Sep 2021, 10:05 pm Daniel Gauvin, <daniel.gauvin@solutionsnc.qc.ca> wrote:
Hi,

I am looking for support to deploy a Django application on cPanel.  The application itself is working, however the static files (CSS, JS and Images) do not load in the application. 

In my settings.py file, it is as such:

STATIC_URL = '/static/'
STATICFILES_DIRS = ['static']
STATIC_ROOT = os.path.join(BASE_DIR, 'assets') 

MEDIA_URL = '/media/' 
MEDIA_ROOT = os.path.join(BASE_DIR, '/home/<myusername>/public_html/media') 

The static files are located in : /home/<myusername>/public_html/app/static and a copy is located in  /home/<myusername>/public_html/static.

Thank you for your help.

--
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 django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6b3aa9ed-335b-4826-80a0-8a8852b18660n%40googlegroups.com.

--
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 django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHWAmNaMsxx4Yd8idSpv%2BUHTaxA6syssdtJnyN4L4yVdmMUj_A%40mail.gmail.com.

No comments:

Post a Comment