Show
Ignore:
Timestamp:
04/06/08 21:51:53 (4 months ago)
Author:
simon
Message:

Added robots.txt.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bitstructures/trunk/substructure/urls.py

    r72 r73  
    99    (r'^drafts/(?P<slug>[a-z0-9-]+)/(?P<num>\d+)/(?P<filename>[a-zA-Z0-9-_\.]+)$', 'draft_codeblock'), 
    1010    (r'^fb-atom.xml$', 'atom_feed'), 
    11     (r'^all$', 'all') 
     11    (r'^all$', 'all'), 
     12    (r'^robots.txt$', 'robots_txt') 
    1213) 
    1314 
  • bitstructures/trunk/substructure/views.py

    r72 r73  
    22from django.shortcuts import get_object_or_404, render_to_response 
    33from django.template import Context, loader 
     4from django.template.loader import render_to_string 
    45from django.contrib.sites.models import Site 
    56from django.conf import settings 
     
    1314    if ('page' in request.GET) and (int(request.GET['page']) > 0): 
    1415        page = int(request.GET['page']) 
    15     if settings.SUBSTRUCTURE_NUM_ENTRIES_PER_PAGE
     16    if hasattr(settings, 'SUBSTRUCTURE_NUM_ENTRIES_PER_PAGE')
    1617        num_entries_per_page = settings.SUBSTRUCTURE_NUM_ENTRIES_PER_PAGE 
    1718    else: 
     
    9394    return render_to_response('substructure/all.html', data) 
    9495 
     96def robots_txt(request): 
     97    return HttpResponse(render_to_string('substructure/robots.txt'), 
     98        mimetype='text/plain') 
     99 
    95100def get_published_entries(): 
    96101    return Entry.objects.filter(date_published__isnull=False)