Opened 7 years ago

Closed 7 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 Mariusz Felisiak, 7 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.

It works properly for me on Django 3.0 and Django 1.11. Moreover Django 1.11 doesn't receive bugfixes anymore.

Note: See TracTickets for help on using tickets.
Back to Top