LoginSignup
0
0

More than 3 years have passed since last update.

[Python] フォームで送信

Posted at

[Python]フォームで送信

<!DOCTYPE html>
<html lang="ja">
<html>
  <head>
    <meta charset="utf-8">
  </head>
  <body>
    <form action="{% url 'index' %}" method="post">
      {% csrf_token %}
      {{form}}
      <input type="submit" value="click">
    </form>
  </body>
</html>

action="{% url 'index' %}" method="post"でデータの送信先を指定している

{% csrf_token %}でCSRF対策をしている

{{form}}はフォームの具体的な内容が作成される

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0