title: Django + Twilio 500 Error (Session issue?)
body: <p>I forked this Tutorial <a href="https://github.com/TwilioDevEd/automated-survey-django" rel="nofollow noreferrer">https://github.com/TwilioDevEd/automated-survey-django</a> and am trying to get it to run locally. The current behavior is that, I send a text to the Twilio number and then it correctly texts me the first question of the survey. However, then when I text back, I don't get a response (should be the 2nd question of the survey) and I see a 500 error in Django. I can see that the second text message is being received by Django and, from the following function, it prints HELLO. However, it doesn't make it to YEP, so it appears to be erroring on <code>answering_question = request.session.get('answering_question_id')</code>, which seems like it is a problem with the session. I can see that there is a new session in the Django_session table created from my first text. I'm stuck on what is going wrong. request.session['answering_question_id'] is being set elsewhere in the code, but, my understanding, is if wasn't set, then <code>answering_question</code> would just be <code>false</code>, not an error. I'm stuck - any thoughts?</p>
  <pre><code>def redirects_twilio_request_to_proper_endpoint(request):
      print(&quot;HELLO&quot;)
      answering_question = request.session.get('answering_question_id')
      print(&quot;YEP&quot;)
      if not answering_question:
          print('1')
          first_survey = Survey.objects.first()
          redirect_url = reverse('survey',
          kwargs={'survey_id': first_survey.id})
     else:
         print('2')
         question = Question.objects.get(id=answering_question)
         redirect_url = reverse('save_response',
         kwargs={'survey_id': question.survey.id,
                 'question_id': question.id})
  return HttpResponseRedirect(redirect_url)
  </code></pre>
  <p>Example error
  <code>[03/Jun/2022 03:34:36]&quot;GET /automated-survey/first-survey/?ToCountry=US&amp;ToState=CA&amp;SmsMessageSid=SM9f799005f09308ae910a7c5af722bf76&amp;NumMedia=0&amp;ToCity=LOS+ANGELES&amp;FromZip=95747&amp;SmsSid=SM9f799005f09308ae910a7c5af722bf76&amp;FromState=CA&amp;SmsStatus=received&amp;FromCity=ROSEVILLE&amp;Body=Pink&amp;FromCountry=US&amp;To=%2B17472454008&amp;ToZip=&amp;NumSegments=1&amp;ReferralNumMedia=0&amp;MessageSid=SM9f799005f09308ae910a7c5af722bf76&amp;AccountSid=ACef9b14863560f9a5b30961d21029d03c&amp;From=%2B19164327401&amp;ApiVersion=2010-04-01 HTTP/1.1&quot; 500 139520</code></p>