Opened 5 years ago
Closed 5 years ago
#31075 closed Bug (worksforme)
CSRF token missing or incorrect when File upload path not exist.
Reported by: | Andrew Lee | Owned by: | nobody |
---|---|---|---|
Component: | File uploads/storage | Version: | 1.11 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
For example model
class TargetContent(models.Model): target = models.ForeignKey( Target, related_name='contents', verbose_name=_('Target'), on_delete=models.CASCADE ) image = models.ImageField(upload_to ='target_content/')
And if target_content directory doesn’t exist and I am trying to load image from admin page I receive 403 Forbidden with error "CSRF token missing or incorrect"
Change History (1)
comment:1 by , 5 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Summary: | CSRF token missing or incorrect when File upload path not exist → CSRF token missing or incorrect when File upload path not exist. |
Note:
See TracTickets
for help on using tickets.
It works properly for me on Django 3.0 and Django 1.11. Moreover Django 1.11 doesn't receive bugfixes anymore.