All Questions
373
questions
0
votes
1
answer
11
views
when i am sending some data using post request in django and test it in postman it shows no error but in browser it is not responding correctly
from django.shortcuts import render
from django.http import HttpResponse
def register(request):
if request.method == 'POST':
name = request.POST['name'] #in this way we are collecting data
...
0
votes
0
answers
30
views
Form running GET request instead of POST in Django app
I'm having an issue in Django where when I click save on a form, it sends a GET request instead of a POST.
I'm not sure why this is happening, and I've searched about handling forms and POST methods, ...
0
votes
0
answers
29
views
NextJS POST requests with fetch or axios are switched to GET in production
I have a project using the following technologies:
NextJS
Django as a RESTful API
Locally, when running the project, everything works fine. The POST requests from the NextJS server-side are running ...
0
votes
0
answers
39
views
Django, Allegro API, error with get data form endpoint
I have problems with getting data after authorization, I can get main categories, but when a want get orders from account its display it:
{'errors': [{'code': 'EMPTY_USER_ID', 'message': 'User name ...
0
votes
1
answer
28
views
Request method IN PY Django
I am new to Django and python and I made a POST request from my HTML page. However, when I tried the request.method === "GET" to retrieve the data it did not work.
HTML
<form id="...
1
vote
0
answers
46
views
Add an http GET/POST entry point to a Django with channels websocket
I'm new in Django and I'm building a site for booking.
I build the front-end in vue 3 and the back-end in django using channels.
I've implemented the websockets but now I'm trying to add a GET or POST ...
1
vote
1
answer
108
views
How to update Django model fields after filtering by id?
I want to write a function that, when executing a "GET" request, will change fields such as: "inaction" and "lastAction" to 2 and the datetime.now(). But when I wrote my ...
1
vote
2
answers
2k
views
Problem with Django class-based LogoutView in Django 5.0
I used Django class-based login and logout views by "django.contrib.auth.urls", login feature works correctly, but when logging out via the link "http://127.0.0.1:8000/accounts/logout&...
-1
votes
2
answers
83
views
HTTP 405 Method Not Allowed Django
I am trying to create an APIView (path 'create-room' in urls.py) where I can either edit a Room model if the session already exists or create a new Room model if the session doesn't exist. In the ...
0
votes
2
answers
690
views
Original exception text was: 'AnonymousUser' object has no attribute 'email'
This is the error i am getting:AttributeError: Got AttributeError when attempting to get a value for field email on serializer UserSerializer.
The serializer field might be named incorrectly and not ...
1
vote
1
answer
27
views
How can I parse a part of the GET request in Django's function-based view
I am passing to Django's function-based view this URL:
<hostname>/display_listing/1
The number 1 in the above URL is an ID field in a database. I would like my function-based view that is ...
1
vote
2
answers
1k
views
Django-Rest - How to create URL & View to extract "GET" query parameters in different formats?
I have an application that is sending a GET request in the form of /myapi/details/?id="myid".
Currently my Django-Rest server is setup to receive requests as follows:
urls.py
urlpatterns = [
...
1
vote
1
answer
54
views
Passing a variable in get()
Using CreateView, I am displaying a form that has a header set in the admin panel. I have no idea how to do it anymore because the variable set in context is not visible in html template. Otherwise, ...
1
vote
1
answer
579
views
How to connect Flutter backend with Django server?
So, I have a Django server running on my computer on local host, port 8000 (http://127.0.0.1:8000) and I'm creating a Flutter application. I want to connect my Flutter app backend with the Django ...
0
votes
1
answer
100
views
Django - passing named parameter to url in template
For some reason I don't understand, when I pass a parameter to my url inside my template, the generated url does not include the parameter keyword "?ts=".
To be clearer, the code below ...