Questions tagged [django]
Django is an open-source server-side web application framework written in Python. It is designed to reduce the effort required to create complex data-driven websites and web applications, focusing on less code, no redundancy and being more explicit than implicit.
django
29
questions
0
votes
0
answers
5
views
Error while trying to connect Django With ReactNative
I am building a React Native app with Django as the backend. I have set up the login screen in React Native and configured JWT authentication with rest_framework_simplejwt in Django. However, I ...
0
votes
0
answers
2
views
Heroku DB Connection Limit hit when using Python ThreadPoolExecutor
I have a Django app hosted on Heroku. Some user requests to this app require making long-running queries to external resources. In order to get around the Heroku 30 request timeout, I created a system ...
0
votes
0
answers
14
views
I can't open server in 0.0.0.0 instead it is working in 127.0.0.1 in while using Docker , Django and Postgres [duplicate]
I am a newbie to this.
settings.py file is:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'PASSWORD':...
1
vote
0
answers
20
views
Custom email validation in django form
In my django Account app I have a model for Account
class Account(AbstractBaseUser):
wallet_value = models.DecimalField(max_digits=10, decimal_places=2, default=0.00)
first_name = models....
0
votes
0
answers
17
views
I get an error while running django project [closed]
Manage.py file looks like this:
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
""&...
0
votes
0
answers
14
views
Django: Error sending email: (530, b'5.7.0 Authentication Required
I am working on a Django project and get the problem with sending email.
This is my code in views.py
class ForgotPasswordView(APIView):
def get(self, request):
return render(request, '...
0
votes
1
answer
29
views
How do I send 401 response with custom login_required decorator after Django session expires?
I have a custom login_required decorator that looks like this:
def login_required(function):
"""
Ensure that user is logged in
"""
def wrap(request, *...
0
votes
1
answer
37
views
KeyError at /verify/ 'order_id'
I have a problem on my store site, when I want to confirm my order, when I click on confirmation on the payment page, it gives this error instead.
the error
Internal Server Error: /verify/
Traceback (...
0
votes
0
answers
14
views
django OAuth Toolkit not getting redirect URI
I am using Django OAuth toolkit and using the following code for OAuth implementation
import requests
from django.http import JsonResponse
from django.shortcuts import redirect, render
from django....
0
votes
0
answers
12
views
How to Display Total Object Count in Wagtail Snippet ViewSet?
I am currently developing a Wagtail project where I use the ModelAdmin to create custom admin interfaces for my models. When using ModelAdmin, the total object count of a model is displayed below the ...
0
votes
1
answer
25
views
Django where to store model-level variables
So I have my model:
from django.db import models
x_default_coordinate = 0
y_default_coordinate = 0
class Model(models.Model):
location1 = gis_models.PointField(
srid=4326, default=Point(...
0
votes
1
answer
27
views
Sum an aggerated value in Django
I'm trying to achieve the following SQL query in Django:
(The table contains the purchases per each day per each location. I want to get the biggest amount of each location, then group them by state ...
-2
votes
0
answers
42
views
My partner and I are running the same code, but mine is the only one not working on my local server [closed]
We are working with Django to perform an asynchronous export task that will populate a CSV with information and then download the CSV automatically to the user's Downloads once a user hits the button '...
0
votes
0
answers
20
views
How to implement Django WebSockets?
I'm trying to create a simple Django app, using websockets for sending data.
According to the documentation:
I've added 'channels' in settings.py's INSTALLED APPS:
INSTALLED_APPS = [
"...
0
votes
0
answers
25
views
Django debug toolbar is not displayed
I just installed debug toolbar for my django project like allways.
but I don't know why doesn't the debug toolbar display?!
and I have to add that I'm using docker and it's my first time that use ...
1
vote
0
answers
30
views
Field is filled but still get ValidationError this field is required in [duplicate]
I want to create User using User.objects.create_user and I am using some fields of a form Utilisateurs to do that. The image field and username field from this form are also used to populate a model ...
-2
votes
0
answers
27
views
I'm unable to run my django application, but nothing happens [closed]
I have a django project and I'm trying to run it with '''python manage.py runserver ''' but nothing really happens. I was working on it just 5 mins before this happens. Now, I'm unable to run anything,...
0
votes
1
answer
24
views
how to show user in TokenSerializer dj-rest-auth
I'm trying to return UserSerializer after successful login through dj-rest-auth.
I followed the steps that were told in
After login the `rest-auth`, how to return more information?
which has a similar ...
-1
votes
0
answers
9
views
ReactJS useParams for Django equivalent?
Django Example
# urls.py
url = [
path('password_reset/<uidb64>/<token>/', views.password_reset_confirm, name='password_reset_confirm'),
]
# views.py
def password_reset_confirm(request, ...
2
votes
0
answers
25
views
Custom Django Transform with case statement for casting a string to either int or null
I'm trying to create a custom django lookup as_int so that you can easily compare and order the contents of text fields when they contain only a number, and treat them as NULL when they have the wrong ...
0
votes
0
answers
13
views
Django errorlist in form Select Valid Choice
The situation is as follows: I am building a form where I fetch data for some fields from an API. I have tried debugging in every possible way, but I cannot understand why the data is not being ...
0
votes
0
answers
33
views
How to debug HTTP 400 Bad Request errors in django?
I have an app with React frontend and Django backend. I'm trying to make a POST request from my react client but I get "Bad Request" error. I checked my request url and it matches with my ...
0
votes
0
answers
28
views
Validation in DR(Django)
I'm trying create customs validations to my serialiazer but Django just ignore them and return me DRF default errors.
{'message': 'Erro ao criar camião', 'data': {'plate': [ErrorDetail(string='This ...
0
votes
0
answers
14
views
Django app deployed to under the url subdirectoly
In my server,django and nginx is deployed on ECS fargate and connected to loadbalancer, but URL is transferd by Akamai
https://www.example.com/company/playground/* -> https://amazonloadbalancer/*
...
0
votes
1
answer
30
views
Django Inline Formset data not saving
I have created an inline formset which works exactly as I planned on the frontend side-
However I can't seem to access any of the data- it seems like the form isn't saving the data?
Here in the views....
-1
votes
1
answer
36
views
Is the batch processing speed of Python slower than that of Java?
I am working on migrating a function implemented in Java Spring Boot to Python Django.
I encountered an issue while migrating a function that retrieves a list of keywords through a select query and ...
0
votes
0
answers
28
views
Payment Gateway Integration with Django
I'm integrating payment gateway APIs in my application (Django). I have written a class PaymentGateway that provides all the methods for all payment related utility. The __init__ initialises the ...
-1
votes
0
answers
24
views
Django Auto Assigning Author to the user creating the post [closed]
I am having an issue with my Author being auto-assigned, it was previously working but has stopped working since I added some inline formsets-
Here is my model:
class Recipe(models.Model):
title = ...
0
votes
0
answers
25
views
binascii.Error: Invalid base64-encoded string: number of data characters (41) cannot be 1 more than a multiple of 4
I'm trying to use py-vapid, pywebpush, and django-push-notifications to send notifications via Webpush. When I try to send a test notification from the django admin website, I get this traceback log ...