WebFaction
Community site: login faq

Hi, I have a django application serving from my root domain e.g. domain.com/ this page generates the home page from django.

So I have / -> django and I understand that I can only have one app mapped to /

However I would also like to serve robots.txt statically at domain.com/robots.txt plus some other static files off /.

What would be the recommended way to do this? Have django serve these static files from a view? Is it possible to have nginx look for a static file and if not there redirect to django app? Or something else,

Thanks,

asked 21 Sep '12, 04:10

alpatters
112
accept rate: 0%


There are a few ways to server your robots.txt file.

One could be by editing your application's httpd.conf file, adding some alias, or using django's urls.py to create the response. See our old forum post that covers the basics.

Another way would be to install an app like django-robots.

permanent link

answered 21 Sep '12, 04:22

iliasr ♦♦
2.1k14
accept rate: 35%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×125
×22

question asked: 21 Sep '12, 04:10

question was seen: 2,458 times

last updated: 21 Sep '12, 04:22

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM