Yes, you are right, this file is only for verification and not served
regullary, so it is easier to add such urlpattern.
Martin
On Wed, 19 Jan 2011 22:36:37 +0100, Eduardo Cereto Carvalho
<[email protected]> wrote:
Your static files probably already live in your MEDIA_URL and this file
must
live in your root path.
As this is just a single file and won't be handled often you can take the
same approach I use when dealing with robots.txt. Keep in mind that this
is
not a recomended way to serve static files but you can think about these
files as exceptions.
Add a line to your url conf with the path you want it to be on and create
the file as a template with only static content:
urlpatterns += patterns('django.views.generic.simple',
(r'^robots.txt$', 'direct_to_template', {'template':'robots.txt',
'mimetype':'text/plain'}),
)
On Wed, Jan 19, 2011 at 5:03 PM, Martin Tiršel <[email protected]>
wrote:
This is a static file and should be served directly by webserver, so you
need to configure your webserver to provide this file (like other static
files but from another url).
It is possible to server it by Django too, then you are looking for
django.views.static.serve but It is not recommended.
Regards,
Martin Tirsel
On Wed, 19 Jan 2011 19:39:41 +0100, galago <[email protected]> wrote:
How can I put a file, which is needed by the Google Webmasters Tool?
Where
to put it or how to configure django to read it?
--
You received this message because you are subscribed to the Google
Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected]<django-users%[email protected]>
.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.