Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Page not found when following wagtail tutorial adding tags
I wanted to add tags to posts in the quickstart Wagtail blog by following the (Wagtail tutorial). When I clicked the "foood" tag that I added to one of my posts, I ran into a Page not found (404) error. Check out the screenshot below Here is my class BlogTagIndexPage(Page) in blog/models.py # Add BlogTagIndexPage class BlogTagIndexPage(Page): def get_context(self, request): # Filter by tag tag = request.GET.get('tag') blogpages = BlogPage.objects.filter(tags__name=tag) # Update template context context = super().get_context(request) context['blogpages'] = blogpages return context and my blog_tag_index_page.html in blog/templates/blog/ {% extends "base.html" %} {% load wagtailcore_tags %} {% block content %} {% if request.GET.tag %} <h4>Showing pages tagged "{{ request.GET.tag }}"</h4> {% endif %} {% for blogpage in blogpages %} <p> <strong><a href="{% pageurl blogpage %}">{{ blogpage.title }}</a></strong><br /> <small>Revised: {{ blogpage.latest_revision_created_at }}</small><br /> </p> {% empty %} No pages found with that tag. {% endfor %} {% endblock %} What am I missing? -
Why my tags don't show not created in the form?
my list don't show the tags when i create an announcement outside admin panel, my tags don't show enter image description here my code: views @login_required def announcement_create(request): if request.method == 'POST': announcement_form = AnnouncementForm(request.POST) if announcement_form.is_valid(): instance = announcement_form.save(commit=False) #auto stand in field author his user name instance.author = request.user instance.slug = slugify(instance.title) announcement_form = instance announcement_form.save() messages.success(request, 'announcement created'\ 'succesfully') else: messages.error(request, 'Error create announcement') else: announcement_form = AnnouncementForm() return render(request, 'announcement/announc_create.html', {'announcement_form': announcement_form}) model: class Announcement(models.Model): category = models.CharField(choices=professions, blank=False) title = models.CharField(max_length=40, blank=False) slug = models.SlugField(max_length=250, unique_for_date='publish', ) price = models.IntegerField(default=None, null=True) author = models.ForeignKey(User, on_delete=models.CASCADE, related_name='announcement_work') publish = models.DateTimeField(auto_now_add=True) description = models.TextField(max_length=500, blank=False) company = models.CharField(max_length=30, blank=False) experience = models.CharField(choices=Experience, blank=False) address = models.CharField(max_length=30, blank=False) city = models.CharField(max_length=30, blank=False) country = models.CharField(max_length=30, blank=False) Favorites = models.ManyToManyField(settings.AUTH_USER_MODEL, related_name='Favorites', blank=True) class Meta: ordering = ['-id'] indexes = [ models.Index(fields=['-id']) ] def __str__(self): return self.title def get_absolute_url(self): return reverse('account:announcement_detail', args=[self.publish.year, self.publish.month, self.publish.day, self.slug]) form: class AnnouncementForm(forms.ModelForm): class Meta: model = Announcement fields = ['category', 'title', 'price', 'country', 'city', 'description', 'experience', 'company', 'address', 'tags'] and i have another question: i don't know how to extract the announcement data to edit it and i've tried many ways, but i still … -
When I login to my heroku account,it is asking the code generated by authenticator app ,but I did not saved it when I login ..I can I solve this
When I login to my heroku it it is asking the code from authentication app I forget to save that code when I signup so it is getting an error when login,I now How can I get that code.. I want to login it ..I had tried it many times ,I unable to login it please any one help me to login it again , because I have to make some changes into my account please share the solutions please -
DefaultCredentialError in Django while using Google Cloud Services
I am building an application in Django where I am using Google Cloud Services for file upload and storage, but I am facing this error: in default raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS) google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information. Here is my project directory structure: ├───core │ ├───migrations │ │ └───__pycache__ │ ├───static │ │ └───core │ │ └───background │ ├───templates │ │ └───core │ └───__pycache__ ├───data ├───file_upload │ ├───migrations │ │ └───__pycache__ │ ├───static │ │ └───file_upload │ ├───templates │ │ └───file_upload │ └───__pycache__ ├───users │ ├───migrations │ │ └───__pycache__ │ ├───templates │ │ └───users │ └───__pycache__ └───videovogue_web └───__pycache__ Now my .json file is in data folder, and here is my settings.py DEFAULT_FILE_STORAGE = 'storages.backends.gcloud.GoogleCloudStorage' GS_BUCKET_NAME = 'videovogue' STATICFILES_STORAGE = 'storages.backends.gcloud.GoogleCloudStorage' GS_CREDENTIALS = service_account.Credentials.from_service_account_file( "data/savvy-equator-418206-6d9e28bff3e9.json" ) If you guys need any other information, please tell me. Thanks -
VSCode task to run Django server and open Firefox
I'm trying to make a task that runs the Django server and opens Firefox. I've tried with { "version": "2.0.0", "tasks": [ { "label": "Django Server", "type": "shell", "command": "(python manage.py runserver &); sleep 10 && firefox http://127.0.0.1:8000", "group": { "kind": "build", "isDefault": true } } ] } The browser displays "Unable to connect". Refreshing the page doesn't help. Everything works fine if I run python manage.py runserver on the command line and then open http://127.0.0.1:8000 in Firefox manually. NOTE: everything works as expected when I switch firefox for chromium in the command field. -
Development Environment Django port 8000 to serve React (staticfiles)
I'm trying to setup a development environment for React and Django. https://github.com/axilaris/django-react <-- Here is my project code for reference. You can easily run in with the instructions below easily. Django (runs on port 8000) cd backend <-- to to this directory backend> python3 -m venv backendvirtualenv && source backendvirtualenv/bin/activate backend> pip install -r requirements.txt backend> python manage.py makemigrations backend> python manage.py migrate backend> python manage.py runserver React (runs on port 3000) cd frontend <-- to to this directory frontend> npm install frontend> npm run build frontend> npm start However, I'm trying to serve React staticfiles in Django so that I can run React on localhost:8000. In settings file: BASE_DIR = os.path.dirname(os.path.abspath(__file__)) STATICFILES_DIRS = [os.path.join(BASE_DIR, '../frontend/build/static')] STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') and the I run backend> python manage.py collectstatic backend> python manage.py runserver However, when I point to my browser (http://localhost:8000/). It doesnt still have the React pages. How can I configure django so that I can run React and Django together in port 8000 ? -
Can I configure a free web app on Azure with static files?
I am trying to deploy my first Django project, but for some reason the static files are not working properly. When I check out static directory in my SSH it shows that the files are in there, but the template doesn't see them. My settings: STATIC_ROOT = BASE_DIR / "static" STATIC_URL = "static/" STATICFILES_DIRS = [ BASE_DIR / "assets" ] I couldn't find anymore answers on stack overflow that would help me so I asked chatGPT and he said that I should create a storage on Azure. When I asked him if there are free storage plans, he said no, but I shouldn't pay much and he forwarded me to pricing calculator which showed $21 for a month. This app has a funny static containing only of base.css and a mushroom photo. Should I really pay $21 or even more for it a month? I wonder if there is any other way than to create a storage or perhaps the pricing in the calculator was wrong. The code: https://github.com/JJDabrowski/Shroomcast -
Django 4.2 on Azure deployment: failure to load static
I am trying to deploy my first Django app to Azure and everything works, but for the static files. My settings: STATIC_ROOT = BASE_DIR / "static" STATIC_URL = "static/" STATICFILES_DIRS = [ BASE_DIR / "assets" ] The project doesn't have static directory while being added from the GitHub (https://github.com/JJDabrowski/Shroomcast), but this directory appears by itself after the deployment in the SSH in tmp/someStrangeString directory (someStrangeString looks like git commit name). And it's fully configured so I don't need to even run collectstatic in the folder. What am I doing wrong? -
Django NoReverseMatch Error: Reverse for 'course_detail' with arguments '('',)' not found
I'm encountering an issue with Django's URL reversing. Whenever I try to access the URL generated by the {% url 'course_detail' course.id %} template tag, I'm getting the following error: enter image description here Here's the relevant portion of my code: html enter image description here And here's how I've defined the URL pattern in my urls.py file: urls.py enter image description here I'm passing the course.id as the argument for the URL lookup, but it seems that it's not being recognized properly. Can anyone help me understand why this error is occurring and how I can resolve it? -
Loading static problem (Django 4.2. on Azure)
I am fighting with my first Django deployment on Azure and almost everything went smoothly now but for static files. I have read several threads about this, but I couldn't find the answer that would help me. I finished with this one for now, because it seemed the most logical: if DEBUG: STATICFILES_DIRS = [ BASE_DIR / "static" ] else: STATIC_ROOT = BASE_DIR / "static" But I get 500 on my site and even an SSH Console doesn't connect when I turn DEBUG=False even though deployment went smoothly. Without that if I got the error that the STATIC_ROOT cannot contain STATICFILES_DIRS. Some solutions suggest to set STATIC_ROOT to home/site/wwwroot, but it seems obsolete, since all the files are now located in tmp and some weird directory name that looks like git commit name or something like that, so it would be hard to set the root there. Repo: https://github.com/JJDabrowski/Shroomcast Please help :) -
Is there a way to create tables/entities on the Django db using RAW SQL
I would like to know whether it is possible to create and setup my entities in my database(db) using RAW SQL in my Django Project. I understand that we can use SQL Queries to handle entities that have already been created using ORM. Examples were shown in the Django Documentation I know that using RAW SQL is inefficient compared to using Django's ORM but one of the requirements of my project is to use SQL Statements for all database related functions. The following is the code written in models.py in my Django app: class Link(models.Model): name = models.CharField(max_length=50, unique=True) url = models.URLField(max_length=200) slug = models.SlugField(unique=True, blank=True) clicks = models.PositiveBigIntegerField(default=0) The following is an example of the SQL Statements needed to create my entity: CREATE TABLE Link ( id SERIAL PRIMARY KEY, name VARCHAR(50) UNIQUE NOT NULL, url VARCHAR(200) NOT NULL, slug VARCHAR(50) UNIQUE, clicks BIGINT DEFAULT 0 ); I can't seem to find any resources or any way to add my SQL Statements to my code using the Manager.raw(raw_query, params=(), translations=None) method. -
How to use djangorestframework-camel-case with drf-spectacular for camelcase schema
I have set up djangorestframework_camel_case and it works for rendered response data in swagger-ui (drf-spectacular) - camel case response is generated. But the schema generated in the swagger-ui is still snake-case. How can I make sure it also applies camel case to schema? I see this PR that apparently adds support for djangorestframework_camel_case, not sure exactly if it is expected to work out of the box, nothing in the docs. -
how can i put django-multi-captcha-admin in django jazzmin?
i was asking how can i put multi captcha admin in my Admin Login with Jazzmin which is Django Admin Theme??, because i've put the configs from multi captcha admin, but jazzmin doesn't allow me to show up the recaptcha in Login Admin Page i hope can you help me Thanks! i have this INSTALLED_APPS = [ 'jazzmin', 'multi_captcha_admin', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'ckeditor', 'django_recaptcha', 'captcha', ] MULTI_CAPTCHA_ADMIN = { 'engine': 'recaptcha', } JAZZMIN_SETTINGS = { # title of the window (Will default to current_admin_site.site_title if absent or None) obviously the captcha works when i remove the jazzmin from INSTALLED_APP, but when i'm in jazzmin, doesn't show it i don't know why.. i hope you can help me to fix it thanks! greetings -
Google Sheet Formula to Django Logic
I am creating a timesheet for an admin to enter time for users. I am converting this project from Google Sheets to Django. I am stumped to say the least. I am trying to get the total hours to match with the Google Sheet Formula. But it seems that my Django logic is not adding up. Here is the Google Sheet Formula: =(IF((MROUND(F6*24,0.25)-MROUND(F5*24,0.25))>=8,((MROUND(F6*24,0.25)-MROUND(F5*24,0.25)))-0.5,((MROUND(F6*24,0.25)-MROUND(F5*24,0.25))))) All cells (F5 and F6) are replaced with Start Time and End Time. Here is my Django logic. def calculate_total_time(self,start_time, end_time): if start_time is not None and end_time is not None: start_minutes = start_time.hour * 60 + start_time.minute end_minutes = end_time.hour * 60 + end_time.minute if end_minutes < start_minutes: end_minutes += 24 * 60 difference_minutes = end_minutes - start_minutes total_hours = difference_minutes / 60 # Calculate the rounded total hours rounded_hours = math.floor(total_hours * 4) / 4 # Adjust for cases where rounding might go over 8 hours if rounded_hours >= 8: rounded_hours -= 0.5 return rounded_hours else: return 0.00 Some hours display fine with no issues, but then I have hours like these where the logic does not add up. (Pictures for reference) Google Sheet Formula Output: Django Logic Output: I am trying to get the … -
why vercel return an error when deploying django app on it
I am endeavoring to deploy my Django application on Vercel following the method outlined in the video tutorial. However, during the build process, an error is being logged. Regrettably, I am unable to discern the cause of this error. Could someone proficient in this deployment process kindly pinpoint where I may have erred? The Logs: WARN! Due to `builds` existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings Installing required dependencies... Failed to run "pip3.9 install --disable-pip-version-check --target . --upgrade -r /vercel/path0/requirements.txt" Error: Command failed: pip3.9 install --disable-pip-version-check --target . --upgrade -r /vercel/path0/requirements.txt error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [21 lines of output] running egg_info writing psycopg2.egg-info/PKG-INFO writing dependency_links to psycopg2.egg-info/dependency_links.txt writing top-level names to psycopg2.egg-info/top_level.txt Error: pg_config executable not found. pg_config is required to build psycopg2 from source. Please add the directory containing pg_config to the $PATH or specify the full executable path with the option: python setup.py build_ext --pg-config /path/to/pg_config build ... or with the pg_config option in 'setup.cfg'. If you prefer to avoid building psycopg2 from source, please install the PyPI 'psycopg2-binary' package instead. … -
Django error while migrating to POSTGRsql cannot drop sequence home_userinformation_id_seq because column id of table home_userinformation requires it
My django application makes migrations successfully but when I try to migrate it, it prompts the following error: raise dj_exc_value.with_traceback(traceback) from exc_value File "C:\Users\shazi\OneDrive\Desktop\arabic\env\Lib\site-packages\django\db\backends\utils.py", line 84, in _execute return self.cursor.execute(sql, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ django.db.utils.InternalError: cannot drop sequence home_userinformation_id_seq because column id of table home_userinformation requires it HINT: You can drop column id of table home_userinformation instead. \ from django.db import models class UserInformation(models.Model): username = models.CharField(max_length=50) level = models.PositiveIntegerField(default=1) xp = models.PositiveBigIntegerField(default=0) def update_xp(self, amount): self.xp += amount self.save() # Save the model instance def update_level(self): if self.xp > self.level_up_threshold(self.level): self.level += 1 self.save() def level_up_threshold(self, level): # Indent for class method return level * 100 def __str__(self): return self.username class Module(models.Model): name = models.CharField(max_length=255) description = models.TextField(blank=True) xp_reward = models.PositiveIntegerField(default=0) # XP awarded for completing the module def __str__(self): return self.name class CompletedModule(models.Model): user = models.ForeignKey(UserInformation, on_delete=models.CASCADE) module = models.ForeignKey(Module, on_delete=models.CASCADE) completion_date = models.DateTimeField(auto_now_add=True) # Records date of completion class Meta: unique_together = ('user', 'module') # Ensures a user can't complete a module twice -
Unable to login to Django admin panel after implementing custom user model
I've done for customizing the User model, but I'm unable to log in to the admin panel with the superuser account I created. What could be causing this issue, and how can I resolve it? Any help or guidance would be greatly appreciated. users/user.py from django.contrib.auth.models import AbstractUser from django.db import models from ..managers.user import UserManager class User(AbstractUser): objects = UserManager() manager/user.py from django.contrib.auth.models import BaseUserManager class UserManager(BaseUserManager): def create_superuser(self, username, email=None, password=None, **extra_fields): extra_fields.setdefault('is_staff', True) extra_fields.setdefault('is_superuser', True) return self.create_user(username, email, password, **extra_fields) def create_user(self, email, username=None, password=None, **extra_fields): if not username: raise ValueError('The username field must set') email = self.normalize_email(email) user = self.model(username=username, email=email, **extra_fields) user.set_password(password) user.save(using=self.db) return user user/serializer.py from django.contrib.auth import get_user_model from django.contrib.auth.password_validation import validate_password from rest_framework import serializers # type: ignore # noqa: I201 User = get_user_model() class UserReadSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('id', 'username') class UserWriteSerializer(serializers.ModelSerializer): password = serializers.CharField(validators=[validate_password], write_only=True) class Meta: model = User fields = ('password', 'username') def create(self, validated_data): password = validated_data.pop('password') username = validated_data.get('username') user = User.objects.create_user(username=username, password=password) return user settings/base.py from typing import List DEBUG = True # This should be 'False' in prod mode SECRET_KEY = NotImplemented ALLOWED_HOSTS: List[str] = ['*'] CORS_ALLOW_ALL_ORIGINS = True CSRF_TRUSTED_ORIGINS: … -
OpenLiteSpeed django app broken after ubuntu upgrade
I was running an Ubuntu Image of litespeed django application, https://azuremarketplace.microsoft.com/en-us/marketplace/apps/litespeedtechnologies.openlitespeed-django It was 20.04 LTS, I tried to do a release upgrade which was successful to 22.04 but the OpenLiteSpeed server now fails to run. Steps I already tried: Reinstalled python virtual environment Re-installed the dependencies Tried running the application on 8000 port using python3 manage.py runserver command and it works on the browser as expected updated the vhost file on the Server with the update python runtime path from 3.8 to 3.10 The request keeps on spinning in the browser and after some time errors with 503. There is no entry in the /usr/local/lsws/logs/stderr.log file regarding the 503 error Steps I already tried: Reinstalled python virtual environment Re-installed the dependencies Tried running the application on 8000 port using python3 manage.py runserver command and it works on the browser as expected updated the vhost file on the Server with the update python runtime path from 3.8 to 3.10 -
Django index.html template - menu from queryset
I've got index.html with menu, that is (should be) populated using : {% for category in categories %} Usually, I can return queryset with categories in my view, but as it is index.html and menu, - am I forced to have that query to get categories, in every single view of my app? I think it is not the best approach, but I don't know how to do it correctly. Please help :) -
Styling Django Autocomplete Light
I'm using Django Crispy forms with the tailwind template pack to render out my form, I need autocomplete functionality to be able to search for and select an ingredient. The only viable package I could find is DAL (Django Autocomplete Light). The problem I am facing now is that I can't override the styling so that it looks the same as my other fields. If someone could point me in a direction of how I can achieve this I would be very grateful :) overiding the widget attrs (as shown below) does not do it as this affects the select element which is hidden by DAL my form field: ingredient = forms.ModelChoiceField(queryset=Ingredient.objects.all(), widget=autocomplete.ModelSelect2(attrs={'class': '*my_tailwind_classes*'})) -
Django Rest Framework eventstream endpoint closes immediately after connection
To implement SSE on DRF side I use django-eventstream. I use curl to check if my Django SSE implementation works correct: curl -N -H "Accept: text/event-stream" http://127.0.0.1:8000/api/{uid}/events/ For whatever reason I get only event: stream-open data: That's it, after that stream is closed. I have set up 'Daphne', 'django_grip.GripMiddleware', ASGI. It goes through custom middleware which checks if user has correct token to connect to this stream, sends initial event and closes. Any tips how to solve the issue are appreciated! -
My Django Azure app doesn't fill home/site/wwwroot with app's contents
My Django Azure app doesn't put the app's components in the home/site/wwwroot directory. The problem might lie in that I have renamed the main directory of the app as core. But I have tried to putting gunicorn --bind=0.0.0.0 --timeout 600 core.wsgi in configuration/general settings and this only broke the app and I found in logs that the module core is non-existant. I have also put SCM_DO_BUILD_DURING_DEPLOYMENT = 1 in settings. I still get the start app page instead of my apps' main page. You can see the code here: https://github.com/JJDabrowski/Portfolio Are there any ways to view to logs during the deployment to see what happens that my home/site/wwwroot doesn't have the app's components inside? -
CORS configurations in Django not working in production
I am working on a chat application with Django at the back-end and React at the front-end. Both are hosted on separate domains on vercel. I have added the CORS configurations in the back-end but they don't seem to be working in the production. Following are the CORS configs done in Django: MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ALLOWED_HOSTS = ['.vercel.app'] CORS_ALLOW_CREDENTIALS = True CORS_ALLOWED_ORIGINS = ['https://texter-frontend.vercel.app',] Here is one of the requests from the front-end: const backendServerEndpoint = 'https://texter-backend-jp24ejwc8-sourav-pys-projects.vercel.app'; const requestData = { 'phoneNumber' : phoneNumber }; fetch(backendServerEndpoint + '/auth/sendotp/',{ method: "POST", // *GET, POST, PUT, DELETE, etc. mode: "cors", // no-cors, *cors, same-origin credentials: 'include', headers: { "Content-Type": "application/json", }, body: JSON.stringify(requestData), }) .then( response => { if(response.status === 200){ setOtpSent(true); response.json() .then( responseData => { console.log(responseData); if(responseData.newProfile){ console.log("It is a new profile!!!"); setNewProfile(true); } } ) } } ) .catch( error => { console.log(error); } ) This is the error that I am getting in the console: Access to fetch at 'https://texter-backend-jp24ejwc8-sourav-pys-projects.vercel.app/auth/sendotp/' from origin 'https://texter-frontend.vercel.app' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode … -
Deploying my first Django app: seeing the settings site even though the app should be deployed
the deployment process went smoothly thanks to invaluable @PravallikaKV's help 🙏 But even after that I don't see the app but the startup page: I found out that there might be some problems in the folder structure and so I went to my ssh page ( https://.scm.azurewebsites.net/webssh/host ), only to find out that the files are already there, but perhaps in the tmp directory, not in the site/root one. I have added SCM_DO_BUILD_DURING_DEPLOYMENT = 1 at the end of the settings file for my app, but still when I navigate to the top of my website directory and checkout the root folder it's empty ( https://learn.microsoft.com/en-us/answers/questions/778446/django-application-deployed-but-test-page-shows-de ). I couldn't find neither site nor wwwroot inside the site folder and if I understand well from Django tutorial, I should run migrations from that folder. Please help. -
Implement Highlight.js in TextArea
I have a Django app that currently has some tools for the user to try out. I made an implementation of TextFSM and the way its set up is by making a TextArea form where the user can type his code and then it will output the result. Form looks like this: class TextFsmForm(forms.Form): """Form for the TextFsmParserView""" textfsm_template = forms.CharField( widget=CodeTextarea( attrs={ "class": "p-3 form-control bg-transparent resizeable", "placeholder": "TextFSM Template", } ), label="TextFSM Template", required=True, ) raw_text = forms.CharField( widget=CodeTextarea( attrs={ "class": "p-3 form-control bg-transparent resizeable", "placeholder": "Raw Text", } ), label="Raw Text", required=True, ) And the html is like this: <div class="pe-2"> <div class="mb-3 position-relative"> <label class="mb-2 fs-5 display-4" for="{{ form.textfsm_template.id_for_label }}">{{form.textfsm_template.label}}</label> {{ form.textfsm_template }} </div> <div class="position-relative"> <label class="mb-2 fs-5 display-4" for="{{ form.raw_text.id_for_label }}">{{form.raw_text.label}}</label> {{ form.raw_text }} </div> </div> <!-- Rendered output --> <div class="d-flex flex-column"> <p class="fs-5 mb-2 display-4">Result</p> <div id="result" class="p-4 p-md-3 tool-output form-control"> {% if output %}{{output}}{% elif error %}<span class="text-danger">{{error}}</span>{% endif %} </div> </div> Now my problem here is that whenever I try to use either Highlight.js or Prism.js the only hightlight Im getting is the font changing. No colorization or anything. Most relevant post I could find is here but still doesnt …