Quantcast
Channel: Active questions tagged django-templates - Stack Overflow
Browsing latest articles
Browse All 221 View Live

How do I override the delete() method in Django's DeleteView to send a...

I'm using Django 5.0.3. I have a job listings app, with a DeleteListingView. I want to override the delete() method, so that I can use messages.success() to send a message to the success url's template...

View Article



ckeditor is not good for django anymore

before ckeditor worked for django but now it is not working and expired.django by itself suggest non-free ckeditor 4 LTS or ckeditor 5 but I don't know how to use it please if there is give me another...

View Article

Django Bootstrap form-select...how do I find the selected value?

I have a Django application using Bootstrap form-select. This is filled up from a table like this:<div class="div-1 rounded bg-light text-dark "> {% trans "Active restaurant: " %}<select...

View Article

Image may be NSFW.
Clik here to view.

Get values from 2 database statements with radio buttons

I am trying to connect two database statements via two radio buttons. As soon as I change the radio button value, these have to be retrieved again directly via the database.I am currently trying to do...

View Article

How to redirect to homepage in Django if already logged in and then try to...

So I have "django.contrib.auth.urls" to implement login in my app called accounts. I also have set LOGIN_REDIRECT_URL = "home"LOGOUT_REDIRECT_URL = "home"in settings.When I log in it redirects me to...

View Article


login and my profile api binding in django template

this is my login api view. i am using adminlte for frontend to develop admin panelclass LoginView(APIView): @extend_schema(request={'email', 'password'}) def post(self, request): email =...

View Article

Django: Hide button in template, if user is not super-user

How do you get your template/view to recognize whether or not a logged in user is a super user or not? There are certain buttons on my forms (in the template) that I want completely hidden if the user...

View Article

django model query two different tables only first table work

Am trying to query two different tables and display there data on a form but only the first table work. pls i need help to display the second table on same form.acconty =...

View Article


django string interpolation struggles [duplicate]

Hi so I am having a problem trying to concatenate in django. I have created a new templatetag and im trying to get the string interpolation right and im struggling a bit.{% button text="Reset"...

View Article


DISTINCT ON fields is not supported by this database backend

I am using distinct to get the distinct latest values but it is giving me an error:DISTINCT ON fields is not supported by this database backendviews.pyclass ReportView(LoginRequiredMixin,...

View Article

how can I render tag set in my django template

I'm trying to render tags from a many to many relationship but I'm missing somethingThese are my models:class Post(models.Model): date = models.DateTimeField(auto_now_add=True) author =...

View Article

Send api key from a django template

I have a backend application with django, hosted in lightsail and using api gateway to manage it.The entire backend application is protected by the API key, this means I need to send an api key on each...

View Article

Need Django GUI IDE

I am new with Django. I need to quickly develop a sophisticated GUI for a Django project. My underlying database is resource description framework (RDF). Is there any Eclipse IDE available for quick...

View Article


Wagtail. How to get a list of child pages through one category higher in the...

I'm not good at English.I have been looking for a solution to my problem for a long time.There is such a category tree:class ProductPage(Page): parent_page_types = ['CatalogSubPage'] passclass...

View Article

The directory 'D:\dj\staticfiles' in the STATICFILES_DIRS setting does not exist

This is my settings.pyI already created a folder 'staticfiles' in the project folder. How can I solve the error

View Article


Django Templates - How can I have correct Root vs App Lookup [duplicate]

How can I have view load the templates from the corresponding app (root vs child)?Here's the full structure:Create django project - universeCreated an app - let's call it earth.Created a (container)...

View Article

Image may be NSFW.
Clik here to view.

Custom widget in the choice field Django

I'm passing a form to the template. I need from this template to then pass to another template the option that the user has selected. In this case, one of the payment options. I can do this with...

View Article


Need help understanding working of react build artifacts in Django project

I have a Django backend in which I have pasted build directory of react project (after running npm run build). I see a bunch of web pages of react project opening when opened through code, i.e.<Link...

View Article

How to display output data from function in Django template?

The index function retrieves a string from 'n url and prints the desired output to the terminal. How do I set up my views so that it displays the data on my index html page? This is for a weather app...

View Article

CKEditor5: Image Upload Issue in Django (django-ckeditor-5)

I'm encountering an issue while integrating CKEditor5 into my Django project. Specifically, the image upload feature is not working properly. When I attempt to upload an image, I receive an alert...

View Article

prefill previous file field data in django form

I have two file fields in Django form and I want to set prefill data for fields. When form opens again dont need fill again file field.This is my form...

View Article


Image may be NSFW.
Clik here to view.

How can I display the DateTimeField in the django template as it's display in...

This is my model: class Event(models.Model): title = models.CharField(max_length = 255) club = models.CharField(max_length=70) event_image = models.ImageField(upload_to="event_images",...

View Article


It is possible to set a title tab in django without to pass throught html?

Is it possible to set a page title in Django without going through the HTML file directly?I have data stored in my object, and I want to extract the name to set it as the title in my template....

View Article

How do I get out the doubles of the dropdown menu?

I have a dropdown in the index.html which shows duplicate values. These are displayed if I have e.g. 2 articles with the same developer_id in index.html.I want that if several articles with the same...

View Article

clickable label for radio in django

i want to have clickable labels for my radio buttons in djangobut i cant click and the values are not registered in the database , its like just text<div class="probprior"><div...

View Article


When i press edit profile i get value error [duplicate]

trying to make an edit page where you can upload a profile picture and add various things to your profile, but when i click on edit profile i get "ValueError at /profile/The 'profile_image' attribute...

View Article

Django forms: cannot access local variable 'form' where it is not associated...

Condition: I have a model, created an empty table in the database, and I'm trying to create an html form that will fill in the fields of the corresponding columns of the table.And here's what my app...

View Article

I am using django for my project but one of my templates seems not to show...

I am trying to create a form that uploads songs to my database in my django application but l have done all the views, models, forms andd a template but there is nothingthat shows in my browser when l...

View Article

How to call function that takes an argument in a Django template?

I'm passing to Django's template a function, which returns some records. I want to call this function and iterate over its result. {% for item in my_func(10) %} That doesn't work. I've tried to set the...

View Article



How do I setup "Django" to generate multiple 'STATIC_ROOT' deployment...

Here's the problem, when migrating multiple'STATICFILES_DIRS', I am good to go, and the server continues to run with no errors...... Here's the snippet to my 'STATICFILES_DIRS' ......STATIC_URL =...

View Article
Browsing latest articles
Browse All 221 View Live


Latest Images