We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
heroku ADAPTERS error
I'm looking to use Heroku for deployment of my web2py project. However, when I add 
`from gluon.contrib.heroku import get_db`
`db = get_db(name=None, pool_size=myconf.get('db.pool_size'))`

I get a ticket with the error:

> File "/Users/huangyu/dev/web2py/gluon/contrib/heroku.py", line 10, in <module>
    from pydal.adapters import ADAPTERS, PostgreSQLAdapter
ImportError: cannot import name ADAPTERS

It looks like web2py has moved on from using ADAPTERS? Has that been replaced by 
`@adapters.register_for('postgres')`

But the heroku file has not been updated. 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `gluon/contrib/heroku.py`
Content:
```
1 """
2 Usage: in web2py models/db.py
3 
4 from gluon.contrib.heroku import get_db
5 db = get_db()
6 
7 """
8 import os
9 from gluon import *
10 from pydal.adapters import ADAPTERS, PostgreSQLAdapter
11 from pydal.helpers.classes import UseDatabaseStoredFile
12 
13 class HerokuPostgresAdapter(UseDatabaseStoredFile,PostgreSQLAdapter):
14     drivers = ('psycopg2',)
15     uploads_in_blob = True
16 
17 ADAPTERS['postgres'] = HerokuPostgresAdapter
18 
19 def get_db(name = None, pool_size=10):
20     if not name:
21         names = [n for n in os.environ.keys()
22                  if n[:18]+n[-4:]=='HEROKU_POSTGRESQL__URL']
23         if names:
24             name = names[0]
25     if name:
26         db = DAL(os.environ[name], pool_size=pool_size)
27         current.session.connect(current.request, current.response, db=db)
28     else:
29         db = DAL('sqlite://heroku.test.sqlite')
30     return db
31
```
--- 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()

```

diff --git a/gluon/contrib/heroku.py b/gluon/contrib/heroku.py
--- a/gluon/contrib/heroku.py
+++ b/gluon/contrib/heroku.py
@@ -7,15 +7,13 @@
 """
 import os
 from gluon import *
-from pydal.adapters import ADAPTERS, PostgreSQLAdapter
-from pydal.helpers.classes import UseDatabaseStoredFile
+from pydal.adapters import adapters, PostgrePsyco
+from pydal.helpers.classes import DatabaseStoredFile
 
-class HerokuPostgresAdapter(UseDatabaseStoredFile,PostgreSQLAdapter):
-    drivers = ('psycopg2',)
+@adapters.register_for('postgres')
+class HerokuPostgresAdapter(DatabaseStoredFile, PostgrePsyco):
     uploads_in_blob = True
 
-ADAPTERS['postgres'] = HerokuPostgresAdapter
-
 def get_db(name = None, pool_size=10):
     if not name:
         names = [n for n in os.environ.keys()

{"golden_diff": "diff --git a/gluon/contrib/heroku.py b/gluon/contrib/heroku.py\n--- a/gluon/contrib/heroku.py\n+++ b/gluon/contrib/heroku.py\n@@ -7,15 +7,13 @@\n \"\"\"\n import os\n from gluon import *\n-from pydal.adapters import ADAPTERS, PostgreSQLAdapter\n-from pydal.helpers.classes import UseDatabaseStoredFile\n+from pydal.adapters import adapters, PostgrePsyco\n+from pydal.helpers.classes import DatabaseStoredFile\n \n-class HerokuPostgresAdapter(UseDatabaseStoredFile,PostgreSQLAdapter):\n-    drivers = ('psycopg2',)\n+@adapters.register_for('postgres')\n+class HerokuPostgresAdapter(DatabaseStoredFile, PostgrePsyco):\n     uploads_in_blob = True\n \n-ADAPTERS['postgres'] = HerokuPostgresAdapter\n-\n def get_db(name = None, pool_size=10):\n     if not name:\n         names = [n for n in os.environ.keys()\n", "issue": "heroku ADAPTERS error\nI'm looking to use Heroku for deployment of my web2py project. However, when I add \r\n`from gluon.contrib.heroku import get_db`\r\n`db = get_db(name=None, pool_size=myconf.get('db.pool_size'))`\r\n\r\nI get a ticket with the error:\r\n\r\n> File \"/Users/huangyu/dev/web2py/gluon/contrib/heroku.py\", line 10, in <module>\r\n    from pydal.adapters import ADAPTERS, PostgreSQLAdapter\r\nImportError: cannot import name ADAPTERS\r\n\r\nIt looks like web2py has moved on from using ADAPTERS? Has that been replaced by \r\n`@adapters.register_for('postgres')`\r\n\r\nBut the heroku file has not been updated. \n", "before_files": [{"content": "\"\"\"\nUsage: in web2py models/db.py\n\nfrom gluon.contrib.heroku import get_db\ndb = get_db()\n\n\"\"\"\nimport os\nfrom gluon import *\nfrom pydal.adapters import ADAPTERS, PostgreSQLAdapter\nfrom pydal.helpers.classes import UseDatabaseStoredFile\n\nclass HerokuPostgresAdapter(UseDatabaseStoredFile,PostgreSQLAdapter):\n    drivers = ('psycopg2',)\n    uploads_in_blob = True\n\nADAPTERS['postgres'] = HerokuPostgresAdapter\n\ndef get_db(name = None, pool_size=10):\n    if not name:\n        names = [n for n in os.environ.keys()\n                 if n[:18]+n[-4:]=='HEROKU_POSTGRESQL__URL']\n        if names:\n            name = names[0]\n    if name:\n        db = DAL(os.environ[name], pool_size=pool_size)\n        current.session.connect(current.request, current.response, db=db)\n    else:\n        db = DAL('sqlite://heroku.test.sqlite')\n    return db\n", "path": "gluon/contrib/heroku.py"}], "after_files": [{"content": "\"\"\"\nUsage: in web2py models/db.py\n\nfrom gluon.contrib.heroku import get_db\ndb = get_db()\n\n\"\"\"\nimport os\nfrom gluon import *\nfrom pydal.adapters import adapters, PostgrePsyco\nfrom pydal.helpers.classes import DatabaseStoredFile\n\n@adapters.register_for('postgres')\nclass HerokuPostgresAdapter(DatabaseStoredFile, PostgrePsyco):\n    uploads_in_blob = True\n\ndef get_db(name = None, pool_size=10):\n    if not name:\n        names = [n for n in os.environ.keys()\n                 if n[:18]+n[-4:]=='HEROKU_POSTGRESQL__URL']\n        if names:\n            name = names[0]\n    if name:\n        db = DAL(os.environ[name], pool_size=pool_size)\n        current.session.connect(current.request, current.response, db=db)\n    else:\n        db = DAL('sqlite://heroku.test.sqlite')\n    return db\n", "path": "gluon/contrib/heroku.py"}]}