Discussion:
Django in Linux set image
(too old to reply)
Riska Kurnianto
2018-12-10 02:32:55 UTC
Permalink
in staging or production env, You need to specify STATIC_ROOT in
settings.py and run "manage.py collectstatic".
Hi all,
i have instaled django in ubuntu,
i have image and i put in folder (*img*), the locate is
blog
urls.py
views.py
admin.py
--------------static
---------------------- blog
-----------------------------dist
-----------------------------------*img*
When i load my browser The image is fine no problem, the problem is when,
DEBUG = False
ALLOWED_HOSTS = ['localhost', '27.0.0.1', 'xxx.xxx.xxx.xxx', '[::1]']
the image can not found, but when i set Debug to True , the image come
back normal.
is there any miss in my config settings.py
this my home.html
{% load static %}
<!DOCTYPE html>
<html>
<head>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<li class="user-header">
<img src="{% static 'blog/dist/img/noc.jpg' %}" class="img-circle" alt="User
Image">
<p>
NOC
<small>Member since Nov. 2018</small>
</p>
</li>
..............
Regards
Sidik
--
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
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/7b30d6a2-c1e0-45fb-8722-3b38ed6fd062%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/7b30d6a2-c1e0-45fb-8722-3b38ed6fd062%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAG7yD2Lv-5cKTT1sr%3Dsqhj92DVoD6faooOfag%3DkBVob-qenb4A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...