Category "django"

Allow empty foreign key selection in admin forms

I created a model(AnalysisFieldTemplate) with a foreign key to AnalysisFieldRule. What i want is to have the possibility to leave the field display_analysis_fie

("Django tried these URL patterns... The empty path didn't match any of these.") How to fix "Page not found (404)" error

I am using the visual studio code for the basic Django project and whenever I try to run the server it gives the error Page not found (404) Request Method: GET

Python venv not creating virtual environment

I'm trying to create a virtual environment for my current Django project using python3 -m venv env however the command doesn't create any directory with bin/

Any way to update a ManyToMany field via a queryset?

Suppose I have an object: survey = Survey.objects.all().first() and I want to create a relationship between it and a group of objects: respondents = Respond

Timeout when reading response headers from daemon process even after setting WSGIApplication group to Global

I am hosting a Django based webpage locally using Apache. However, I am getting the following error : Timeout when reading response headers from daemon process

DRF/Multi-tenant - How to specify tenant host (domain) in unit tests?

Environment - Django, Rest Framework, Multi-tenant. In my unit tests, I'm trying to hit an endpoint in a tenant schema (not in Public). It is failing because

Django PageNumberPagination customize error if page number out of range

I'm currently trying to create an API that return list of objects with page and limit per page input from url parameter using django-rest-framework which i alre

Is it possible to list files in a dir with Azure storages

I'm using Django and django-storages[azure] as backend. But i can't to find out to list dir the files instead I have to use snippets like this: block_blob_servi

Where can I write server code for stripe payment in Django project?

I am working on React JS to implement stripe payment gateway. I am using Django as a backend Server. In stripe documentation. https://stripe.com/docs/checkout/i

Is it possible to list files in a dir with Azure storages

I'm using Django and django-storages[azure] as backend. But i can't to find out to list dir the files instead I have to use snippets like this: block_blob_servi

Reverse for 'Profile' with no arguments not found

I'm trying to add user Profile in my django project. i was trying to access user post into the user Profile but its throws an error like this: Reverse for 'Pro

Django AuthenticationForm is not validating and not storing information in database

So basically I'm trying to do a simple login system using Django AuthenticationForm and LoginView. The form takes the user input and when the login button is pr

count item for monthly wise python DJANGO [duplicate]

I try to make a bar chart and I want value month wise for last 6 months my models.py class Btdetail(models.Model): id = models.IntegerFiel

Manifest: Line: 1, column: 1, Syntax error on Chrome browser

I have a react app that built through npm run build. GET and POST request from the front-end to back-end gives status 200 but I am getting a weird error that ma

Django when a data is entered, write the data in the other model depending on the condition

Hello There is a data(text) in data b on app1. I want to write the data here on d on app2. how can I do that? app.model; class Post(models.Model): a=models.

How to restrict a Django model to a single one-to-one relation?

I am currently building a Django app that requires two different user types and I know that storing authentication information across multiple models/tables is

Django Heroku : python: can't open file 'manage.py': [Errno 2] No such file or directory

I am deploying a Django website on Heroku. My project is called mysite-project wich contains at its root manage.py and Procfile I can visit the heroku website

Django override the error message that Django shows for UniqueConstraint error?

I want to customize Meta class constraints default message. Here is my model that I have been working out. class BusRoute(BaseModel): route = models.Foreign

Django automatic file-upload: [WinError 123] The filename, directory name, or volume label syntax is incorrect C:\\path\to\folder\C:

I'm pretty new to Django and I'm working on a project in which I have to automate PDF file uploads from a given folder to a model in Django and these files will

Syntax Error when deploying django on apache2

I am trying to host a django application on a server using apache2 and mod_wsgi. The project itself is located at the path /usr/share/django-projects/mysite The