Category "django"

404 (Not Found) for CSS files

I am running a django app and I want to import a third-party stylesheet from my node_modules. But my django app is looking in the wrong directory and throws a 4

CSRF validation does not work on Django using HTTPS

I am developing an application which the frontend is an AngularJS API that makes requests to the backend API developed in Django Rest Framework. The frontend

How to use Faker from Factory_boy

Factory_boy uses fake-factory (Faker) to generate random values, I would like to generate some random values in my Django tests using Faker directly. Factory_bo

Error while opening Django admin: "Error at /admin/ Incorrect padding"

I was making a web app using Django. I was using Django 3.0.7 for the sake. Then I upgraded to Django 3.1.1. When I reinstalled Django 3.0.7 I am unable to open

TypeError: __init__() got an unexpected keyword argument 'many'

While trying to return a query-set using generic views, I get an error TypeError: init() got an unexpected keyword argument 'many' I am unable to underst

django makemigrations and migrate on heroku server don't create tables

Python Version 2.7 Django Version 1.9.7 I have created a Django app on heroku. I can't get the heroku server to migrate properly. In the past I have done all

Django/Python unable to find GDAL Library

I have installed GDAL in a virtual environement with the following commands: $ brew install gdal $ pip3 install gdal When trying a python manage.py makemigrati

Django admin title "Select <model_name> to change"

How can I change the title for Django admin specfic model? Automatically it write "Select to change"... I am try each from this options but do nothing: admi

Django admin title "Select <model_name> to change"

How can I change the title for Django admin specfic model? Automatically it write "Select to change"... I am try each from this options but do nothing: admi

Resolving AmbiguousTimeError from Django's make_aware

I have a code as follows: from django.utils.timezone import get_current_timezone, make_aware make_aware(some_datetime, get_current_timezone()) The make_awar

django translation not working for me

i cant force django to translate strings, choosen language from request is correct, but i have no translated strings. maybe here could be problem: when i run s

How can I show the StringRelatedField instead of the Primary Key while still being able to write-to that field using Django Rest Framework?

Models: class CrewMember(models.Model): DEPARTMENT_CHOICES = [ ("deck", "Deck"), ("engineering", "Engineering"), ("interior", "Inte

Django models: dynamic inheritance from classes defined in standalone app

I am using Django 3.2 I have written a standalone app social that has models defined like this: from abc import abstractmethod class ActionableModel: # Th

How can I show the StringRelatedField instead of the Primary Key while still being able to write-to that field using Django Rest Framework?

Models: class CrewMember(models.Model): DEPARTMENT_CHOICES = [ ("deck", "Deck"), ("engineering", "Engineering"), ("interior", "Inte

Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding, when trying to start uwsgi

I am trying to start my uwsgi server in my virtual environment, but after I added plugin python3 option I get this error every time: !!! Python Home is not a di

django errno 104 Connection reset by peer

I am trying to run my django server on an Ubuntu instance on AWS EC2. I am using gunicorn to run the server like this : gunicorn --workers 4 --bind 127.0.0.1:8

Django is not sending e-mails

guys! I have an issue with my Django project. About project: Django version: 3.0.7 Django hosting provider: Digitalocean E-mail hosting provider: Beget.com OS:

Django Nested Inline Formsets to Populate Multilevel Nested Form

I'm trying to solve a problem. I have a model hierarchy like this: class Task(models.Model): name = models.CharField(max_length=255) number_of_steps = m

django update_or_create gets "duplicate key value violates unique constraint "

Maybe I misunderstand the purpose of Django's update_or_create Model method. Here is my Model: from django.db import models import datetime from vc.models imp

Django model doesn't get saved to database inside Celery Task

I've hit a really nasty situation. I have the following setup. I have a django model representing an FSM with a django FSM field I have a celery task that sen