Hello

Thanks for the answer, but like I said, I'm working with DjangoAdmin and 
not a custom form.
So DjangoAdmin already does this.


Also when I inspect the source code in DjangoAdmin it does have the 
"multipart/form-date" in my form tag.

Regards

On Tuesday, 28 December 2021 at 09:35:42 UTC+1 sebasti...@gmail.com wrote:

> Hello,
>
> try 
>
> <form method="POST" action="" enctype='multipart/form-data' >
>
> in your html template- I think this works...
>
> Regards
>
> Am Di., 28. Dez. 2021 um 08:26 Uhr schrieb Yorben Verhoest <
> yorben....@gmail.com>:
>
>> So, turn out that the problem occurs because for some reason my 
>> request.POST data is empty.
>>
>> I found out because I wrote a custom CSRFfailureview where I print out my 
>> request data.
>>
>> The reason I get a csrf is missing error is because that token is also 
>> stored in there.
>>
>> Now I'm trying to figure out why my POST data is empty only on models 
>> where an filefield or imagefield is defined...
>>
>> On Tuesday, 21 December 2021 at 07:59:31 UTC+1 Yorben Verhoest wrote:
>>
>>> Yes, I'm just using the DjangAdmin interface
>>>
>>> It works perfectly for models without any filefield / imagefield
>>> First I thought that the connection between the app and the s3 bucket 
>>> was wrong, but when I test i through the shell, it works.
>>> On Monday, 20 December 2021 at 19:50:28 UTC+1 phoebeb...@gmail.com 
>>> wrote:
>>>
>>>> So you are adding these images using the standard DjangoAdmin interface?
>>>>
>>>> On Monday, 20 December 2021 at 14:13:23 UTC Yorben Verhoest wrote:
>>>>
>>>>> I have a project which is set up on AWS using lambda, s3, ...
>>>>>
>>>>> Because it is still in production we are using DjangoAdmin to manage 
>>>>> the data in it.
>>>>> All of my models work fine when I try to save them except the ones 
>>>>> that have a filefield or imagefield in them. When I save those, I get a 
>>>>> 403 
>>>>> - CSRF token missing error.
>>>>>
>>>>> The weird thing is, working on localhost, It works perfectly, it even 
>>>>> saves the files correctly into the s3 bucket. but once deployed on AWS 
>>>>> Lambda, it throws me this error.
>>>>>
>>>>> Anybody else had this problem? I've been searching for answers this 
>>>>> whole past week..
>>>>>
>>>>> Thanks in advance
>>>>>
>>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/82bf1502-42d9-44ae-a6c8-a8a594d52b10n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/82bf1502-42d9-44ae-a6c8-a8a594d52b10n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6d61b57f-919f-4341-9ae1-000b9c28ccd8n%40googlegroups.com.

Reply via email to