-1

403 forbidden. CSRF token missing or incorrect. I have already tried from django.views.decorators.csrf import csrf_protect, it doesn't work. I have not used render_to_request either.

Beginner
  • 1
  • 3

2 Answers2

0

Here's an example of the csrf_token in the html of the form. That's a requirement. Do a search on csrf_token to read about it and/or read the docs.

    <form enctype="multipart/form-data" method="post" action="/finance/gl_upload/">
        {% csrf_token %}
        <table>
            {{form.as_table}}
        </table>
        <input type="submit" value="Submit" id="Save" />
    </form>
Deepstop
  • 3,627
  • 2
  • 8
  • 21
  • Good to know. You might want to add some more information to your question, then. If you've tried things, then you should show that. – Deepstop Jul 13 '19 at 16:22
0

I tried clearing the data and it worked! Thank you all for the help.

Beginner
  • 1
  • 3