title: How to pass choices dynamically into a django form
body: <p>How can I set choices dynamically in my form ? These choices will change based on the route the user takes.</p>
  
  <p><strong>forms.py</strong></p>
  
  <pre><code>class RegistrationForm(forms.Form):
  
      options = ()
      camp_dates = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple,
                                           choices=options)
  </code></pre>
  
  <p>I would like to set the choices from my view.py file so that I can set these choices dynamically.</p>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>def camp_datailed_view(request,slug):
  
   options = (
      ("1", "Jan"),
      ("2", "Feb"),
      )
  
   form = RegistrationForm()
  
   ##How can I pass options into the form field camp_dates as selectable choices
  
  
  
  def register(request):
  
      form = RegistrationForm()
  
      if request.method == 'POST':
  
       # create a form instance and populate it with data from the request:
       form = RegistrationForm(request.POST)
  
       # check whether it's valid:
       if (form.is_valid()):
  
           return render(request,'camp_registration.html')
       else:
        print (form.errors)
  
        return HttpResponse("not working")``
  </code></pre>