prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Do not require cliquet master branch in dev
  As discussed with @Natim @almet 
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `kinto/config/__init__.py`
  Content:
  ```
  1 import os
  2 import binascii
  3 import codecs
  4 from kinto import logger
  5 
  6 HERE = os.path.abspath(os.path.dirname(__file__))
  7 
  8 
  9 def render_template(template, destination, **kwargs):
  10     template = os.path.join(HERE, template)
  11     folder = os.path.dirname(destination)
  12 
  13     if not os.path.exists(folder):
  14         os.makedirs(folder)
  15 
  16     logger.info("Created config {}".format(os.path.abspath(destination)))
  17 
  18     with codecs.open(template, 'r', encoding='utf-8') as f:
  19         raw_template = f.read()
  20         rendered = raw_template.format(**kwargs)
  21         with codecs.open(destination, 'w+', encoding='utf-8') as output:
  22             output.write(rendered)
  23 
  24 
  25 def init(config_file, backend):
  26     values = {}
  27     values['secret'] = binascii.b2a_hex(os.urandom(32))
  28 
  29     values['storage_backend'] = "cliquet.storage.%s" % backend
  30     values['cache_backend'] = "cliquet.cache.%s" % backend
  31     values['permission_backend'] = "cliquet.permission.%s" % backend
  32 
  33     if backend == 'postgresql':
  34         postgresql_url = "postgres://postgres:postgres@localhost/postgres"
  35         values['storage_url'] = postgresql_url
  36         values['cache_url'] = postgresql_url
  37         values['permission_url'] = postgresql_url
  38 
  39     elif backend == 'redis':
  40         redis_url = "redis://localhost:6379"
  41         values['storage_url'] = redis_url + "/1"
  42         values['cache_url'] = redis_url + "/2"
  43         values['permission_url'] = redis_url + "/3"
  44 
  45     else:
  46         values['storage_url'] = ''
  47         values['cache_url'] = ''
  48         values['permission_url'] = ''
  49 
  50     render_template("kinto.tpl", config_file, **values)
  51
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/kinto/config/__init__.py b/kinto/config/__init__.py
  --- a/kinto/config/__init__.py
  +++ b/kinto/config/__init__.py
  @@ -1,6 +1,8 @@
   import os
  -import binascii
   import codecs
  +
  +from cliquet import utils as cliquet_utils
  +
   from kinto import logger
   
   HERE = os.path.abspath(os.path.dirname(__file__))
  @@ -24,7 +26,8 @@
   
   def init(config_file, backend):
       values = {}
  -    values['secret'] = binascii.b2a_hex(os.urandom(32))
  +
  +    values['secret'] = cliquet_utils.random_bytes_hex(32)
   
       values['storage_backend'] = "cliquet.storage.%s" % backend
       values['cache_backend'] = "cliquet.cache.%s" % backend
  
verification_info: {"golden_diff": "diff --git a/kinto/config/__init__.py b/kinto/config/__init__.py\n--- a/kinto/config/__init__.py\n+++ b/kinto/config/__init__.py\n@@ -1,6 +1,8 @@\n import os\n-import binascii\n import codecs\n+\n+from cliquet import utils as cliquet_utils\n+\n from kinto import logger\n \n HERE = os.path.abspath(os.path.dirname(__file__))\n@@ -24,7 +26,8 @@\n \n def init(config_file, backend):\n     values = {}\n-    values['secret'] = binascii.b2a_hex(os.urandom(32))\n+\n+    values['secret'] = cliquet_utils.random_bytes_hex(32)\n \n     values['storage_backend'] = \"cliquet.storage.%s\" % backend\n     values['cache_backend'] = \"cliquet.cache.%s\" % backend\n", "issue": "Do not require cliquet master branch in dev\nAs discussed with @Natim @almet \n\n", "before_files": [{"content": "import os\nimport binascii\nimport codecs\nfrom kinto import logger\n\nHERE = os.path.abspath(os.path.dirname(__file__))\n\n\ndef render_template(template, destination, **kwargs):\n    template = os.path.join(HERE, template)\n    folder = os.path.dirname(destination)\n\n    if not os.path.exists(folder):\n        os.makedirs(folder)\n\n    logger.info(\"Created config {}\".format(os.path.abspath(destination)))\n\n    with codecs.open(template, 'r', encoding='utf-8') as f:\n        raw_template = f.read()\n        rendered = raw_template.format(**kwargs)\n        with codecs.open(destination, 'w+', encoding='utf-8') as output:\n            output.write(rendered)\n\n\ndef init(config_file, backend):\n    values = {}\n    values['secret'] = binascii.b2a_hex(os.urandom(32))\n\n    values['storage_backend'] = \"cliquet.storage.%s\" % backend\n    values['cache_backend'] = \"cliquet.cache.%s\" % backend\n    values['permission_backend'] = \"cliquet.permission.%s\" % backend\n\n    if backend == 'postgresql':\n        postgresql_url = \"postgres://postgres:postgres@localhost/postgres\"\n        values['storage_url'] = postgresql_url\n        values['cache_url'] = postgresql_url\n        values['permission_url'] = postgresql_url\n\n    elif backend == 'redis':\n        redis_url = \"redis://localhost:6379\"\n        values['storage_url'] = redis_url + \"/1\"\n        values['cache_url'] = redis_url + \"/2\"\n        values['permission_url'] = redis_url + \"/3\"\n\n    else:\n        values['storage_url'] = ''\n        values['cache_url'] = ''\n        values['permission_url'] = ''\n\n    render_template(\"kinto.tpl\", config_file, **values)\n", "path": "kinto/config/__init__.py"}], "after_files": [{"content": "import os\nimport codecs\n\nfrom cliquet import utils as cliquet_utils\n\nfrom kinto import logger\n\nHERE = os.path.abspath(os.path.dirname(__file__))\n\n\ndef render_template(template, destination, **kwargs):\n    template = os.path.join(HERE, template)\n    folder = os.path.dirname(destination)\n\n    if not os.path.exists(folder):\n        os.makedirs(folder)\n\n    logger.info(\"Created config {}\".format(os.path.abspath(destination)))\n\n    with codecs.open(template, 'r', encoding='utf-8') as f:\n        raw_template = f.read()\n        rendered = raw_template.format(**kwargs)\n        with codecs.open(destination, 'w+', encoding='utf-8') as output:\n            output.write(rendered)\n\n\ndef init(config_file, backend):\n    values = {}\n\n    values['secret'] = cliquet_utils.random_bytes_hex(32)\n\n    values['storage_backend'] = \"cliquet.storage.%s\" % backend\n    values['cache_backend'] = \"cliquet.cache.%s\" % backend\n    values['permission_backend'] = \"cliquet.permission.%s\" % backend\n\n    if backend == 'postgresql':\n        postgresql_url = \"postgres://postgres:postgres@localhost/postgres\"\n        values['storage_url'] = postgresql_url\n        values['cache_url'] = postgresql_url\n        values['permission_url'] = postgresql_url\n\n    elif backend == 'redis':\n        redis_url = \"redis://localhost:6379\"\n        values['storage_url'] = redis_url + \"/1\"\n        values['cache_url'] = redis_url + \"/2\"\n        values['permission_url'] = redis_url + \"/3\"\n\n    else:\n        values['storage_url'] = ''\n        values['cache_url'] = ''\n        values['permission_url'] = ''\n\n    render_template(\"kinto.tpl\", config_file, **values)\n", "path": "kinto/config/__init__.py"}]}