While I'm working with "Tango with Django" I am using Django 1.8 and
Python 3.4 (debian linux).
My project tree (somewhat truncated) is in the /root directory and looks
as follows:
tango
├── bin
├── include
├── lib
└── tango
├── db.sqlite3
├── __init__.py
├── manage.py
├── rango
├── requirements.txt
├── static
│ ├── images
│ └── __init__.py
├── tango
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── __pycache__
│ ├── settings.py
│ ├── settings.pyc
│ ├── urls.py
│ └── wsgi.py
├── tango.nja
└── templates
├── __init__.py
└── rango
The pertinent parts of the settings.py file are:
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
STATIC_PATH = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'
STATICFILES_DIRS = (
STATIC_PATH,
)
The rango index.html file is:
<!DOCTYPE html>
{% load static from staticfiles %}
<html>
<head>
<title>Rango</title>
</head>
<body>
<h1>Rango says...</h1>
hello world! <strong>{{ boldmessage }}</strong><br />
<a href="/rengo/about">About</a><br />
<img src="{% static "images/apache2.png" %}" alt="Picture of
Apache logo"/>
</body>
</html>
The apache2.png is just a handy image file.
The result of 127.0.0.1:8000/rango/ is:
Rango says...
hello world! I am bold font from the context
About
Picture of Apache logo
I've tried everything I can think of to try to get the image served and
have totally failed. The firefox debugger just says "failed to load the
given URL"
What am I doing wrong.
Gary R
--
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/56661A1E.30803%40verizon.net.
For more options, visit https://groups.google.com/d/optout.