Category "django"

HTML name/value button attribute not being sent via POST request to server

I am currently using HTMX and Django to process button clicks within a table that adds the selected item to a list. I am trying to use the name/value HTML attri

Django processing form input name

I have changed the input's name attribute to some custom name, but the view calls form_invalid method. Why my Form isn't saving (validating)? html: <tr>

It shows, Field 'id' expected a number but got ''

When I submit then shows this error. views.py: class userINFOupdate(View): def get(self,request): userid = request.GET.get("user_up_id") u

Can't set default image django

I was create a profile for user. I done set up all the Media and Static. But when I set default and upload_to in image field, it error not found image. I had tr

Queryset filter to filter response that exactly contains the value as substring in django views

I have created filters that filter API responses, if the response contains at least one letter in the value as substring, I need to create a filter to filter re

Improperly configured error says I'll have to define env variable DJANGO_SETTINGS_Module .Please help me solving this problem [closed]

So I m just a newbie trying to learn django .. i was just trying to copy what Harry did(a youtuber who teaches code) but I got stuck right aft

send template data from signal in django

As soon as the django user_logged_in signal works, I want to send data to my template at that moment.I need to check if my signal is working. from django.contri

Representing Django M2M data export in a CSV

The problem I am trying to solve is to export all the entries of a Django model as CSV. The field names are supposed to be headers, with each row having an appr

What is if 'admin' in request.path

I followed YouTube Django E-commerce video, I did exactly the same as the tutorial. But I found some difficulty in certain code. CONTEXT_PROCESSORS.PY from .mod

How to display extra context and form fields at the same time on django template using class based view?

I am trying to display some extra context on the page, but when I adding get_context_data method it is displayed context but not a forms fields. This is because

Difficulty converting html page with CSS and images to PDF in Django

I am trying to convert an HTML page which uses quite the bootstrap and styling. I tried everything from reportlab to weasyprint to xhtml2pdf and nothing works!

Move HTML variable through views to python script in Django

While working in Django I am trying to take a variable from HTML input, pass it to views.py for some decision making, then pass it from views.py to a separate p

The transaction has been cancelled, but our business server can still receive the webhook with successful payment

This is one of the customers who failed to pay and cancelled the Recurring payment However, my business server receives a Payment sale completed Webhook notific

How do i use Data from other model inside forms that is made with other model in django?

right now my template looks like this I wish to use those cards as the choices in the form that is on the right side. i am a newbie so i cant figure out how. is

Django static loaded but not used

Nginx web server serves static. Browser downloads static files but they don’t work. Why would that be? Loaded static files docker-compose volumes: dja

Django celery and heroku

I have configured celery to be deployed in heroku, all Is working well, in fact in my logs at heroku celery is ready to handle the taks. Unfortunately celery do

How to send scheduled email with Crontab in Django

I like to send scheduled emails in Django with Crontab. I made a very simple app to test how can I send an email in every minutes (just for testing purposes). I

How to add vector images support for ImageChooserBlock in Wagtail CMS?

I want to be able to upload .svg files in ImageChooserBlock. By default, .svg format fails validation when uploading via Wagtail's admin panel. (Vector graphics

How to use custom labels from Django models.Choices field together with enum.auto?

Before Django v3.0 I used to use enum.Enum together with enum.auto (see reference) for my choices fields. The reason was mostly so I could use my enumeration cl

Get_queryset() missing 1 required positional argument: 'request' when i'm trying to filter objects by logged in user

I'm trying to list all facilties owned by a user on a "facility list page" using the django rest framework and react. I tried the following to make this happen