How do I post a file in Vue? I am using Django. My response is ok. Answer I solved my problem: my views.py My .vue file
Tag: django
Implementing JS in Django templates
I have a list of ingredients, for every ingredient, I would like to give the option to delete the current ingredient via using a popup that asks the user “are you sure they want to delete this?” If confirmed, I want that ingredient to be deleted. Currently, no matter which ingredient I choose to delete, it always the deletes the
Change Django theme based on logged in, profile, or toggle
I would like to allow the user to have the ability to change the theme based on the following factors: Anonymous Check localStorage and if empty use default else use localStorage Authenticated Check localStorage and if empty use user profile setting I have it all working except for Authenticated users, I don’t know how to check localStorage. Answer Here is
Chart.js- Dates not displaying correctly on chart and axis labels not showing
I’m trying to label my axes on my chart. I’m using chart.js v3.9.1 and I believe I’ve followed the documentation, however the labels aren’t showing up (see below): health_hub_tracker.html: views.py: You will also see that on my x axis- the dates are coming through as a sum. The data I have are: [‘2022-10-09’, ‘2022-10-09’, ‘2022-10-05’, ‘2022-10-05’, ‘2022-10-05’] so it is
How can I use a module from npm in a django-admin widget, without installing node?
Background I have a django app that I want to create an admin widget for. The widget will display text in a particular way (like a terminal). It’s so that app admins can see forwarded logs from an analytics process that is orchestrated by django (the app is django-twined). To do that I want to use something like terminal-kit or
Using innerHTML to include HTML Django page not work
I am trying to include an HTML when a button is clicked in a Django project but the error a Uncaught SyntaxError: Invalid or unexpected token Here is the Javascript: The error showing is at this line of code as if the include code is not there at all. My question: How can I add this code through javascript and
Retun data from a Django view after a javascript AJAX POST request
I am using Javascript to send an asynchronous request to a Django View. The View is able to receive data from the POST request, but I can’t seem to return a message to confirm that everything worked. I was expecting that xhttp.responseText would contain the message Thankyou, but it is empty. The html part looks like this: The javascript looks
Django. Infinite Scroll on Scrollable Table is not working
I have an scrollable table in one of my templates defined like this: And my view is defined like this: So, I followed the tutorial posted on here, but when I get to the table bottom, nothing happens. I don’t get why is not loading the rest of the data when I get to the ‘waypoint’. Any suggestion or new
OnSubmit function not working for an input type= ‘submit’
I am making a quiz app using django and it’s my first ever work using django Everything else is working fine instead of one thing which is whenever i press the button to submit the answer, page simply reloads. Here’s my html code: Here’s the js code relevance to the button: According to this script I must see an alert
How to lazy load javascript libraries after a htmx request?
I’m creating a web app dashboard (Django + htmx), and I only want to load the plugins that the user needs and not load every single plugin immediately because it would slow down the site. Example: The user clicks a button, and the whole HTML body gets replaced with a Wysiwyg editor. Whats the best way to dynamically load a