[Solved] Forbidden (403) CSRF verification failed. Request aborted.

It is a cross site problem and a Django prevention mechanism. The error reports are as follows:

Generally, this can happen when a genuine cross-site request is forged, or when Django’s CSRF mechanism is not being used correctly. For POST forms, you need to make sure that:
Your browser is accepting cookies.
The view function passes a request to the template’s rendering method.
In the template, each POST form has a {% csrf_token %} template token pointing to an internal URL.

If you are not using the CsrfViewMiddleware, then you must use csrf_protect on any view that uses the csrf_token template tag and on those views that accept POST data.

The form has a valid CSRF token. You may need to reload the page with the form after logging in to another browser tab or clicking the back button after logging in, as the token is rotated after logging in.

You will see the help section of this page because there is DEBUG = True in your Django settings file. changing it to False will only show the initial error message.
You can customize this page using the CSRF_FAILURE_VIEW setting.
As the error message suggests, there are two ways we can do this.
1. go to setting and comment out # ‘django.middleware.csrf.CsrfViewMiddleware’
This is the same as removing the middleware from the cross-site prevention mechanism. Then not this error is reported, but if we really encounter cross-domain problems, we may not know it is reported this error, not very recommended.
2. Add {% csrf_token %} to the form below

Read More: