Skip to content

Commit

Permalink
Merge pull request #185 from glogiotatidis/fixrobots
Browse files Browse the repository at this point in the history
Fix /robots.txt
  • Loading branch information
jgmize committed Apr 5, 2016
2 parents e80e817 + 831d680 commit 29edd24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions snippets/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,5 @@

SNIPPET_HTTP_MAX_AGE = config('SNIPPET_HTTP_MAX_AGE', default=90)
SNIPPETS_PER_PAGE = config('SNIPPETS_PER_PAGE', default=50)

ENGAGE_ROBOTS = config('ENGAGE_ROBOTS', default=False)
3 changes: 1 addition & 2 deletions snippets/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

def robots_txt(request):
permission = 'Allow' if settings.ENGAGE_ROBOTS else 'Disallow'
return HttpResponse('User-agent: *\n{0}: /'.format(permission),
mimetype='text/plain')
return HttpResponse('User-agent: *\n{0}: /'.format(permission), content_type='text/plain')

urlpatterns = [
url(r'', include('snippets.base.urls')),
Expand Down

0 comments on commit 29edd24

Please sign in to comment.