Questions tagged as 'django-rest-framework'

1
answer

DjandoRestFramework standardize endpoints for methods with different permissions

I'm using Django 1.10 with the DRF lib. I created an endpoint / api / contact / and in this endpoint I apply 2 methods (GET and POST), GET can only be viewed with permission, and POST can be requested without permission. The problem is in the...
asked by 20.01.2017 / 15:23
1
answer

Security Token Authentication Django Rest Framework

Good people I'm using DRF (I'm newbie rs), to put together a small API. The problem comes in authentication ... thinking of expanding my API to use in a mobile app in the future, I've been wanting to use token authentication. It's all working fi...
asked by 23.09.2016 / 16:01
0
answers

Problem making a GET on my site when it is entered via www (react + django)

I have a django application that uses React on some of its pages (not two separate servers). In my pages in React, I make HTTP requests to django by api using Django Rest Framework. This application is already in the air, and in it I noticed...
asked by 10.10.2018 / 21:48
1
answer

How to display my index.html template in django restframework?

I have a problem with a test that I have to submit to a selective process that I am performing. I've tried every possible and imaginable way but I could not. When trying to call an index.html file that is inside a templates / api folder so that...
asked by 08.05.2018 / 11:37
0
answers

How to receive the username of the logged in user when sending a message through REST?

The intention of this project is to make a Chat Room. I have 2 tables, Django's predefined User table and Message table, where messages sent by users are stored. I want a user to send a message, via a form sent to the table by the sendMessage...
asked by 19.02.2018 / 03:06
1
answer

How to filter an APIView to show user-related messages?

I want to create a view using APIView, which shows all the messages sent by a user specified in the url. models.py: class Message(models.Model): body = models.CharField(max_length=500) normaluser = models.ForeignKey(User, on_delete=models.C...
asked by 29.01.2018 / 20:18
0
answers

Convert HTML to PDF and insert Image with Django

The image does not appear in PDF, I use xhtml2pdf. reports / sol_acesso.html <img src="{% static 'img/small_logo.png' %}" alt="Blue Tech" style="max-width:200px; margin-top:10px"> view.py ' def get(self, request, pk, model):...
asked by 11.01.2018 / 17:43
0
answers

Django Rest Framework retrieves empty values instead of null when using Oracle DB

I'm using Django Rest Framework, so when I insert a field with null value [POST Model], it retrieves it with an empty value [Get Object Detail]. Why does it happen?     
asked by 21.11.2017 / 20:45
1
answer

Session not identified in some logins in django

I'm doing a maintenance on a Django app version 1.5 with DRF 2.3. This app has non-standard Django user authentication, and that works well. See a summary below: accounts / views.py class Autentica(TemplateView): template_name = 'checkuser....
asked by 30.08.2017 / 18:53
1
answer

POST Error with Rest API - Windows Forms

I'm trying to make a POST this endpoint link (it's a simple API I've done with Django Rest) I'm using Windows Forms C # Follow the call: using (var client = new HttpClient()) { client.BaseAddress...
asked by 03.08.2016 / 01:02