I have model with a field validator from django.db import models from django.core.validators import MinValueValidator, MaxValueValidator class MyModel(model.
Hy please am new to Django,I have a childmodel(relationship) referencing a parent model(Profile) through a foreign key. I want to get the relationship status of
I'm trying to design a database that would save matches and players in a 3v3 game. So far my models look like this : class Player(models.Model): user = mode
So the code is very simple: views.py @csrf_protect def index(request): global userPersonalInformation if request.method == "POST": username =
I know this is a simple question, sorry. I just want to return a simple string, no templates. I have my view: def myview(request): return "return this st
I am trying to open a file that would be uploaded through the django FileField attribute. I also want to read the contents of the file and output it. But when I
I'm writing some API functionality for my project using Python 3.4 and Django 1.6. All functionality works fine, but I want execute one function for all that k
I am trying to use Pyinstaller with django rest, it generates the .exe well but there is an error at the moment of executing the .exe, the error is this Module
The model is class WeeklyStrMst(BaseModel): StoreId = models.AutoField(primary_key=True) TDLinx_No = models.IntegerField(blank=True, null=True, default=
I'm using Django Rest Framework and Token Authentication. Everything works great so far. http://www.django-rest-framework.org/api-guide/authentication#tokenaut
I had mistakenly deleted my migration folders for all my apps in my project. I therefore had to redo makemigrations and migrate for each of those apps. When th
I have the following consumer: class ChatConsumer(AsyncJsonWebsocketConsumer): pusher = None async def connect(self): print(self.scope)
I'm trying to deploy Django project to Elastic Beanstalk. I'm following their guide: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python
Apologies since this might not be the best way to word the question nor is this a coding question per say. I get the general process of creating a staff user wi
I have a Django website in production and a while back I successfully hosted my static files using Whitenoise so I could use them in production. Now a few month
I want to pass some arguments to DRF Serializer class from Viewset, so for I have tried this: class OneZeroSerializer(rest_serializer.ModelSerializer): de
I have a class based view as: class ClassBasedView(GenericAPIView): @swagger_auto_schema(responses={201: 'Created'}) @authorize(myCustomPermission)
How can you solve a 502 error? I believe whats causing the 502 error is a nested loop that contains heavy calculations. It would take up to 2 minutes for it t
In my admin.py of my admin dashboard app I added this following code: class MyAdminSite(admin.AdminSite): def index(self, request, extra_context=None):
I am using the UserCreationForm for user registration in my Django web app. When the user fills in the detail (username, password, confirm_password) and submits