{% static %} files

Now i’ve finally moved on to creating my own templates within django/wagtail. But first I have a bit of an issue with the static files.

When I attempt to add images in Wagtail,

Picture 12

I get the dreaded Internal Server Error

Internal Server Error
The server encountered an internal error or 
misconfiguration and was unable to complete 
your request.

 

 

 

 

 

 

 

 

Picture 11

 

Additionally, attempting to link to images in my static folder like so:

<p><img src="{% static "its_alive1.gif" %}" alt="Its Alive" /></p>

gives a broken image, although if I navigate to http://username.com/static/image.gif I can see the image in my browser.

Right now my settings.py are as follow:

MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')
MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
STATIC_URL = '/home/clarayee/website/static/'
STATICFILES_DIRS = ()

The STATIC_URL is a hard-rooted to test if it makes any difference. Nope, no difference!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s