Category "django"

Django form doesn't send POST request and site freezes

I'm trying to set up a basic forum site for my coworkers to use. The problem is that when I attempt to log in to the site, no POST request is sent (shown by the

Django post-office setup

Perhaps it is just because I've never set up an e-mail system on Django before, or maybe I'm missing it... but does anyone have any insight on how to properly c

How to write sql COALESCE in Django

I'm new to Django. How to write COALESCE sql queryset in to django orm. query = 'SELECT COALESCE(max(CAST(order_no as UNSIGNED)), 0) as o,id from nanossc_Sales

Django How to Upload an Image to Form

This is my code associated with the form: # models class Date(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, null=True) place

Can't connect to Postgres from Django using a connection service file (on Windows)

[NOTE: This is using Django 4.0.2, Python 3.8.2, and Postgres 14.2.] I have successfully set up Django and Postgres, and I can get them to work together when I

Why does django wizard form not submit when one form is passed through get_form function?

I'm creating an app containing 3 multiple choice questions. The second multiple choice options are dependent on the response to the first question. To accomplis

Django - Cancel one delivery but when cancelling one it cancels all the deliveries

I'm trying to cancel one "posted" delivery when the user clicks on the button "cancel", but it cancels all the posted deliveries below is the views.py . views d

Get the selected radio button in django template

In my template I have for loop. As you can see the id for each radiobutton is represented by {{stud.id}} . {{stud.nameAndSurname}} shows the name and the surnam

TypeError: Object of type Cart is not JSON serializable

I just started using session in Django framework. I have create an object cart from Cart model. And when i wan to set cart inside request.session with session['

Serializing reverse relationship of a ForeignKey with a DRF ModelSerializer

I'm trying to generate a data structure following this sample: [ { "name": "groupname", "key": "grouping1", "base_templates": [ { "i

Setting up gunicorn.service [Service] for Django app

Following the documentation and online tutorials on setting up my gunicorn.service results in ModuleNotFoundError: No module named 'my-app' when I run sudo syst

button function doesn't work without any error - django

So i want to make models form to upload file mp3. I was copy the code from website, but suddenly it's not work. there's no error message in terminal or console

Why my Django admin is not loading with css?

I have developed a web app in Django and deployed it then I found out that admin page is not loading with CSS. I was gettting the admin page with css in local s

Get NGINX ip address in docker in Django settings.py for Django-debug-toolbar

I have a dockerized DRF project with installed NGINX in it. All works fine except one thing: Django debug toolbar requires INTERNAL_IPS parameter to be specifie

PermissionError: [Errno 13] Permission denied: '/manage.py'

I am trying to run the following command in docker-composer, to start project with django-admin: docker-compose run app sh -c "django-admin startproject app ."

Django ckeditor is removing space around <a> tags

I'm using django-ckeditor with this config: 'enterMode': 2, 'forceEnterMode': 'true', 'basicEntities': 'false', 'fillE

Django deleting querysets with paging, not catching all parts of the set

I have a bit of a strange problem that I'm not quite able to explain. I have a django project with some old, stale objects lying around. For example, lets say

How to create short uuid with Django

I have a model and UUID as primary key field. UUID id is way too long. I'd like to have it short similar to YouTube. class Video(models.Model): id = models

Django EmailMessgae() Error: MIMEPart.__init__()

This is my views file: I have made a token file to generate a link and info file for details like EMAIL_HOST_USER and etc. current_site = get_current_s

"digitalocean" droplet password changing broke the website (502 Bad Gateway nginx/1.10.0 (Ubuntu))

I have changed the password of the digitalocean droplet then after that the website is not working at all and the api's for the mobile application is not workin