title: Managing parameters of URL (Python Flask)
body: <p>I want some search feature in my website. In the output page, I am getting all the results in single page. However, I want to distribute it to many pages (i.e. 100 searches/page). For that, I am passing a number of default searches in "urlfor" but it isn't working. I know I am making a small error but I am not catching it.</p>
  
  <p>Here is my code below:</p>
  
  <pre><code>@app.route('/', methods=['GET', 'POST'])
  def doSearch():
      entries=None
      error=None
      if request.method=='POST':
          if request.form['labelname']:
              return redirect(url_for('show_results',results1='0-100', labelname=request.form['labelname'] ))
          else:
              error='Please enter any label to do search'
      return render_template('index.html',entries=entries, error=error)
  
  
  
  
  @app.route('/my_search/&lt;labelname&gt;')
  def show_results(labelname=None, resultcount=None, results1=None):
      if not session.get('user_id'):
          flash('You need to log-in to do any search!')
          return redirect(url_for('login'))
  
      else:
          time1=time()
          if resultcount is None:
              total_count=g.db.execute(query_builder_count(tablename='my_data',nametomatch=labelname, isextension=True)).fetchall()[0][0]
  
          limit_factor=" limit %s ,%s"%(results1.split('-')[0],results1.split('-')[1])
  
          nk1=g.db.execute(query_builder(tablename='my_data',nametomatch=labelname, isextension=True) + limit_factor)
          time2=time()
          entries=[]
          maxx_count=None
          for rows in nk1:
              if maxx_count is None:
                  maxx_count=int(rows[0])
              entries.append({"xmlname":rows[1],'xmlid':rows[2],"labeltext":rows[12]})
          return render_template('output.html', labelname=labelname,entries=entries, resultcount=total_count, time1=time2-time1, current_output=len(entries))
  </code></pre>
  
  <p>Here I want output on the URL like "<code>http://127.0.0.1:5000/my_search/assets?results1=0-100</code>"
  Also, if I edit the url address in browser like I want the next 100 result I can get it on "<code>http://127.0.0.1:5000/my_search/assets?results1=100-100</code>"</p>
  
  <p>Note: here I am using sqlite as backend; so I will use "<code>limit_factor</code>" in my queries to limit my results. And "<code>query_builder</code>" and "<code>query_builder_count</code>" are just simple functions that are generating complex sql queries.</p>
  
  <p>but the error I am getting is "NoneType" can't have split. It stopped at <code>"limit_factor"</code>. </p>
  
  <p>Here limit factor is just one filter that I have applied; but I want to apply more filters, for example i want to search by its location "<code>http://127.0.0.1:5000/my_search/assets?results1=0-100&amp;location=asia</code>"</p>