title: MissingSchema: Invalid URL 'None': No schema supplied. Perhaps you meant http://None?
body: <p>views.py</p>
  
  <pre><code>from django.shortcuts import render
  from django.http import HttpResponse
  import random
  import hashlib
  import os
  import requests
  
  def index(request):
   """Displays the page that asks for the phone number"""
   return render(request, "verify/sms.html")
  
  def verify(request):
   """Displays the page that asks for the verification code"""
   # if the form wasn't submitted properly, then go to index page
   try:
      phoneNumber = request.POST['phonenumber']
   except:
      return render(request, "verify/sms.html")
  
   verificationCode = str(random.randint(1000000, 9999999))
  
  # the check sequence is sent to the next page to verify if the code entered is correct
   checkSequence = hashlib.sha1((verificationCode+str(os.environ.get("SEED"))).encode("utf-8")).hexdigest()
  
   sendVerificationCode(phoneNumber, verificationCode)
   return render(request, "verify/verification.html", {"code": checkSequence})
  
  def checkCode(request):
  """Checks if the verification code entered is correct"""
   try:
      verificationCode = request.GET['verification']
      correctCheckSequence = request.GET['code']
   except:
      return render(request, "verify/sms.html")
  
  # check the correct check sequence against the check sequence based on the verification code provided
   checkSequence = hashlib.sha1((verificationCode+str(os.environ.get("SEED"))).encode("utf-8")).hexdigest()
   if checkSequence == correctCheckSequence:
      return HttpResponse("1")
   else:
      return HttpResponse("0")
  
  def sendVerificationCode(phoneNumber, verificationCode):
  """Sends the verification code to the provided phone number using TILL API"""
   if len(phoneNumber) &lt; 10:
      return              # doesn't give the user an error message - just doesn't send the message
  
   TILL_URL = os.environ.get("TILL_URL")
  requests.post(TILL_URL, json={"phone":[phoneNumber], "text": "Verication code: " + str(verificationCode)})
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>from django.conf.urls import url, include
  from . import views
  
  urlpatterns = [
   url(r'^$', views.index, name="index"),
   url(r'^verify/$', views.verify, name="verify"),
   url(r'^checkCode/$', views.checkCode, name="checkCode")
  ]
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>from django.db import models
  </code></pre>
  
  <p>admin.py</p>
  
  <pre><code>from django.contrib import admin
  </code></pre>
  
  <p>apps.py</p>
  
  <pre><code>from django.apps import AppConfig
  
  
  class VerifyConfig(AppConfig):
   name = 'verify'
  </code></pre>
  
  <p>Creating a sms-validation app.Where a user enters his phone number and message is send to validate his number.</p>
  
  <p>Soon after asking his number and hitting enter it shows error.</p>
  
  <p>raise MissingSchema(error)
  MissingSchema: Invalid URL 'None': No schema supplied. Perhaps you meant <a href="http://None" rel="nofollow noreferrer">http://None</a>?</p>
  
  <p>Traceback</p>
  
  <pre><code>Internal Server Error: /verify/
  Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-
  packages/django/core/handlers/exception.py", line 41, in inner
  response = get_response(request)
  File "/usr/local/lib/python2.7/dist-
  packages/django/core/handlers/base.py", line 187, in _get_response
  response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python2.7/dist-
  packages/django/core/handlers/base.py", line 185, in _get_response
  response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/tushar/Downloads/sms-verify-master/verify/views.py", line 25, in verify
  sendVerificationCode(phoneNumber, verificationCode)
  File "/home/tushar/Downloads/sms-verify-master/verify/views.py", line 49, in sendVerificationCode
  requests.post(TILL_URL, json={"phone":[phoneNumber], "text": "Verication code: " + str(verificationCode)})
  File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 109, in post
  return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 50, in request
  response = session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 454, in request
  prep = self.prepare_request(req)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 388, in prepare_request
  hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 293, in prepare
  self.prepare_url(url, params)
  File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 353, in prepare_url
  raise MissingSchema(error)
  MissingSchema: Invalid URL 'None': No schema supplied. Perhaps you meant http://None?
  </code></pre>