Category "django"

How to custom ModelForm with CSS - Django

I wasn't able to find a way to change the appearance of the created form by using CSS. Here is the simple code I am using: create.html {% block content %} &l

Pytest models not getting imported due Apps aren't loaded yet

nas_apps nas_apps -__init__.py -environments.py -settings.py -urls.py -wsgi.py -pytest.ini usecase1 -co

the css in my django project is not working

Please help me out. I don't get any errors in my css file or in finding it, but still the style i would like is not shown. my css file body { background-color

How to specify a settings module when using the Django database shell command?

I'm trying to run the Django admin's dbshell command, but I'm having trouble specifying the settings module. If I try to run it without defining any environmen

Channels django nginx 502

I ran into a problem once I install and add "channels" to the settings and after that to the asgi file. Server crashes, I get 502 and nginx won't start. How can

ValueError: Field 'id' expected a number but got 'Processing'

I'm going to deploy my django application on DigitalOcean. Everything gone well, except following error, and my question is: where can I find source of this err

django_rest_swagger - 'staticfiles' is not a registered tag library. Must be one of:

Have this error while trying to autogenerate API docs for django rest framework in django 2.2.4, from what I'm seeing in the logs it has something to do wi

django_rest_swagger - 'staticfiles' is not a registered tag library. Must be one of:

Have this error while trying to autogenerate API docs for django rest framework in django 2.2.4, from what I'm seeing in the logs it has something to do wi

Django staticfiles_dirs not working correctly

I'm working with this website http://fotokluczniok.pl/ now. If You press F12 You will see the staticfiles do not work correctly. Here is my seetings.py code:

Django subdomain rewrite using uwsgi on Google Cloud Run

I am moving a Django site to GCP and using Google Cloud Run for the first time. The experience is great. I was also very pleased with the domain mapping feature

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