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, with a special focus on less code, no-redundancy and being more explicit than implicit.

292,664 questions
0votes
0answers
4views

Django ViewSet serializer_class is being ignored

I have two models: ModelA and ModelB, with their corresponding serializers ModelASerializer and ModelBSerializer In a specific viewset, called MyViewSet i have the follwing structure: class ...
0votes
0answers
13views

URLS.PY and VIEWS.PY slug removal

I tried to word this specifically but the dilemma is as follows: The image will not load as the slug is being added on the detail page, but loads fine in the index.html. post.image is the code you ...
  • 1,407
1vote
0answers
20views

Django migrate column is not the same data type as referencing column

I have the below model which is an existing DB model and through Django's inspectdb management command the below model is created. class ExistingLegacyModel(models.Model): period = models....
0votes
0answers
11views

Pagination from django_tables2 not rendering

I am relatively new in Django and could not find any answer here on why my table from django_tables2 is not rendering nice pagination buttons. Here follows the codes: models.py class IDOC(models.Model)...
0votes
0answers
14views

Simple JWT Usage

I have my Django backend authentication working (tested using curl and postman) but something eludes me. When sending test requests, the docs show username and password data being sent: curl \ -X ...
1vote
1answer
19views

Can two models reference each other by ForeignKey?

I have two models class Customer(models.Model): name = models.CharField(max_length=255, unique=True) default_contact = models.ForeignKey("CustomerContact", verbose_name="...&...
0votes
0answers
18views

Search and page functionality disappearing for any additional data tables on webpage

Strange issue, but for some reason whenever I add any additional data tables to my site on the same page, the additional tables populate just fine but are missing the search and page functionality. I ...
0votes
0answers
17views

Model object not creating from inside except block or right before raising exception

Something very strange is happening in my Django app. When I try to run the following code Model.objects.create(**obj) before raising an exception OR run the same code inside an except block, the ...
0votes
0answers
24views

How Do I Detect And Properly Display Events On Calendar That Overlaps Months in Python?

I used a tutorial I found online to create an event calendar in Python. I've tried to improve it to schedule events that may have a start and end time range that overlap months. Meaning it may start ...
-1votes
1answer
20views

How to print out request.body data in django?

Just working through the Django tutorials and playing around with stuff. Was going through the HttpResponse and HttpRequest docs and I'm just trying to print out data to see how things work. However, ...
0votes
0answers
16views

Sending mail now for testing after disabling the less secure app setting in gmail

I was trying to send mail to test one of my Django Rest Framework projects. I know I have to turn on the "Less Secure Apps Permission" for Gmail to receive the mail from the localhost. But ...
0votes
0answers
12views

Django multiple image upload CRUD funcionality with two forms

I want to let the user upload multiple images per product like in an ecommerce application. Therefore I created two models. In forms.py I added the ImageField to the ProductForm. My create_product ...
0votes
0answers
11views

Django and OpenApi compliance

We are using Django for our api development and we need to be OpenAPI 3.0 compliant. In this article it is written that "Django Automates generation of OpenAPI 3". Do we need to do anything ...
0votes
0answers
10views

Django Project, Versioning Management

Is there a way to run single Django app separately? First, why ? As we know, when you make a user upgrade or downgrade your system from UI inside system, if there a crash during replace changed files, ...
0votes
0answers
20views

How can I run 4 tests at once during parallel tests on 4 different processes with Django tests?

I'm trying to test if my tests are properly isolated, and I'm scratching my head what is the easiest way to do this. Basically what I need is some barrier implementation. 4 processes stops, picks up ...

153050per page