Category "django"

Install Django on Gandi instance

I am trying to install an Django app on Gandi. For now, what I have is un file name wsgi.py: import sys import os import os.path sys.path.insert(0, os.path.abs

How to get the json key and value in Django's Templating language?

I'm trying to build a website for tv series using Django framework, I put in the models.py all kinds of details about that show and a JSONField to define the nu

Fixing django inspectdb after importing postgresql sample database

Context: I'm playing around with setting up a DRF project using the postgresql sample database located here: Postresql Sample DB Problem: The sample database is

How to use multiple databases in Django with an empty 'default'?

I'm trying to make a multiple database project in Django. But I'm having problems to properly migrate my models to the appropriate database. I'm using the 'Writ

makemigrations - No changes detected -Django

I am new to Django, and im trying to create a company profile for user to fill up. when i make migrations, i got the following error which is no changes detect.

form pot URL not defined in URLconf

I have a form that is on the URL: http://127.0.0.1:8000/disciplineReport/1/ where 1 is the primary key of the object I'm editing. detail.html: <form method="

How can I solve the issue: psql cannot connect to the server in Ubuntu?

In hosting my Django web application on VPS using PostgreSQl. However, the configuration seems to be fine but whenever I want to access the Postgres Shell, I ma

Django- link answer choice to question and survey

I am trying to create a number of surveys in Django and put them in a survey index page. I have run into an issue: Up until now, all of my surveys had questions

how to pass null value to just one specific key of the one object using same DRF serializer

I'm just passing the same object 2 times in the same serializer but I want to pass key: "retweet": null in one object and in another object I want to pass some

wkhtmltopdf-django dynamic template to render

Is there any way to generate a PDF dynamically, with content being fetched from the database? My goal is to allow my users to generate their own PDF design from

How to resolve Key Error Exception when accessing dictionary key inside an if statement

I'm currently developing EV calculator using python and django. I get a key error exception when trying to access a dictionary key in an if statement inside a f

Django - query Grand Children with Autofield as Primay Key

I have this model: class AnlieferungKopf(models.Model): kopfNr = models.AutoField(primary_key=True) firma = models.ForeignKey( Firma,

How to add collation in indexes for mongodb?

I work with Mongoengine in Django, got task to sort by first_name, last_name fields ignoring case and leading whitespaces that is why add collation in queryset:

What Python packages am I missing?

I'm trying to get my local Windows 10 PC up and running with my Django application. I'm a novice at Python and Django. My app was written by another developer w

User draw rectangle on leaflet map and post the coordinates on django form

I would like to create a djagno app, which will enable users to draw a rectangle on a leafet map and post the coordinates in order to create a vector. Firtsly I

Django Authentication method is not working

I am trying to use the default Django from django.contrib.auth authenticate() method to authenticate if the user exists. I am doing this right after the user re

URL and page refresh issue for Multilingual site on Django

plz help me to solve one issue. I have a Multilingual site on Django with standart internationalization framework. Settings.py MIDDLEWARE = [ ... 'djang

How to change the database local to be in a cloud (Django)

I wrote a project in django framework and I use the local DataBase SQLite, and I now want to upload it to the cloud so other people who work with me can access

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>