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.

Filter by
Sorted by
Tagged with
0votes
0answers
5views

Catch errors in password validation in Django

i have a problem. I'm trying to catch errors from password validation in Django, but I don't know how to do it. Password validation is called in forms.py, and form.isValid() is called in views.py I'd ...
user avatar
0votes
0answers
10views

How get all products into subcategories when filter through the parent category in django rest

When I filter by subcategories, only those products that are directly related to this category are displayed, and when I filter, the parent category returns an empty one, but in fact there is a ...
user avatar
0votes
0answers
8views

Why is the Django template file not updating value from the context?

(I am a beginner in Django) I am following along a tutorial in Django where we can dynamically pass some variable to a template file from associated function in views.py When I am running the code for ...
user avatar
-1votes
0answers
8views

How to retrieve data from html form and pass it into my database as an sql query in django

i am trying to make use of django to retrieve data from my sign up form and pass it into my database in pgadmin 4 as a query. I got error and doesnt know how to go about doing it. This is my code ...
user avatar
  • 1
0votes
0answers
9views

Reverse for 'temp1' with arguments '('',)' not found. 1 pattern(s) tried: ['userinput/(?P<id>[0-9]+)/\\Z']

I just want to retrieve data dynamically. urls.py I think there is something error in views.py or urls.py from django.urls import path from . import views urlpatterns = [ path("", ...
user avatar
0votes
0answers
12views

Does select_for_update() work if AUTOCOMMIT is set to False in Django Rest-Framework

I am writing a celery task which would get invoked if a row is being inserted into a table. This task is being executed in a transaction and the task also locks the certain rows of several tables. Now ...
user avatar
0votes
0answers
13views

Prevent overwriting existing objects when applying fixture

I have a model representing my application's settings. The settings I define in a fixture. Now, everytime I redeploy the app I also apply the fixture with ./manage.py loaddata settings. The problem I ...
user avatar
  • 115
-2votes
0answers
28views

covert txt file into json python django

i have this file of weather data i'm trying to send it through API: view.py: @api_view(['get']) def weatherDataList(request,region,parameter): try: url = 'https://www.metoffice.gov.uk/pub/...
user avatar
  • 284
0votes
0answers
23views

Django putting logic in view vs serializer vs model best approach

What is the best approach about putting logic and what is best in my current scenario where I have a view which uses a query + subquery to fetch and return data. @action(detail=False, methods=["...
user avatar
0votes
0answers
13views

Filtering duplicate model elements in django templates

It was necessary to weed out duplicate model elements on django. Removing identical elements is not suitable for me, but only filtering is suitable. My model includes albums and photos that are in ...
0votes
0answers
13views

How to override .py files in third party INSTALLED_APPS, django

I'm using https://github.com/jazzband/django-two-factor-auth I want to edit the file core.py in folder https://github.com/jazzband/django-two-factor-auth/tree/master/two_factor/views Where can I put ...
user avatar
0votes
0answers
20views

i need to send in response array of chats in my my chat view from chat model

Following are my models: class MediaUploads(models.Model): file = models.FileField(upload_to='embla/uploads/') caption = models.CharField(max_length=256, null=True, blank=True) owner = ...
user avatar
1vote
1answer
19views

How to store nav menu urls in database?

I'm working on my first django app, and i have side nav menu like in twitter. To prevent the dozens of lines in my template like this <ul class="nav d-flex flex-column"> <li ...
user avatar
  • 17
1vote
0answers
15views

http API requests are executed for more than 20 seconds

I have an application on django that can search for YouTube videos via the YouTube Data API v3 and translate their description using the Yandex Translate API. Often everything works fine, both ...
user avatar
0votes
0answers
20views

How to upload random pictures from a folder to database

i want to upload random pictures from a static named folder to my database. These are my files. Please suggest a way. I am stuck here forever. views.py class VerifyOTPView(APIView): ...
user avatar

15 30 50 per page
1
2 3 4 5
19163