Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
Can't access Django template variable

I have problem and can't see the error here, I want to pass some variables into newly generated template and then access it with javascript. But template is rendering empty value. But I can see in console that variables are not empty.

The views.py

        arguments={'ram_count':ram_count,
           'max_ram':max_ram}
print(arguments['ram_count'])
print(arguments['max_ram'])
return render(request,'generated_elements.html',arguments)

The template

 <option value={{ ram_count }}>{{ ram_count }}</option>
<option value={{ max_ram }}>{{ max_ram }}</option>

this is view from page

This is javascript code to get data to element

    function ajax_method(parent_id,url,id_name){
      $.ajax({
        url: url,
        data: {
          'parent_id': parent_id,
          'target_element':id_name,
        },
        success: function (data) {
          $(id_name).html(data);
        }
      });

Any help will be appreciated

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!