Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Inquiry Regarding Form Data Handling in Signup Template

Dear Metronic Support Team,

I have encountered a situation where I need your guidance to ensure the proper implementation of user authentication in my application.

I am using the signup form template provided in the Metronic theme, and I have successfully integrated it into my Django project. However, I am uncertain about how the form data is being handled, specifically when a user fills out the signup form.

The form in question is configured as follows:

<form class="form w-100" novalidate="novalidate" id="kt_sign_up_form" data-kt-redirect-url="/signin" action="#">
    <!-- Form fields go here -->
    <button type="submit" id="kt_sign_up_submit" class="btn btn-primary">
        Sign Up
    </button>
</form>

My primary concern is understanding the flow of data once the user submits the form. I am not sure if the data is meant to be sent to a specific Django view or if there is some JavaScript functionality provided by the Metronic theme that handles the form submission.

Here are my specific questions:

  1. Does the Metronic theme provide a JavaScript function to handle the signup form submission, or is it expected that the developer implements this functionality?

  2. If the form data is handled via JavaScript, could you provide guidance or point me to the relevant documentation on how to configure it to work with a Django backend?

  3. If the form data should be sent to a Django view, could you provide an example or best practices on how to set up the form action and handle the form submission in a Django view?

I would greatly appreciate your assistance in clarifying these points, as it will help me ensure that user data is being handled securely and efficiently in my application.

Thank you in advance for your time and support.

Best regards, Ali

Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi Ali,

The Metronic theme provides a JavaScript function to handle the signup form submission. In your views.py file, you can find the following line of code:

KTTheme.addJavascriptFile("js/custom/authentication/sign-up/general.js")


This JavaScript file is responsible for handling the simulation of form submission as demo.

If the form data is handled via JavaScript ajax, you can customize the behavior by modifying the general.js file located at the path /django/starterkit/_keenthemes/src/js/custom/authentication/sign-up/general.js. This file contains the JavaScript code that simulates the signup process.

You can remove the javascript file, if you want to handle the form data in a Django view, you can customize the form's action attribute to point to a Django view URL. For example:

<form class="form w-100" novalidate="novalidate"  data-kt-redirect-url="/signin" action="{% url "your_django_view_name" %}">


In this case, you would need to create a Django view that handles the form submission. You can access the form data in the Django view and process it as needed.

Remember that if you make modifications to the general.js file, you'll need to rebuild the assets using Gulp as described in the documentation .

I hope this helps clarify how form data is handled in the Metronic signup template in a Django project. If you have more specific questions or need further assistance, please feel free to ask.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(