मेरी views.py
मुद्रण नहीं csrf_tokenDjango छिपी हुई इनपुट फ़ील्ड
<html>
<body>
<h1> All uploaded posters: </h1>
<form action='/posters/upload' method= 'POST'>{%csrf_token%}
<input type='file' name= 'uploadfile'>Upload new poster <input type="submit" value = "Upload">
</form>
{%for file in files %}
<a href = 'http://servername/~username/posters/{{file}}'>{{file}}</a> <br />
{%endfor%}
</body>
</html>
तो
जब मैं ब्राउज़र में मुखपृष्ठ खोलना और स्रोत कोड देख सकते हैं और वहाँ कोई CSRF टोकन है !
<html>
<body>
<h1> All uploaded posters: </h1>
<form action='/posters/upload' method= 'POST'>
<input type='file' name= 'uploadfile'>Upload new poster <input type="submit" value = "Upload">
</form>
<a href= ......
मुझे क्या याद आया?
अद्यतन: this में मदद की।
धन्यवाद, यह मुझे पागल कर रहा था। खुशी है कि यह कुछ आसान था। – Cerin