having two lookup field in viewset in DRF

2025-02-05 Thread Mohammad Asadi
hi everyone this is the link to mu question in django forum https://forum.djangoproject.com/t/having-two-lookup-field-in-viewset-in-drf/38573/1 any help would be appriciated thansk -- You received this message because you are subscribed to the Google Groups "Django REST framework&q

DRF docs

2024-11-10 Thread Тимур Белянин
Hello! On the first page of DRF documentation i think there is a redundant comma in this text " - Extensive documentation, and great community support <https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework> . " (https://www.django-rest-framewor

Re: Integrating Django WebPush with DRF and React Frontend

2024-07-31 Thread azeem
Implementing web push notifications in a Django project using Django Rest Framework (DRF) and React without relying on external service providers can be achieved using the django-webpush package. Here’s a detailed guide to help you set it up. Step 1: Install Required Packages First

Integrating Django WebPush with DRF and React Frontend

2024-07-17 Thread cendiant analysis
Hello everyone, I am working on a project where I need to implement web push notifications using Django. My backend is based on Django Rest Framework (DRF), and my frontend is built with React. I am looking for a solution that does not rely on external service providers like Firebase or

Re: View Url Not displayed in DRF web page

2024-06-07 Thread Mokhtar BEN MESSAOUD
I get the response on https://stackoverflow.com/questions/28730109/adding-a-apiview-to-django-rest-framework-browsable-api APIView can not be displayed by Api Root page Le jeudi 6 juin 2024 à 20:47:52 UTC+1, Mokhtar BEN MESSAOUD a écrit : > Hello > > I defined a view for Test > class UserView

View Url Not displayed in DRF web page

2024-06-06 Thread Mokhtar BEN MESSAOUD
Hello I defined a view for Test class UserView(APIView): http_method_names = ['get'] def get(self, request): # Your code to handle the GET request goes here return Response("This is a GET request") I added the view in urls.py urlpatterns = [ path('', include(router

Updating nested in Elasticsearch DSL within DRF?

2024-03-24 Thread Manikandan FMJ
When updating nested objects in Django Rest Framework (DRF), they might be stored as objects instead of Nested, causing issues during search queries. How can I resolve this issue? View file profile = DetailsDocument.get(id=user_id) profile.update(**serializer.validated_data) profile.save

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'}, sta

drf-api-action - a new way of testing in rest framework

2023-12-20 Thread Ori Roza
Hi all! I’m proud to share my new first open-source project drf-api-action, and I’d be glad to receive your feedback! https://github.com/Ori-Roza/drf-api-action This project was built as a side project at work in which we had to tweak DRF for our own needs, this project was successful

drf-api-action package

2023-12-04 Thread Ori Roza
Hi guys, I would like to sure my new *open source* project which might be helpful for some of you. The *drf-api-action* <https://github.com/Ori-Roza/drf-api-action> Python package is designed to elevate your *testing experience* for *Django Rest Framework* (DRF) REST endpoints. Wi

External OpenID authentication with DRF backend and React frontend

2023-11-25 Thread Geoffrey Ferrari
Suppose you want to achieve the following: - a DRF backend - a React (or other pure JS) frontend - users will authenticate via an OpenID Connect service such as AWS Cognito, Auth0 or similar. What are the recommended ways of achieving that? I imagine in 2023 something like this would be one of

Re: JSON validation from DRF

2023-11-20 Thread : Anthony: Crawford.
Thank you for your help. This got me going. Cheers On Monday, November 20, 2023 at 4:22:36 AM UTC-4 m.gur...@gmail.com wrote: > As I see in your code, I think you misunderstood the RetrieveAPIView. You > cannot get a single object while giving multiple objects. If you create a > RetrieveAPIView

Re: JSON validation from DRF

2023-11-20 Thread Mehmet Gürol Çay
As I see in your code, I think you misunderstood the RetrieveAPIView. You cannot get a single object while giving multiple objects. If you create a RetrieveAPIView, you need to know which object is selected. I mean, you need to pass the ID of RokuContentFeed to your get method of RokuContentFee

Re: JSON validation from DRF

2023-11-18 Thread : Anthony: Crawford.
Thank you, yes, many=True will turn any field a list. However my issue is that this response data is the main object. It is returning a list of objects [ { } ] instead of one object { }. I changed my view to contain this code for now, but its defintely not a final solution. This code will retur

Re: JSON validation from DRF

2023-11-03 Thread 'Leonardo Salvadori' via Django REST framework
hi Anthony, as i know, the "many" parameter in your RokuContentFeedSerializer method makes your data an array [ ]. Em qua., 1 de nov. de 2023 às 19:10, : Anthony: Crawford. < crawfishme...@gmail.com> escreveu: > Hi, > I am trying to create an API that will provide JSON data that is based on > Rok

JSON validation from DRF

2023-11-01 Thread : Anthony: Crawford.
Hi, I am trying to create an API that will provide JSON data that is based on Roku JSON specification (https://developer.roku.com/en-ca/docs/specs/direct-publisher-feed-specs/json-dp-spec.md). The specification requires that the JSON data is a single object { }, not a list array [ ]. So far I am

Re: I'm using DRF and I'm stuck at creating a nested serializer for many to many realtionship:

2023-07-24 Thread Chetan Ganji
Hey, Always send properly formatted code. class StreamPlatfrom(models.Model): name = models.CharField(max_length=100) about = models.CharField(max_length=150, null=True) website = models.URLField() id = models.UUIDField( primary_key=True, default=uuid.uuid4, editable=False, unique=True ) created

I'm using DRF and I'm stuck at creating a nested serializer for many to many realtionship:

2023-07-24 Thread Pratap Padekar
1. here are my models: 2. [10:23 PM] class StreamPlatfrom(models.Model): name = models.CharField(max_length=100) about = models.CharField(max_length=150, null=True) website = models.URLField() id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False,

DRF. Test APIClient, problems with request body and credentials

2023-07-07 Thread Alexander December
Hi, guys! During last 4 hours I've tried to get clear knowledge bout the situation with post-requests made by API Client. Think, I''ve found the bug. Briefly background - we try to test standard DRF APIView, post method but WITH our specific credentials (fundamentally, we need cu

Re: DRF Invalid value Error

2023-04-05 Thread Amed Sheriff
Guys just found a solution. Thanks to those that did contribute, I did appreciate it. On Fri, Mar 31, 2023 at 1:24 PM Amed Sheriff wrote: > Hello Tanveer Ahmad, > > We are not sending the ID rather the FK value associated with which userid > (a name which already unique) > > Thanks by the way. >

Re: DRF Invalid value Error

2023-04-05 Thread Amed Sheriff
Hello Team, I am just following up on the above discussion as it's been days now and I haven't heard from anyone. On Thu, Mar 30, 2023 at 4:48 PM Amed Sheriff wrote: > Hello Team, > > Please could look into it for me maybe i am doing something wrong. > > > This is my model. > > class Counter(mo

Re: DRF Invalid value Error

2023-03-30 Thread Umair Ramzan
You have to replace the field with relevant model field name in your identification Model. On Thu, 30 Mar 2023, 18:07 Amed Sheriff, wrote: > Hello @Umair Ramzan, > > Please with your approach i am getting this error. > Code: > > userid = serializers.SlugRelatedField( > slug_field='use

Re: DRF Invalid value Error

2023-03-30 Thread Amed Sheriff
I believe the lookup_field works with get not post, however i did tried it and got this error for POST lookup_field='userid' Error: {"userid":["Incorrect type. Expected pk value, received str."]} Please is there anyone that understands how to work around this. On Thu, Mar 30, 2023 at 12:02 PM Ab

Re: DRF Invalid value Error

2023-03-30 Thread Amed Sheriff
Hello @Umair Ramzan, Please with your approach i am getting this error. Code: userid = serializers.SlugRelatedField( slug_field='userName', queryset=Identification.objects.all() ) class Meta: model = Counter fields = '__all__' def to_internal_value(

Re: DRF Invalid value Error

2023-03-30 Thread Abhishek Chauhan
haven’t tried your code but can you like override lookup_field = “userid” in the viewset class in views.py so that way your view will look for the userid while making the post request . But somehow after the lookup is done then the view will try to save to the model using the serializers so there

Re: DRF Invalid value Error

2023-03-30 Thread Amed Sheriff
Hello Team Please this is the view requested. class Counter_Viewsets(errorhandler, viewsets.ModelViewSet): permission_classes = [permissions.IsAuthenticated, TokenHasResourceScope] serializer_class = Message_Counter_Serializer def get_queryset(self): return Counter.objects.al

Re: DRF Invalid value Error

2023-03-29 Thread Umair Ramzan
You can overrite the to_internal_value method in the serializer. Field - candidate key --- def to_internal_value(self, data): userid = Identification.obejcts.get(field=data["userid"]).id resource = data.copy().update({'userid':userid}) return super().to_internal_value(resource) On

Re: DRF Invalid value Error

2023-03-29 Thread Abhishek Chauhan
Show the views.py On Thu, 30 Mar 2023 at 4:36 AM, Amed Sheriff wrote: > Hello Team, > > Please i need help with this which has taken me over two weeks and still > couldn't come up with anything after surfing the internet. > > Is there any posibility to post data to foreign key using the value ra

Re: DRF Invalid value Error

2023-03-29 Thread Tanveer Ahmad
I think so, there's no way you have to send id only that must be unique On Thu, Mar 30, 2023, 4:06 AM Amed Sheriff wrote: > Hello Team, > > Please i need help with this which has taken me over two weeks and still > couldn't come up with anything after surfing the internet. > > Is there any posib

DRF Invalid value Error

2023-03-29 Thread Amed Sheriff
Hello Team, Please i need help with this which has taken me over two weeks and still couldn't come up with anything after surfing the internet. Is there any posibility to post data to foreign key using the value rather than the FK ID. Bcz i have tried all kinds of scenarios but none seemed to wor

Problem having making DRF permissions work as per my requirement

2023-01-26 Thread Ahmer Ahmed
rAdmin()|IsOwner()|IsAdmin(), ] but I'm getting below mentioned error TypeError: unsupported operand type(s) for |: 'IsSuperAdmin' and 'IsOwner. SO link: https://stackoverflow.com/questions/75202245/composite-permissions-drf Thanks. -- You received this message because you ar

Re: How to use ASYNC in DRF

2022-10-16 Thread Subhonjon Ahmadjonov
Thank you bro 👍👍 Pay, 6-okt, 2022, 20:32 Saifullah Shahen : > In the Django Rest Framework, how can i use async because Django supports > async. So, how can i use that async in DRF class based view. If you have > done async drf, please provide me a example. > Thanks. > > -- &

Re: How to use ASYNC in DRF

2022-10-13 Thread Jason
https://github.com/encode/django-rest-framework/discussions/7774 On Thursday, October 6, 2022 at 11:32:23 AM UTC-4 shahr...@gmail.com wrote: > In the Django Rest Framework, how can i use async because Django supports > async. So, how can i use that async in DRF class based view. If yo

How to use ASYNC in DRF

2022-10-06 Thread Saifullah Shahen
In the Django Rest Framework, how can i use async because Django supports async. So, how can i use that async in DRF class based view. If you have done async drf, please provide me a example. Thanks. -- You received this message because you are subscribed to the Google Groups "Django

Re: Best UI Framework for DRF based site

2022-09-30 Thread Sudhakar Donkena
React or vue js On Fri, 30 Sep, 2022, 11:13 am Ram, wrote: > Hi, > > We would like to know which UI framework is best for an application which > is being developed with Django and Django REST APIs. > > Best regards, > ~Ram > > -- > You received this message because you are subscribed to the Goog

Re: Best UI Framework for DRF based site

2022-09-30 Thread tom626 tao
react > 2022年9月30日 14:44,Abdul Wahab Wahab > 写道: > > Other option is AdminLTE Django > > On Fri, 30 Sep 2022, 11:36 Abdul Wahab Wahab, > wrote: > You can use django jasmine. And can also customise it by scratch. > > On Fri, 3

Re: Best UI Framework for DRF based site

2022-09-29 Thread Abdul Wahab Wahab
Other option is AdminLTE Django On Fri, 30 Sep 2022, 11:36 Abdul Wahab Wahab, wrote: > You can use django jasmine. And can also customise it by scratch. > > On Fri, 30 Sep 2022, 10:43 Ram, wrote: > >> Hi, >> >> We would like to know which UI framework is best for an application which >> is bein

Re: Best UI Framework for DRF based site

2022-09-29 Thread Abdul Wahab Wahab
You can use django jasmine. And can also customise it by scratch. On Fri, 30 Sep 2022, 10:43 Ram, wrote: > Hi, > > We would like to know which UI framework is best for an application which > is being developed with Django and Django REST APIs. > > Best regards, > ~Ram > > -- > You received this

Best UI Framework for DRF based site

2022-09-29 Thread Ram
Hi, We would like to know which UI framework is best for an application which is being developed with Django and Django REST APIs. Best regards, ~Ram -- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To unsubscribe from this group and s

Google maps Integration with DRF

2022-09-12 Thread Kunal Zaveri
Hello all, I want to integrate the google map API with DRF. But, I do not know How to do this? If anyone is working on this can give detailed descriptions How integrated? -- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To u

Re: Do we really need an UI for DRF?

2022-08-16 Thread Wanderley S
Hello. Short answer is, NO, you don't need any UI (front end) for any REST API you build. DRF has the browseable API and the recommendation is to disable it for production, you can use the browseable API for testing and help you during the development process, but for production you should di

Do we really need an UI for DRF?

2022-08-15 Thread Ram
Hi, We have an ecommerce website which was developed using Django template based and the stack that we used: 1. Django ( no DRF ) 2. Python 3. PostgreSql 4. HTML, CSS, Javascript, Jquery and partly Vue.js Now we are trying to write REST APIs using DRF for the same website and we are using this

Re: How to change the default username to email, in DRF obtain token login

2022-08-12 Thread Antun Franjin
ctive=True).username >> except: >> return Response({"success": False, 'response': {'message': 'Sorry! Your >> account is not active!'}}, >> status=status.HTTP_400_BAD_REQUEST) >> user = authenticate(username=user, password=pass

Re: How to change the default username to email, in DRF obtain token login

2022-08-11 Thread M Adnan
m user model and override username to email >> >> On Fri, 12 Aug 2022 at 9:03 AM, Suraj Singh >> wrote: >> >>> Kindly help me to solve this issue, posted it in django forum, >>> >>> >>> https://forum.djangoproject.com/t/how-to-change-

Re: How to change the default username to email, in DRF obtain token login

2022-08-11 Thread M Adnan
password=password) On Fri, 12 Aug 2022, 8:34 am Abhishek Chauhan, wrote: > Use custom user model and override username to email > > On Fri, 12 Aug 2022 at 9:03 AM, Suraj Singh > wrote: > >> Kindly help me to solve this issue, posted it in django forum, >> >>

Re: How to change the default username to email, in DRF obtain token login

2022-08-11 Thread Abhishek Chauhan
Use custom user model and override username to email On Fri, 12 Aug 2022 at 9:03 AM, Suraj Singh wrote: > Kindly help me to solve this issue, posted it in django forum, > > > https://forum.djangoproject.com/t/how-to-change-the-default-username-to-email-in-drf-obtain-token

How to change the default username to email, in DRF obtain token login

2022-08-11 Thread Suraj Singh
Kindly help me to solve this issue, posted it in django forum, https://forum.djangoproject.com/t/how-to-change-the-default-username-to-email-in-drf-obtain-token-login/15383 -- You received this message because you are subscribed to the Google Groups "Django REST framework"

drf-standardized-errors: return the same response format for all 4xx and 5xx errors in your DRF API

2022-06-15 Thread Ghazi
The package idea is simple: let’s create DRF APIs <https://www.django-rest-framework.org/> that care about error responses as much as they care about successful ones. As developers, It’s easy for us to focus on the API implementation for successful responses and forget about the p

Re: SSL error on DRF fund page

2022-03-14 Thread Shashank
This issue has been resolved. Thanks. On Friday, 12 November 2021 at 20:11:21 UTC+1 Shashank wrote: > Hello, > > The fund page[0] of DRF is showing an SSL error on Firefox. Can someone > with access to the server please check the issue? The error states > "Websites prov

Asking for recommendations om DRF-based REST API to communicate with mobile app

2022-03-02 Thread mich123prem
I would like to build a REST Service which exchanges JSON messages with instances of a mobile app for registering patron traffic in physical locations of (public and academic) libraries. I plan on using Django Rest Framework, and using Django and DRF for the first time, I have some

SSL error on DRF fund page

2021-11-12 Thread Shashank
Hello, The fund page[0] of DRF is showing an SSL error on Firefox. Can someone with access to the server please check the issue? The error states "Websites prove their identity via certificates. Firefox does not trust this site because it uses a certificate that is not valid for fund.d

Add support for view permission to DRF

2021-08-02 Thread Federico Capoano
Hi everyone, there's been a pull request up to include support for the view permission of Django in DRF for a few months now: https://github.com/encode/django-rest-framework/pull/8009 It's been done by keeping backward compatibility in mind. I hope somebody can review it and

Re: Up votes | Down votes | Django | DRF

2021-06-24 Thread DJANGO DEVELOPER
On Thu, Jun 24, 2021 at 7:18 PM DJANGO DEVELOPER wrote: > Hi Django experts. > I am building a Django, DRF based mobile app and I want to have > functionality of up votes and down votes for posts that user will post. > So what I want to say here that, if an user upvotes a post th

Snippets Tutorial on DRF -- Responding to 404 Error

2021-05-24 Thread Djangonaut
I have followed the snippets tutorial to the end and have a question regarding responding to a 404 Error for a snippet or any other item that is not found. Please see attached image. Is there a way to disable the `DELETE` operation and `PUT` form when an error is raised? Where in the code can

DRF Generic relations serialization

2021-05-18 Thread Fun Shar
Hello, could anyone help me please with the error? I posted the question with all details here: stackoverflow Thank you in advance! -- You received this message because you are subscribed to

How to validate different data in the same serializer in DRF

2021-02-23 Thread Syed Shamikh Shabbir
Hi, I need help with something This is my current setup I want to be able to create new contributor entities as well as relating the old entities using the same data all when sending the parent Campaign data. I cannot use create method in serializers as I want all my logic to be reusable since

Streamline process for React + DRF Session authentication

2021-02-16 Thread Brian Soto
7;ve found, observe, it involves quite a few hoops to jump: https://medium.com/swlh/django-rest-framework-and-spa-session-authentication-with-docker-and-nginx-aa64871f29cd So what I want to propose is some kind of streamlined process for React + DRF for session authentication. I'm not knowled

DRF JWT, accessing the token

2021-01-06 Thread Stats Student
Hi, I am using DRF JWT ( https://jpadilla.github.io/django-rest-framework-jwt/) and as part of the authentication process (receiving / verifying the token), I also need to send the token to another endpoint (provided by the authentication service) to obtain additional user information. I have a

Re: What is the best practice to implement user registration, login, log out using drf api

2020-10-27 Thread brijesh dutta
r registration, login, log out >> using drf api, >> >> could anyone suggest any documentation or videos will be really helpful >> >> >> thank you >> >> -- >> You received this message because you are subscribed to the Google Groups &

Re: What is the best practice to implement user registration, login, log out using drf api

2020-10-27 Thread Rahul Salgare
https://youtu.be/rJWAGQ0JxxI This series helped me On Tue 27 Oct, 2020, 2:44 PM brijesh dutta What is the best practice to implement user registration, login, log out > using drf api, > > could anyone suggest any documentation or videos will be really helpful > > > than

What is the best practice to implement user registration, login, log out using drf api

2020-10-27 Thread brijesh dutta
What is the best practice to implement user registration, login, log out using drf api, could anyone suggest any documentation or videos will be really helpful thank you -- You received this message because you are subscribed to the Google Groups "Django REST framework"

Re: DRF override settings during testing

2020-09-17 Thread Alan Crosswell
Also, take a look in tests/ for examples like this: @override_settings(REST_FRAMEWORK={'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.AutoSchema'}) On Thu, Sep 17, 2020 at 9:57 AM Alan Crosswell wrote: > It's plural: > > grep -nr DEFAULT_FILTER_BACKEND rest_framework/settings.py > > rest_frame

Re: DRF override settings during testing

2020-09-17 Thread Alan Crosswell
It's plural: grep -nr DEFAULT_FILTER_BACKEND rest_framework/settings.py rest_framework/settings.py:52:'DEFAULT_FILTER_BACKENDS': [], rest_framework/settings.py:141:'DEFAULT_FILTER_BACKENDS', On Thu, Sep 17, 2020 at 2:47 AM mohammad moghadas < s.m.moghadas2...@gmail.com> wrote: > Hi g

DRF override settings during testing

2020-09-16 Thread mohammad moghadas
Hi guys i'm trying to override `DEFAULT_FILTER_BACKEND` in tests. I've attempted 2 approaches which have caused to failure: 1- @override_settings decorator top of both method and class 2- using with self.settings(REST_FRAMEWORK={...}) context manager I don't know whether it needs to modify my vie

Should we expect New version of DRF for Django 3.1 ?

2020-09-06 Thread Raj
It will be great if someone could confirm or share a link stating new release of DRF. is there any DRF Release Calendar ? Why DRF Documentation seems old specifically URL Patterns ? Should we expect this change with new DRF Release ? -- You received this message because you are subscribed to

Re: DRF throws 500 if we raise Django ValidationError from validate_unique

2020-08-20 Thread Ryoma Han
As you said, you get an error in Django Admin, not DRF Admin! 在2020年8月20日星期四 UTC+8 上午11:26:03 写道: > HEHE > > JD Solanki 于2020年7月21日周二 下午7:11写道: > >> Hi, I have been wondering doesn't DRF convert Django's ValidationError >> raised from `validate_unique` o

Re: DRF throws 500 if we raise Django ValidationError from validate_unique

2020-08-19 Thread wenlu han
HEHE JD Solanki 于2020年7月21日周二 下午7:11写道: > Hi, I have been wondering doesn't DRF convert Django's ValidationError > raised from `validate_unique` or from `clean` method of the model? > > I have ModelViewSet: > ```python > class UpvoteViewSet(ModelViewSet): >

Re: Reality Check for (problematic?) DRF Installation Instructions

2020-08-09 Thread AJ Bowen
By the way, there's an open pull request by @sanjusci to address this (completely valid, IMO) issue here . -- You received this message because you are subscribed to the Google Groups "Django REST framewor

Re: Reality Check for (problematic?) DRF Installation Instructions

2020-08-08 Thread Daniel Cunningham
Thanks again, everyone! I can see your point-of-view, for sure. If you're a Django veteran, and a DRF expert (and I'm glad you and the others are) it probably *is* fine (and *very* obvious). I'm just giving you my impression, as a "customer", of my first time "

Re: drf-psq

2020-08-08 Thread Yezileli Ilomo
Cool library, I made something like that too https://github.com/yezyilomo/drf-guard On Sun, Aug 2, 2020, 21:49 MohammadAmin Haghpanah wrote: > drf-psq <https://github.com/drf-psq/drf-psq/> is an extension for the > Django REST framework that gives support for havin

Re: Reality Check for (problematic?) DRF Installation Instructions

2020-08-08 Thread Carl Nobile
documentation is fine > In the "installation" link you were following you have just small pieces > of code, so don't follow this as a tutorial, if you just want "copy and > paste" go the the "Tuorial" part from the DRF (Django Rest Framework). > The &

Re: Reality Check for (problematic?) DRF Installation Instructions

2020-08-08 Thread Wanderley S
he the "Tuorial" part from the DRF (Django Rest Framework). The "Installation" provides only some examples, but you should not just copy and paste from there. In your code for example you're trying to use the url function without importing it, for this code to work pr

Re: Reality Check for (problematic?) DRF Installation Instructions

2020-08-07 Thread Daniel Cunningham
ther URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ # # Original (default) now disabled per DRF Installation Guide: https://www.django-rest-framework.org/#exa

Re: Reality Check for (problematic?) DRF Installation Instructions

2020-08-07 Thread Wanderley S
eu: > Hi All: > > I need a reality check on a misunderstanding I'm having with the > installation instructions > <https://www.django-rest-framework.org/#installation> for DRF. I've > used DRF successfully before (about a year ago) so I'm surprised I'm h

Reality Check for (problematic?) DRF Installation Instructions

2020-08-07 Thread Daniel Cunningham
Hi All: I need a reality check on a misunderstanding I'm having with the installation instructions <https://www.django-rest-framework.org/#installation> for DRF. I've used DRF successfully before (about a year ago) so I'm surprised I'm having this difficulty. The

DRF-level middlewares ?

2020-08-04 Thread Pascal Chambon
Hello everyone, I've recently needed to force the active Django language depending on the user's profile, however since this oauth-token-based auth is done only at DRF-view level, I couldn't resolve it with a normal Django middleware. It seems to be a recurring prob

drf-psq

2020-08-02 Thread MohammadAmin Haghpanah
drf-psq <https://github.com/drf-psq/drf-psq/> is an extension for the Django REST framework that gives support for having view-based *permission_classes*, *serializer_class*, and *queryset*. In a typical DRF project, you probably have faced the problem that you want to set dif

DRF throws 500 if we raise Django ValidationError from validate_unique

2020-07-21 Thread JD Solanki
Hi, I have been wondering doesn't DRF convert Django's ValidationError raised from `validate_unique` or from `clean` method of the model? I have ModelViewSet: ```python class UpvoteViewSet(ModelViewSet): queryset = Upvote.objects.all() serializer_class = UpvoteSerializer ```

Re: Sharing validation with the admin under DRF 3

2020-07-06 Thread Carl Nobile
;> I have a question about writing reusable validation logic shared between >> the admin and DRF. If I have this setup: >> >> class Foo(models.Model): >> from = models.IntegerField() >> to = models.IntegerField() >> def clean(self): if self.from > sel

Re: Sharing validation with the admin under DRF 3

2020-07-06 Thread Brent O'Connor
elf, **kwargs): self.full_clean() super().save(**kwargs) On Thursday, July 2, 2020 at 5:00:59 PM UTC-5, Ben Warren wrote: > > I have a question about writing reusable validation logic shared between > the admin and DRF. If I have this setup: > > class Foo(models.Model): &g

Sharing validation with the admin under DRF 3

2020-07-02 Thread Ben Warren
I have a question about writing reusable validation logic shared between the admin and DRF. If I have this setup: class Foo(models.Model): from = models.IntegerField() to = models.IntegerField() def clean(self): if self.from > self.to: raise ValidationError("`From` must b

Re: How to create own frontend (with Javascript, Html, CSS) in DRF instead of DRF default renderes

2020-05-14 Thread sanka nanaji
Ooh but Django restframework giving ability for the template renderers like staticHTMLrenders, templateHTMLrenderers. But still why people are going with JavaScript and frontend frameworks On Thu, May 14, 2020, 06:10 Jakob Damgaard Møller wrote: > You can choose whatever you feel like: > > Angul

Re: How to create own frontend (with Javascript, Html, CSS) in DRF instead of DRF default renderes

2020-05-14 Thread Jakob Damgaard Møller
You can choose whatever you feel like: Angular Reactjs Vue.js Ember or custom... On Thu, May 14, 2020 at 11:55 AM Wanderley S wrote: > You could also use Vue.js. > I started with react, then migrated to Vue. > In my opinion Vue is easier to understand and use and has a really awesome > document

Re: How to create own frontend (with Javascript, Html, CSS) in DRF instead of DRF default renderes

2020-05-14 Thread Wanderley S
You could also use Vue.js. I started with react, then migrated to Vue. In my opinion Vue is easier to understand and use and has a really awesome documentation, but I'd defenitely recomend you learning a little bit of Javascript (ES6) first. Em qui, 14 de mai de 2020 06:07, François I escreveu:

How to create own frontend (with Javascript, Html, CSS) in DRF instead of DRF default renderes

2020-05-14 Thread François I
Use react, it does the job. -- 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

How to create own frontend (with Javascript, Html, CSS) in DRF instead of DRF default renderes

2020-05-13 Thread sanka nanaji
hello Guys, could someone tell me how to create Frontend using javascript, HTML for my API in DRF. -- 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

Introducing DRF Guard, a library for making simple to complex access rules.

2020-05-09 Thread Yezileli Ilomo
Hello everyone, I need opinions on a small library I just made for creating simple to complex access rules for Django REST Framework(DRF). The library works with both class based DRF permissions, Django permissions and Django groups. This library allows you to build complex access rules in a

Re: Is it possible to send HTTP DELETE or PATCH from DRF web page with a web browser ?

2020-04-22 Thread Carl Nobile
> Le 22 avr. 2020 à 15:41 +0200, Olivier Krief , a > écrit : > > Hello, > > I'm discovering DRF. > > Is it possible to send HTTP DELETE or PATCH from DRF web page ? > > > > > > When I type http://foo/api/friends/3/ in my browser, I'm seeing content

Re: Is it possible to send HTTP DELETE or PATCH from DRF web page with a web browser ?

2020-04-22 Thread Linovia
. Regards, Xavier O. Linovia. Le 22 avr. 2020 à 15:41 +0200, Olivier Krief , a écrit : > Hello, > > I'm discovering DRF. > > Is it possible to send HTTP DELETE or PATCH from DRF web page ? > > > > > > When I type http://foo/api/friends/3/ in my browser, I'm seei

Is it possible to send HTTP DELETE or PATCH from DRF web page with a web browser ?

2020-04-22 Thread Olivier Krief
Hello, I'm discovering DRF. Is it possible to send HTTP DELETE or PATCH from DRF web page ? When I type http://foo/api/friends/3/ in my browser, I'm seeing content describing Friend 2 or Friend 3 instance. When I type curl -X DELETE http://foo/api/friends/2/ a DELETE request i

Re: HTTPS resource links in DRF

2020-02-01 Thread Carl Nobile
Usually the schema in your links will reflect the schema used on the site. It looks like your running locally in a development environment, when you go to a production site the schema should change, assuming you use TSL in production. You may be able to force it while developing, but I see no reaso

HTTPS resource links in DRF

2020-02-01 Thread Muzammil Hussain
I would like to get https links for resources instead of the current http links. Example currently I get something like this: http://10.16.18.46:9000/media/tds_data/2020/2/1/6328/cat.12233.jpg what should I change in the get request in views.py def get(self, request, format=None): f

about release notes of drf 3.11

2020-01-14 Thread anvesh Agarwal
can someone tell me when will be the release notes of drf 3.11 will be released. I want to see the changes done in drf 3.11 from 3.10. In github release comparison, i am not able to compare 3.10 with 3.11. Only versions 3.9<= are comparable with 3.11 on github -- You received this mess

Re: DRF tests failing when running on Github actions

2020-01-07 Thread Gonzalo Amadio
You shuld give more details. More code, test. Also very important, share the error you are facing El vie., 27 dic. 2019 a las 14:18, Nick Chouard () escribió: > I'm running into an issue with testing with DRF. My tests run just fine > locally, but once I push my code and run the ac

DRF tests failing when running on Github actions

2019-12-27 Thread Nick Chouard
I'm running into an issue with testing with DRF. My tests run just fine locally, but once I push my code and run the actions, they fail because all of the calls return redirects. Here is a gist for an example of a test I'm running: https://gist.github.co

Re: is_authenticated returns false in DRF, true outside DRF

2019-12-02 Thread Eric Gustavsson
Hi Carl, Turns out I was missing 'rest_framework.authentication.SessionAuthentication' from the DEFAULT_AUTHENTICATION_CLASSES. After adding that it worked within DRF without issues. Such a simple mistake Thanks for the help nonetheless :) Eric Gustavsson, RHCSA He/Him/His Softwar

Re: is_authenticated returns false in DRF, true outside DRF

2019-11-30 Thread Carl Nobile
;ve setup mozilla-django-oidc, but I'm struggling to get > `request.user.is_authenticated` to be true within DRF. I added a router > endpoint to the browseable API: > return Response({"authenticated": request.user.is_authenticated()}) > > As well a

is_authenticated returns false in DRF, true outside DRF

2019-11-28 Thread Eric Gustavsson
Hey, I've setup mozilla-django-oidc, but I'm struggling to get `request.user.is_authenticated` to be true within DRF. I added a router endpoint to the browseable API: return Response({"authenticated": request.user.is_authenticated()}) As well as a response outside DRF:

Re: Django is getting ASYNC, what about DRF ?

2019-11-23 Thread Денис Матвеев
Hi, Carl ! It is very strange you use DRF inside async operations because DRF is sync and, respectively, blocks the loop. Could you please provide some code example ? пт, 22 нояб. 2019 г. в 16:14, Carl Nobile : > I do async all the time with DRF, sometimes I have DB connection issues, > b

Re: Django is getting ASYNC, what about DRF ?

2019-11-22 Thread Carl Nobile
I do async all the time with DRF, sometimes I have DB connection issues, but for the most part it all works fine. On Fri, Nov 22, 2019 at 8:12 AM Xavier Ordoquy wrote: > What about it ? > I don’t think DRF we use anything that is async incompatible outside > Django itself. &g

  1   2   3   >