2👍
The rewrite option is good, the ‘Apache Way’ is probably more like:
<LimitExcept GET POST>
deny from all
</LimitExcept>
or…
<Limit OPTIONS>
deny from all
</Limit>
2👍
I found a solution used by a different framework and ported to Django. I place this at the top of any view that generate HTML with links to .XLS or .DOC files:
if request.method == 'OPTIONS':
response = HttpResponse()
response['Allow'] = 'GET, HEAD, POST'
return response
I like Apache solution better though… assuming it doesn’t cause problems on the Windows side of things.
- [Django]-Django flush query caches
- [Django]-WHAT IS DIFFERENCE BETWEEN get_user_model() ,settings.AUTH_USER_MODEL and USER in django?
- [Django]-Getting error while running django-cms demo page
- [Django]-How to run two django apps in same server with different dynamic DJANGO_SETTINGS_MODULE env variables
1👍
How about:
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^OPTION
RewriteRule .* - [F]
(With mod_rewrite enabled.)
- [Django]-South ValueError: Cannot successfully create field for model: 'module' object has no attribute <CustomClassAttributeHere>
- [Django]-Implementing Django language selection form as buttons
- [Django]-Django rest framework: How to change error response format globally
- [Django]-How to make certain that the queryset will be ordered by a valid field – django
Source:stackexchange.com