Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9168333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:36:09+00:00 2026-06-17T15:36:09+00:00

I started using the Django today, and tried building a html form the code

  • 0

I started using the Django today, and tried building a html form

the code for views.py is

def home(request): 
    t = get_template('home.html')
    html = t.render(Context({ "GetLabel": 'Welcome to the SPACE program.',
                              "GetInput": '',
                              "Next": './get_machine' }))
    return HttpResponse(html)     

def get_machine(request):
    t = get_template('home.html')
    html = t.render(Context({ "GetLabel": 'Enter the name of the machine: ',
                              "GetInput": '<input type="text" name="machine_name">',
                              "Next": './get_beamlines'}))
    return HttpResponse(html)

def get_beamlines(request):
    machine_name = request.POST["machine_name"] 
    Context({ "GetLabel": 'Machine already installed<br> Overwrite Existing file',
                  "GetInput": '<select name="check" >  <option value="Yes">Yes</option>    <option value="No">No</option> </select>',
                  "Next": './get_beamline' })
    t = get_template('home.html')
    html = t.render(Context({"GetLabel": 'Enter the number of beamlines: ',
                             "GetInput": '<input type="text" name="beamline_no"',
                             "Key":'Machine Name: ',
                             "Value": machine_name,
                             "Next": './get_beamline_name'}))
    return HttpResponse(html)

It goes like this; Now I don’t know how to proceed further to get the name of the beamlines(if more than 1)

I’m a novice to django, please correct me if I am wrong.

Is there any other better way of doing the same.

Note: finally, I want to write all the user inputs to an xml file.
I have done the same with the normal python program, by getting the user inputs form raw_imput()

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:36:10+00:00Added an answer on June 17, 2026 at 3:36 pm

    Some basics about forms are covered in tutorial, you might also want to use forms framework available within Django.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

today I've started using Form Wizard in django 1.4. The functionality seems to be
I have started using django very recently . I am building a service with
I just started using django-piston . Usually, in Django, when my views throw an
I just started using django for development. At the moment, I have the following
I have started using https://github.com/omab/django-social-auth and been successfully able to login via twitter, google
we have just started using a git account of our Django website project so
I am using the built in comment system with Django but it has started
I started using NetBeans today, and it was all going swimmingly, until I came
I've recently started using Ruby on Rails, after previously using Django for web development.
I have a blog written in Django, and I started using the basic Django

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.