My application currently flows through 3 pages: User selects question in index page User submits answer in answer page User is presented with result in results page. I want to compress that down to a single page where the user submits an answer to the question and result is shown on the same page. The following django-template code separates questions
Tag: django
JavaScript not found in Django
I am trying to use JavaScript within my Django project. I have made a static folder within my app containing css and js folders, and whilst my css is working my js files are not. Any help would be great, thanks. HTML: settings.py: Answer You need to give a static directory to the STATICFILE_DIRS setting, not the full path: And
JQuery, how to pass the slug variable
I’d like to know how I can pass the slug variable into JQuery/javascript. I have a data-table with items, on each row there are two buttons, one (1) is using Django to create a product, the other (2) is supposed to use JQuery / JS to create a product. To create a product with button 1 I find being straight
Getting the value of select option Django
Im been having a trouble how can I get the the value of my select option, I been using javascript to set the value of select option, below is my code which is returning the province value to number instead of text. The problem is how can I convert the number to text, is there any expert who share solution
Non-ASCII characters are not correctly displayed in PDF when served via HttpResponse and AJAX
I have generated a PDF file which contains Cyrillic characters (non-ASCII) with ReportLab. For this purpose I have used the “Montserrat” font, which support such characters. When I look in the generated PDF file inside the media folder of Django, the characters are correctly displayed: I have embedded the font by using the following code in the function generating the
How to display data dynamically with ant design tables
first please my javascript skill level is not good, but here… I have a table i got from ant.design, im trying to build a frontend with react, so I want to display some data on the table from my database but im finding it had because of the want ant design table is set up. This is the code Note
Django, how to convert Python dict to Javascript
In a Django app I have a dict created in a view and I want to use it in Javascript, but I get a syntax error views.py test_dict.html test_dict.js Line 2 gives the output {0: “use_random”, 1: “use_stages”, 2: “use_import”, use_random: 0, use_stages: 1, use_import: 2} but throws the error in line 3 SyntaxError: Unexpected token o in JSON at
Using a variable to for loop using django
I’m very new to python and django framework. I’m facing a minor issue of not being able to assign a variable to my for loop. In my html file there are buttons and a list (rendered using a loop). for ex: Buttons Inside script tags i’m updating the variable value as Also i have a loop like following in the
Javascript .on(‘click’ is not working on span
So I’ve spend already 2 days trying to solve this. I have a <span class=”faicon-add” data-id=”id_object_places_proximity_keys-0-place_icon” rel=”faicon-add”> and a jquery script loaded The problem is that $(‘.faicon-add’).on(‘click’, function(){ won’t trigger… I’ve tried to add onclick=”open_modal();” and directly placing this function under that span And it worked, but that is not a solution for me, because I need to give a
Connecting JavaScript with Django
I want to connect Django with JavaScript because I know a few tools that will help me with my applications and they work best with JavaScript I want to take all the urls and redirections with python and Django but I want some features working with JavaScript and possibly I might want to even want to connect my database with