title: Generating a CSRF token manually with Flask WTF-Forms
body: <p>I'd like to create and fill out a Flask WTF-Form using only python code.  However, the form doesn't automatically generate a CSRF token when I create it with python code.  Is there any way to do this manually?</p>
  
  <p>The form in question: </p>
  
  <pre><code>from flask_wtf import Form
  from wtforms import StringField
  from wtforms.validators import DataRequired, URL
  
  class URLForm(Form):
      url = StringField('url', validators=[DataRequired(), URL(), Level3Url()])
  </code></pre>
  
  <p>the code I use to generate the form:</p>
  
  <pre><code>from forms import URLForm
  form = URLForm()
  if 'url' in request.args:
      url = request.args.get('url')
      form.url.data = url
      if form.validate():
          ...
  </code></pre>