I am connecting to a SNS website and the website requires me to put a file at the root directory of the domain, such as http://www.a.com/test.txt and it will fetch it automatically to verify I am the owner of the domain.
I am using django and all the static files are under http://www.a.com/static/, how can I write the URL file to specify a file test.txt so that when the robot of the SNS website fetch the URL http://www.a.com/test.txt, it will correctly fetch the file I uploaded?
Thanks.
If you are running apache, set up an alias in apache's httpd.conf:
#Alias /test.txt /filesystem/path/to/test.txt
There's no reason why it has to be an actual physical file. You could just as easily return whatever magic text is required via a view, mapped to the relevant URL:
url(r'^test\.txt', 'test_view')
def test_view(request):
return HttpResponse("My magic text here", mimetype='text/plain')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With