Deploy help

24 views
Skip to first unread message

Daniel Gauvin

unread,
Sep 21, 2021, 12:36:17 PM9/21/21
to Django users
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.

Kasper Laudrup

unread,
Sep 21, 2021, 12:41:20 PM9/21/21
to django...@googlegroups.com
On 21/09/2021 17.39, Daniel Gauvin 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.
>

Will this guide help you?

https://tubemint.com/deploy-django-on-cpanel/

Kind regards,

Kasper Laudrup
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature

Anornymous u

unread,
Sep 21, 2021, 1:10:45 PM9/21/21
to django...@googlegroups.com
Open the domain on a different browser see if it works, could be your browser is stuck with cache. Am assuming you had collected all the static files using the command python manage.py collecstatic

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a854aad6-fc0b-269e-f95a-75975ca01903%40stacktrace.dk.

Kasper Laudrup

unread,
Sep 21, 2021, 2:49:43 PM9/21/21
to django...@googlegroups.com
On 20/09/2021 19.08, Anornymous u wrote:
> Open the domain on a different browser see if it works, could be your
> browser is stuck with cache. Am assuming you had collected all the
> static files using the command python manage.py collecstatic
>

I think you replied to the wrong person. I don't see how this is
relevant to what I wrote.

Kind regards,

Kasper Laudrup
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature

Anornymous u

unread,
Sep 21, 2021, 3:16:42 PM9/21/21
to django...@googlegroups.com
Sorry my bad, it was meant for the person asking the question about deployment.

--
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...@googlegroups.com.

Kasper Laudrup

unread,
Sep 21, 2021, 3:39:09 PM9/21/21
to django...@googlegroups.com
On 20/09/2021 21.14, Anornymous u wrote:
> Sorry my bad, it was meant for the person asking the question about
> deployment.
>

No worries.

Just a bit confusing when it happens.

Kind regards,

Kasper Laudrup
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature

Rishikesh Agrawani

unread,
Sep 22, 2021, 9:13:55 AM9/22/21
to django...@googlegroups.com
Please provide the absolute path for static files does so that Django will be able to find and collect before putting to static root.

--
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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages