drf

2024-01-04 Thread NAOUI YACINE
this a apiview to upload files , i don't know where is the mistake 
class Article_upload(APIView):
parser_classes = (FileUploadParser,)
def post(self, request, *args, **kwargs):
file_obj = request.FILES.get('file')

if file_obj is None:
return Response({'error': 'No file found in the request'}, status=status.
HTTP_400_BAD_REQUEST)

if not file_obj.name.endswith('.pdf'):
return Response({'error': 'File must be a PDF'}, status=status.
HTTP_400_BAD_REQUEST)

# Process the uploaded PDF file as needed (e.g., save to disk, extract 
information, etc.)
# In this example, we are just returning the file name in the response.
return Response({'filename': file_obj.name}, status=status.HTTP_201_CREATED)

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/30287793-ae94-49ce-a5ee-77b6a55b04a0n%40googlegroups.com.


Re: Django Rest Framework support for Django 4.2

2024-01-04 Thread Priyanka Sharma
EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST ='smtp.gmail.com'
EMAIL_USE_TLS=True
EMAIL_PORT=587
EMAIL_HOST_USER=<"my_gmail">
EMAIL_HOST_PASSWORD=<"app_password">

 smtplib.SMTPSenderRefused: (530, b'5.7.0 Authentication Required. For more
information, go to\n5.7.0  https://support.google.com/mail/?p=WantAuthError
q36-20020a635c2400b005ce979b861dsm4765154pgb.84 - gsmtp', '
smtp.gmail.com')

Can someone help me with this?
I'm getting this error

On Thu, 6 Jul, 2023, 9:01 pm Alex Clough,  wrote:

> Thanks, Carlos!
>
> On Thursday, July 6, 2023 at 11:06:26 AM UTC-4 croch...@gmail.com wrote:
>
>> i think yes!
>>
>> On Thu, Jul 6, 2023 at 9:03 AM Alex Clough 
>> wrote:
>>
>>> Hello Carlos,
>>>
>>> So, just to clarify, if I am pinning Django 4.2.3 (latest release) and
>>> DRF 3.14.0 (latest release) in a requirements file, I will be good to go?
>>>
>>> Thank you in advance.
>>>
>>> Alex
>>>
>>> On Friday, May 26, 2023 at 11:45:30 AM UTC-4 croch...@gmail.com wrote:
>>>
 Hi, if you need install the master/main branch you try this
 pip install
 https://github.com/encode/django-rest-framework/archive/refs/heads/master.zip
 if you do not want to wait for the tag 3.15

 cheers

 On Fri, May 26, 2023 at 9:33 AM Vitan Ivanov 
 wrote:

> Hey Carlos, thanks for the fast reply!
> Master supports it, but the latest tagged version is 3.14 and it
> doesn't. So my question is when we can expect a new tag (3.15 maybe?)
>
> On Fri, May 26, 2023, 18:25 carlos  wrote:
>
>> Hi, i think DRF now support D4.2
>> https://github.com/encode/django-rest-framework#requirements
>>
>> Cheers
>>
>> On Fri, May 26, 2023 at 5:33 AM Vitan Ivanov 
>> wrote:
>>
>>> Hello group!
>>>
>>> Django 4.2 is listed as an LTS version in the release notes
>>>  so it seems
>>> like it's the most appropriate version to start projects or upgrade to.
>>>
>>> Does anybody know when the new version of DRF which would support
>>> Django 4.2 is expected?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django REST framework" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>> send an email to django-rest-fram...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-rest-framework/537f6bd4-91e2-4891-8a7f-51685ef58235n%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>> att.
>> Carlos Rocha
>>
>> --
>> You received this message because you are subscribed to a topic in
>> the Google Groups "Django REST framework" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-rest-framework/j-TkbRyiQ1o/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> django-rest-fram...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-rest-framework/CAM-7rO3ghVbTuvnGu%3DOBH3u8X8tR7Fyo5e3yUrasX%2B_Q-n4%2BnA%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-rest-fram...@googlegroups.com.
>
 To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-rest-framework/CAC-YOfbf-utp%2B2o0zc6W0iN0JbySjvgKm9DW4T0QjXjQKpP5Aw%40mail.gmail.com
> 
> .
>


 --
 att.
 Carlos Rocha

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django REST framework" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-rest-fram...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-rest-framework/99d523ce-88cb-4ff6-ba4d-f746a8d8f620n%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>> att.
>> Carlos Rocha
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST fram