Changeset 763de95393a60897566a92e0bcef5ec68a4e311d


Ignore:
Timestamp:
13.05.2013 00:32:17 (6 years ago)
Author:
Stanislaw Klekot <dozzie@…>
Branches:
b66903eafbcb1d49112014abc82c8bf683413db0
Children:
42f26f4e60a9fadec4802e4eba49b707019f780b
Parents:
3ef8f3122a6f56c5fa0c1531e5058913b2e456e7
git-author:
Stanislaw Klekot <dozzie@…> (30.04.2013 16:13:21)
git-committer:
Stanislaw Klekot <dozzie@…> (13.05.2013 00:32:17)
Message:

Now serving static files is somewhat prettier.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • dashwiki/settings.py

    rf52bff r763de9  
    5151# Absolute path to the directory that holds media. 
    5252# Example: "/home/media/media.lawrence.com/" 
    53 MEDIA_ROOT = '' 
     53MEDIA_ROOT = 'media' 
    5454 
    5555# URL that handles the media served from MEDIA_ROOT. Make sure to use a 
  • dashwiki/urls.py

    ra32cc8 r763de9  
    2323) 
    2424 
     25import dashwiki.settings as settings 
    2526urlpatterns += patterns('', 
    2627  url( 
    27     r'^media/(?P<path>.*)$', 
    28     'django.views.static.serve', { 'document_root': 'media' }, 
    29     name = "static_media" 
     28    r'^static/(?P<path>.+)$', 
     29    'django.views.static.serve', { 'document_root': settings.MEDIA_ROOT }, 
     30    name = "static_files" 
    3031  ), 
    3132) 
  • templates/template.html

    ra32cc8 r763de9  
    33<head> 
    44        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    5         <link rel="stylesheet" type="text/css" href="{% url static_media '' %}style.css " /> 
     5        <link rel="stylesheet" type="text/css" href="{% url static_files path='style.css' %}" /> 
    66        <title>{% block title %}&lt;default title&gt;{% endblock %} | DashWiki</title> 
    77</head> 
     
    1111        <div id="navbar"> 
    1212                <ul id="left-navbar"> 
    13                         <li><a href="{% url wiki.views.handle_wiki "WikiStart" %}"><img src="{% url static_media '' %}home.png" alt=""/>Home Page</a></li> 
     13                        <li><a href="{% url wiki.views.handle_wiki "WikiStart" %}"><img src="{% url static_files path='home.png' %}" alt=""/>Home Page</a></li> 
    1414                        <li><a href="{% url wiki.views.list_pages %}">All pages</a></li> 
    1515                        <li><a href="{% url wiki.views.list_history %}">All changes</a></li> 
Note: See TracChangeset for help on using the changeset viewer.