Category "django"

adding active class in django according to anchor in url

I want to create one page site with navbar links which redirect to some part of the page. How add class "active" to a link if url is based on anchor (#)? <

Visual Studio Code don't recognize HTML file

I am learning to build a Website on Python Django, but when I create a HTML file in VS code, this Editor don't recognize this file. You can see in following pic

Understanding working of multiple gunicorn process

I have no knowledge of what I'm trying to understand, surfing the internet brought me here and now I need this in my code. I use django-rest-framework, gunicorn

ValueError: set_wakeup_fd only works in main thread on Windows on Python 3.8 with Django 3.0.2 or Flask 2.0.0

When I run my Django Web application with Apache2.4.41 + Python 3.8.1 + Django 3.0.2 + MySQL 8.0.19 on Windows 10 Professional version it throws Value Error at

Ignoring Django Migrations in pyproject.toml file for Black formatter

I just got Black and Pre-Commit set up for my Django repository. I used the default config for Black from the tutorial I followed and it's been working great,

How to show multiple charts on Django use python-highcharts?

How to show multiple charts on Django use python-highcharts ? When I Show multiple charts, it shows Uncaught Error: Highcharts error #16: www.highcharts.com/er

Django 'attempt to write a readonly database' even if db file has read and write permissions

I am using SQLite3, Ubuntu server. I have checked the read and write permissions of the database file. It is: -rw-r--r-- Doesn't this mean that the file has rea

Create model with a link to static-file when created

I have a model class myModel(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete = models.CASCADE,null=True) start_price = model

Django and postgresql schemas

I've been trying to solve this one all week, help very much appreciated. I have various schemas in a postgres db and I would like to be able to map to them fro

In django after deleting the posts the post images are still in the directory

In django my posts are deleted but the files are not. I have a image field in the model which i want to deelete whenever the author deletes it. I'm using generi

Mime Type Issue Loading CSS With Django App

I have a Django app hosted on Heroku, and my stylesheet isn't loading. Now I've taken the time to read the other questions on this issue, but I believe each sit

custom static files not loading in django project

I have a django project where I have kept all the static files in a project level static directory. I have included STATIC_URL = "/static/" STATIC_ROOT = os.pat

How to validate AzureAD accessToken in the backend API

I just wanted to know how can we validate the azure ad access token in a backend API in my case i.e. Django rest framework. Consider that I have a single page a

Celery + Django on Windows: debugging asynchronous tasks

With Django 1.8 I used Django-celery to run asynchronous tasks and I was able to debug them in my IDE (either PyCharm or Eclipse+PyDev) just launching "python c

django testing class based view

I have a Class based view defined as: class Myview(LoginRequiredMixin, View): def post(): #....... to test this view i tried this class MyViewTes

CharField on django is outputted as (<django.forms.fields.CharField object at XXXX>,)

I'd like to output the input field on the template, but it is outputted as django.forms.fields.CharField object at XXXX How can I fix this issue? I hav

CSS static file is not loading in Django

I am learning Django and i tried to implement a blog app . i am getting an error while using the static files inside project.i know, There are lot of questions

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