Error while Connecting using a Database URL
Could it have something to do with your connect statement?

    db = connect(os.environ.get('DATABASE_URL' or 'sqlite:///notes.db'))

Should be:

    db = connect(os.environ.get('DATABASE_URL') or 'sqlite:///notes.db') @CorverDevelopment has it.
app.py
```
app = Flask(__name__)
bootstrap = Bootstrap(app)

def setup_db():
    create_model_tables([User, Notepad], fail_silently=True)

if __name__ == '__main__':
    setup_db()
    app.secret_key = 'super_secret_key'
    app.run(debug=True)
```


Model.py
```
import os

from peewee import Model, CharField, SqliteDatabase, CharField, ForeignKeyField, IntegrityError
from playhouse.db_url import connect

db = connect(os.environ.get('DATABASE_URL' or 'sqlite:///notes.db'))


class BaseModel(Model):
    class Meta:
        database = db


class User(BaseModel):
    ....


class Notepad(BaseModel):
    ....

```

Error

```
Traceback (most recent call last):
  File "app.py", line 1, in <module>
    from model import User, Notepad
  File "/Users/rahul/projects/personal/Online-Notes/model.py", line 33, in <module>
    db = connect(os.environ.get('DATABASE_URL' or 'sqlite:///notes.db'))
  File "/Users/rahul/.virtualenvs/Online-Notes/lib/python2.7/site-packages/playhouse/db_url.py", line 84, in connect
    parsed = urlparse(url)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urlparse.py", line 143, in urlparse
    tuple = urlsplit(url, scheme, allow_fragments)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urlparse.py", line 182, in urlsplit
    i = url.find(':')
AttributeError: 'NoneType' object has no attribute 'find'
```