Problem when i turn debug False

35 views
Skip to first unread message

luca72.b...@gmail.com

unread,
Sep 2, 2021, 4:45:57 AM9/2/21
to Django users
Hello my web site is hosted on a2hosting
 when i turn to False the image are not loaded.

My settings.py have this line:
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static_files')

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, "static_media")

the file are located in:
home/aaaa//myapp/static_files/polls

In the template I do as follow
 {% load static %}

<img src="{% static "polls/gb.png" %}............

Daniel Hepper

unread,
Sep 2, 2021, 10:01:03 AM9/2/21
to django...@googlegroups.com
As far as I can tell a2hosting offers plain virtual servers. Have you read the documentation on Serving static files in production?



--
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/836ae997-cc6d-4d47-be45-fed85df79ab9n%40googlegroups.com.

Luca Bertolotti

unread,
Sep 2, 2021, 10:40:38 AM9/2/21
to django...@googlegroups.com
Yes i have read the documentation but as you can see I never understand.
I think that I can use whitenoise in a2hosting, 

let me ask for a stupid question, a friend have a VNS on a different machine is possible use his machine for load static files?

Regards

Reply all
Reply to author
Forward
0 new messages