title: Set flask route defaults from current app config
body: <p>I want to get the route args default value from current flask application config but I got this error.</p>
  
  <pre><code>Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 473, in spawn_worker
      worker.init_process()
    File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 100, in init_process
      self.wsgi = self.app.wsgi()
    File "/usr/lib/python2.7/dist-packages/gunicorn/app/base.py", line 115, in wsgi
      self.callable = self.load()
    File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 33, in load
      return util.import_app(self.app_uri)
    File "/usr/lib/python2.7/dist-packages/gunicorn/util.py", line 362, in import_app
      __import__(module)
    File "/home/hamid/projects/bfl/develop.py", line 4, in &lt;module&gt;
      application = create_app(DevelopmentConfig)
    File "/home/hamid/projects/bfl/project/application.py", line 56, in create_app
      configure_blueprints(app)
    File "/home/hamid/projects/bfl/project/application.py", line 97, in configure_blueprints
      bp = __import__('project.apps.%s' % blueprint_name, fromlist=['views'])
    File "/home/hamid/projects/bfl/project/apps/store/views/__init__.py", line 6, in &lt;module&gt;
      from .store import *
    File "/home/hamid/projects/bfl/project/apps/store/views/store.py", line 193, in &lt;module&gt;
      @mod.route('/&lt;page&gt;/', defaults={'per_page': current_app.config['PAGE_SIZE']})
    File "/usr/local/lib/python2.7/dist-packages/werkzeug/local.py", line 338, in __getattr__
      return getattr(self._get_current_object(), name)
    File "/usr/local/lib/python2.7/dist-packages/werkzeug/local.py", line 297, in _get_current_object
      return self.__local()
    File "/usr/local/lib/python2.7/dist-packages/flask/globals.py", line 34, in _find_app
      raise RuntimeError('working outside of application context')
  RuntimeError: working outside of application context
  </code></pre>
  
  <p>And here is my sample code:</p>
  
  <pre><code>@mod.route('/&lt;page&gt;/', defaults={'per_page': current_app.config['PAGE_SIZE']})
  @mod.route('/&lt;per_page&gt;/&lt;page&gt;/')
  @login_required
  def index(per_page, page):
      pagination_obj = Pagination(Store.objects(is_dealer=False), per_page, page)
      return render('store/index.html', pagination=pagination_obj)
  </code></pre>
  
  <p>Any idea how can I get rout default values from current application config?</p>