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
312,726
questions
1
vote
0
answers
17
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
12
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
36
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
11
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
23
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
19
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
23
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 ...