Category "django"

How to use bootstrap with xhtml2pdf?

I need to render PDF files dynamically in a Django web app. I understand there are 2 options : Render an html template file then convert it to a PDF file. I use

How to add header / footer on export on django import-export?

I'm using the django-import-export plugin in admin, and i would like to add a header/footer(images) when exporting data. Is there a way to get a handle on the

Unit Testing Django Model Save Function

I'm creating tests to check that a custom calibration model save function updates an asset record (foreign key) if it is the latest calibration record for the a

how to get a username to show on serializer django rest framework

how would i get the user name to show in the serializer along wit the data. I tried doing serializer char field but did not work. Model class Pet(models.Model

Separating development/staging/production media buckets on S3 in Django

We are currently using AWS S3 buckets as a storage for media files in a Django 1.11 project (using S3BotoStorage from django-storages library). The relevant co

Django admin site login error -"This site can’t be reached127.0.0.1 refused to connect."

I am developing a web app using Django 3.0.1 and python 3.7 for my college's final year project. Whenever I try to login to the admin page in the local host in

OperationalError at / no such table: blog_post_categories

I'm trying to add category section to my blog pet-project; I feel that I almost there, but on the last part of work it showed me an error: "OperationalError at

VirtualEnv ImportError: No module named MySQLdb

I am receiving the error: ImportError: No module named MySQLdb whenever I try to run my local dev server and it is driving me crazy. I have tried everything I c

How to send JSON format data in postman to django models that have a foreign key to another model?

I have tried to send a POST request to django views.py file using postman. It was working when I sent a POST and GET request to django models that haven't Forei

file extentions in Django

I have created a file upload website where I want to allow users to upload files in pdf, ppt, doc, txt, and zip format. I am using the HTML form to upload files

saving data into two tables at the same time with a single form

I would like to save data in two tables at the same time using a single form in Django. Any help would be appreciated. class Category(models.Model): name =

I can't display data from database on web page using Python and Django

I have a big problem. I want to display data from my database( SQLite) on a webpage( the data should be present in an HTML table). I have checked my request wit

Inherinting Django SetUpTestData method called for each child

Inheriting a mother class make its classmethod setUpTestData called for each child class. This is what I excepted but not what I want. Here is a minimalist exam

Inherinting Django SetUpTestData method called for each child

Inheriting a mother class make its classmethod setUpTestData called for each child class. This is what I excepted but not what I want. Here is a minimalist exam

Route53 DNS issue with Django Elastic Beanstalk app

Not sure what I am doing wrong here. My zone is public and I have simple routing for the A records pointing to the EB alias. I even tried a CNAME to no avail. B

Route53 DNS issue with Django Elastic Beanstalk app

Not sure what I am doing wrong here. My zone is public and I have simple routing for the A records pointing to the EB alias. I even tried a CNAME to no avail. B

How to filter choices in Django2's autocomplete_fields?

In Django 2.0, autocomplete_fields was added, which is great. Without autocomplete_fields, I can change the queryset of a ForeignKeyField using formfield_for_f

django.db.utils.IntegrityError: NOT NULL constraint failed after reseting migrations

I need to save an object that contains a file and some other data. Although the file is stored on the /media folder, the entity is not saved in the database sin

Import "rest_framework" could not be resolved. But I have installed djangorestframework, I don't know what is going wrong

Here's my settings.py: INSTALLED_APPS = [ 'rest_framework', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'd

Django Model Field for html5 Range Slider

I'm looking for a Django Model Field to render a HTML5 range slider like: <input type="range" min="1" max="100" value="50"> This question comes close to