Category "django"

Why don't my CSS static files work in Django when I pass an optional parameter to the view?

I am making an application in Django, where I have a main (index) page displaying a number of objects styled with CSS. The CSS is in a static file. When I do no

Getting error while partial update data in drf

Hi Everyone i am creating api for partially update record, but getting error [patch() missing 1 required positional argument: 'id'], please help me out views.py

Django - Display in inline random info without relation to any model

Imagine there is a model: class OrgUnit(models.Model): name = models.CharField(...) type = models.CharField(...) address = models.TextField(...)

Styles not loading in Django

I have a site that needs some custom styles in Django and I can't get the static file to load. I have a static folder inside my main folder - The one where mana

Pushing a project with passwords in it

I created a django project and want to share it with my team members, however in the settings files it contains some passwords for the database etc. Of course w

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.