19,688
questions
-1
votes
0
answers
30
views
Not redirecting to correct template
So I am practicing django cbvs and I am using update veiw to update model data and I created a button which is suppose to redirect to the form to update but it is showing me the same template page ...
0
votes
0
answers
23
views
Django TemplateView raising on production Server 500 error
I am using Django with a gunicorn server for serving the dynamic templates and also the static files with whitenoise.
The application runs in an Docker-Container with a postgresql Database.
When using ...
-1
votes
0
answers
24
views
Django Template Not Rendering Dictionary
I have two microservices. One encodes user data and sends it to the other, which decodes it and renders it.
The decoded data is in a Dictionary format but can't seem to be rendered
Microservice One
...
1
vote
1
answer
25
views
How do I correctly render a django-view using Apphooks in django-cms?
I am building a project in Django CMS using version 4.1.2. Part of the project will be a news-section, for which I defined a Django model like this:
# news/models.py
from django.db import models
from ...
0
votes
1
answer
36
views
Django Template: How to connect chat script passing in Django Tag with JavaScript?
I'm working on a Django project where I need to conditionally render and execute a chat script based on user cookie consent. Here's what I've got so far:
In my Django template, I have the following ...
1
vote
2
answers
65
views
Django static url not seem to be loading css file
I'm actually new to Django and tried to load my theme into newly created project.
I have a home.html template file placed at {APP_NAME}/templates/ directory of my Django project. The APP_NAME is ...
0
votes
0
answers
18
views
how to iterate through django-friendship provided template tag
I am using Django 5.1 and django-friendship library. django-friendship provides some built in template tags that work but not when I try and iterate over them. so {% friends request.user %} returns a ...
0
votes
0
answers
23
views
reset_password function causing Internal Server Error
i work in django project and i have this function :
def reset_password(request):
if request.method == 'POST':
email = request.POST['email']
try:
# Check if the user ...
0
votes
0
answers
17
views
How can I implement a progressive data updation scheme based on the study levels of students in a particular year using Python and Django?
I am working on a project that is to handle students' level of education that is to be updated yearly as they move to another class in new year using python and django. Then render their academic ...
0
votes
1
answer
47
views
How do we unzip a zip file in the file's parent folder in python3.x
I have a requirement to unzip an archive by selecting it at runtime.
I am passing the zip file using HTML input type file in my template and then using ZipFile's function extractall(). This ...
0
votes
1
answer
32
views
How to Resolve the Issue: Django with Visual Studio Code Changing Template Without Effect?
I have a Django app, and I am using Visual Studio Code as my editor. I have implemented functionality for recovering passwords via an email template. I edited the template to see what effect it would ...
-1
votes
0
answers
12
views
Passing argument in url [duplicate]
My template:
<form method="post" action="{% url 'edit_items_page' item_trackid %}" enctype="multipart/form-data">
URL patterns:
path('edit_items_page/<int:...
1
vote
1
answer
24
views
Django Obtaining access path error for static resources
I used Django to configure a default avatar path in static/images, but the system always looks for the default avatar file in media/images.
models.py
class Profile(models.Model):
user = models....
0
votes
1
answer
45
views
create content page - filter queryset by foreignkey and render the result to Django templates -
Trying to render this structure (tree structure):
Book_1
Books_1's Chapters
Book_2
Books_2's Chapters
book:To Kill a Mockingbird
itschapter:Chapter 1 - The Beginning of the Finch's
itschapter:...
-1
votes
2
answers
45
views
how do i set django up? and fix this error?
127.0.0.1/:1 Refused to execute script from 'http://127.0.0.1:8000/scripts/scripts.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
error i got...
...
0
votes
1
answer
23
views
Images are not showing in slider in Django Website
I have completed all the requisite steps to display the images slider of my Django Website Project. But the images are not shown without displaying any error, I think there is a mistake in my home....
2
votes
3
answers
151
views
Media Image is not loaded in the output of Django Project
I am working on this django project where after uploading images to media through admin panel, i couldn't get any image in the output although, it's alt text are shown. Here is some code which may ...
0
votes
0
answers
57
views
{% static 'file' %} should fail if file not present
I am currently working on a Django application. When I use {% static 'file' %} within my template everything works great locally and on production as well, when file exists.
When file does not exist, ...
0
votes
0
answers
35
views
How to Display an Image in a Django Form Instead of Showing Its URL
I have a Django application where I want to display the image in a form when editing an existing product. It's showing the image URL in currently, but I would like to display the actual image itself ...
0
votes
1
answer
64
views
Trying to create a generic HTML template that renders a set of questions under topic headings based on context from views.py
Edited - Test Code or lists
Created quick page to printout the Topic and associated questions
html:
<!DOCTYPE html>
<html lang = "en">
<meta name="viewport" content=&...
0
votes
0
answers
27
views
Django: cannot display variations of items on the template
I'm working on adding product variations to my website. However, I'm encountering a problem where the drop-down menu is showing product names instead of sizes. My application already filters products ...
2
votes
1
answer
17
views
Highlight Active Links are not working in Django Website
I fulfilled all requisite steps to highlight the active links in my Django Website Project. As I click on About Us, Contact Us, or Services options in the menu bar, No menu bar options are highlighted,...
-1
votes
1
answer
24
views
html file have something wrong Registration Form not submitting in Django
My html file have some issues but I can't figure it out what the problem actually is.
Can anyone Identify what really the problem is.
Here is Html I'm using:
signup.html
{% include "user/layout....
1
vote
1
answer
26
views
django RelatedManager return None in template
I am trying to access related data in Templates But I only get None.
models
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from ...
0
votes
2
answers
43
views
Error to access add record template from admin site using Jazzmin template
I got this error when I try to use jazzmin template in my django project.
This error occured only when I try to access the add record template from admin site
But when I use default django admin ...
0
votes
0
answers
19
views
Trying to match Django template table headers with values in columns when there are missing cell values
I have a Player model, an Event model, and a Pick model. Theoretically, a Player should submit a Pick for each Event, but this doesn't always happen and there may be times when a Pick is not yet ...
0
votes
1
answer
37
views
How to resolve the error Method Not Allowed (POST) in Django?
I'm creating a POS application in Django. Currently I'm using the template bellow for adding items to a current order, modifying quantities, deletes some items that are unecessary to be in the current ...
-2
votes
1
answer
29
views
Adding new row to the Django template table
I have a simple table generated from Django template variable:
{% for object in object_list %}
<tr>
<td class="c9">{{object.first_name}}</td>
<td ...
0
votes
0
answers
35
views
My django application is not rendering instead it is just showing the csrf middleware token id in the address bar
This is the base.html file,
<h1>Task Manager</h1>
This is the views.py file section,
class filterTask(View):
def get(self, request):
return render(request, 'filter-task.html')...
-1
votes
0
answers
6
views
create a function that will mail a customer the order they made in a table format using django-python
create a function that will mail a customer the order they made in a table format using django-python
create a function that will mail a customer the order they made in a table format in django-python ...
0
votes
1
answer
39
views
Django STATIC_URL value "/static/" vs "static/"?
I'm a junior dev and know how pathing works. I'm wondering what the paths for the directory that static files will be served from are if the values for are STATIC_URL="/static/" and ...
1
vote
0
answers
54
views
Echo response issue with Templ ( Golang )
Echo & Templ Response Issue
I am trying to build an admin dashboard for my project using Echo V5 & Templ.
My current setup
// RegisterRoutes -> a route registeration method used to ...
0
votes
0
answers
20
views
Django Formset Validation Issue: "This field is required" Error for Formset Fields
enter code hereI am working on a Django project that involves using a ModelForm for a Driver model and an inlineformset_factory for a related DriverTrip model. The formset is supposed to dynamically ...
0
votes
1
answer
34
views
how to override a google auth screen with a custom template
I want a custom template in the url http://accounts/google/login. How do I do it.I just want some stying in it with CSS. Suggest a stepwise solution.Should I try custom template but where do i place ...
1
vote
0
answers
41
views
How to implement follow/unfollow functionality without reloading the page in Django
I am building a web application using Django where users can follow or unfollow items (e.g., photos) from a list. Currently, I have implemented the follow/unfollow functionality, but it reloads the ...
0
votes
1
answer
20
views
Request.session in django doesnt pass through ajax unless i refresh the page
Request.session in django doesnt pass through ajax unless i refresh the page
request.session remains the old one unless i hit refresh to the page
any help would appreciated
` $(document).ready(...
0
votes
1
answer
17
views
How to use Django's {% static %} tag inside background image URL of inline CSS?
While i'm working on a django project, in my html page there is div containing background image. I'll provide the code snippet below.
Here we can see a gif file which I want to put in a {% static %} ...
2
votes
2
answers
50
views
Is there any way to know when I'm passed the last item while iterating through a dictionary in django template?
I'm trying to create a text representation of a JSONField that has some data structured as an array of dictionaries like this:
[
{
"key1":"value1",
"key2":"...
1
vote
2
answers
67
views
Django `Not Found: /payment_getway/` Error - URL Path Not Resolving
I’m encountering a Not Found: /payment_getway/ error in my Django application. Despite setting up the URL path and view function, Django cannot find the specified URL. I’ve provided all relevant code ...
2
votes
2
answers
54
views
How to Load Templates in Django for specific application? [duplicate]
So I am learning Django at in advanced level. I already know how to include templates from BASE_DIR where manage.py is located. However I wanted to know how to locate templates in the specific app in ...
0
votes
1
answer
26
views
Python Django urls.py do not remove part of the address
I have urls.py as is. If I go to /catalog/product/"path" then on this page I can't specify a URL that won't include /catalog/product/"path". Please tell me how to change urls.py so ...
0
votes
1
answer
58
views
Issue with Google OAuth Login using Django Allauth - Bland Account Selection UI
I'm working on a Django project where I've integrated Google OAuth login using the django-allauth package. The functionality works in terms of authentication, but I'm encountering an issue with the ...
0
votes
0
answers
21
views
Django modal window
I have a modal window for deleting comments. It looks like this:
<div id="deleteModal" class="modal">
<div class="modal-content">
<img class=&...
0
votes
2
answers
58
views
JavaScript from Django Base Not Working On Startup
I am attempting to get a customer logo to load when a user signs into my app. The JS function is not firing and I do not see any information in the logs
To do that I am using the views function below ...
1
vote
2
answers
55
views
I am recieving a NoReverseMatch error does anyone know what I'm doing wrong?
Im trying to allow the user to edit an existing entry. But when I include
new_entry.html
`{% extends "learning_logs/base.html" %}
{% block content %}
<p> <a href="{% url '...
1
vote
0
answers
50
views
Attempting to put data from database onto dashboard in Django
So I am following this guide: https://www.youtube.com/watch?v=_sWgionzDoM and am at around 55 mins so far
I have the login stuff all working however I am unable to get the dashboard to show my data ...
0
votes
2
answers
28
views
forms.ModelMultipleChoiceField with widget=FilteredSelectMultiple not working on custom new Django Admin
I am trying to show the forms.ModelMultipleChoiceField on custom new admin form page but it doesn't seem to show it the way it is showing on the Django page that was already made e.g. model product ...
0
votes
0
answers
21
views
Alpinejs errors when used in Django templates
I have AlpineJS loaded in my Django base.html template, and throughout the app I'm using AlpineJS in my partials. This works locally, but when I deploy I see errors such as:
Alpine Expression Error: ...
0
votes
0
answers
43
views
How to get form file data rendered in form invalid cases in django
i have defined a form in django as :
forms.py
@parsleyfy
class CreationForm(forms.Form):
sample_name=forms.CharField(label="Agent Name",max_length=40, widget=forms.TextInput(attrs={'...
0
votes
0
answers
20
views
PDF not generated from Django template
I am working on a form where I need to pass the user inputs into a context which is then passed to Django template which should be converted to a PDF file. However, instead of getting a PDF attachemnt ...