Category "django-templates"

How can I delete a request.session variable inside the Django HTML template?

Code: {% if request.session.message %} <div class="alert alert-warning alert-dismissible fade show" role="alert"> <i class="bi bi-check2-circle">

Static file doesn't exist and html-file doesn't work properly

output: 'static' in the STATICFILES_DIRS setting does not exist. I've tried os.path.join(BASE_DIR, '/static'), but it is doesn't work. I didn't have this probl

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

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

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

Not all files called with django static appear

I have index.html file in template file and I have js, css, image, files in my static file. I am writing the codes correctly, but the site does not appear prope

Django Not Found: /assets/js/main.js How Can I Solve this?

This is the error I am facing Not Found: /assets/vendor/venobox/venobox.css Not Found: /assets/vendor/boxicons/css/boxicons.min.css Not Found: /assets/vendor/ow

How to display Foreign key Data in Django view page?

i have relation between Project and ProjectFloorPlan, and i want to display ProjectFloorPlan data in my template. Please let me know how i can display the Forei

How to display Foreign key Data in Django view page?

i have relation between Project and ProjectFloorPlan, and i want to display ProjectFloorPlan data in my template. Please let me know how i can display the Forei

Date Picker does not shown up

I am new to frontend development. Normally I do backend and infra. During the daytime I heard from the frontend-angular guys talking on datepicker widget a lot.

Django: ProtectedError exception handling is not working

I am trying to handle ProtectedError exception and try to post a custom error message in my template. def delete(self, request, *args, **kwargs): obj = sel

Cannot get images to load in django

I cannot get an image to load in Django by following the documentation. I have the following directory structure: And here is a snippet of my code within backe

Access Django variable from JavaScript variable

First of all, I will like to say this is my first question here! (pardon me if this is redundant or duplicated) I am having some problems with calling JS script

serving media files in Django for Production

I want to serve all types of media files in my Django Project I used Whitenoise to server static files and static files are working well but I'm having issues w

Is it possible to submit multiple forms at once using Django views?

What I want to accomplish is to be able to submit multiple forms contained on one page. What I have currenlty done is supplied a view that returns 8 forms. Is i

nothing happens when submitting django form

I have a problem with django forms, when submitting a form nothing seems to happen, even the server didn't get any response except GET request to view the form

Django form with two submit buttons . . . one requires fields and one doesn't

I think this should be a fairly straightforward question . . . I have ONE Django form with TWO different submit buttons. The first submit button is just for SAV

How to upload multiple files in Django using Dropzone js?

Info: I want to upload multiple files using Dropzone js in Django project. I have two models. One for the Post and the other would be for the File. My files mod

Django media file not found

Media file is not getting. The fields related to User model are working(eg. object.username, object.email) but field with ProfileImage is not working. urls.py

how to pass extra custom attribute in Django template from "select option" form to a view

I have an html form include a select input in Django template, and the option has an extra attribute value called "testvalue". I want to pass the "testvalue" at