title: SQLAlchemy: 'NoneType' object has no attribute 'drivername'
body: <p>I'm trying to connect my flask application to my local MySQL database for testing. I've made a flask object and a class to represent an example table to be created after a successful connection.</p>
  <p>These are my local env vars for my project:</p>
  <pre><code>#.env
  LOCAL_MYSQL_URL = mysql://Username:somePassword@127.0.0.1:3306/database_name
  </code></pre>
  <p>This is my project_name <code>__init__</code> file:</p>
  <pre><code>#__init__.py
  from flask import Flask
  from flask_sqlalchemy import SQLAlchemy
  import os
  
  ON_HEROKU = 'ON_HEROKU' in os.environ
  
  if ON_HEROKU:
      DB_URL = os.environ.get('CLEARDB_DATABASE_URL')
  else:
      DB_URL = os.environ.get('LOCAL_MYSQL_URL')
  
  app = Flask(__name__)
  app.config['SQLALCHEMY_DATABASE_URI'] = DB_URL
  app.config['SECRET_KEY'] = os.environ.get('SECRET_KEY')
  
  db = SQLAlchemy(app)  
  db.create_all()
  db.session.commit()
  </code></pre>
  <p>However I get the following error after running the app:</p>
  <pre><code>  if sa_url.drivername.startswith('mysql'):
  AttributeError: 'NoneType' object has no attribute 'drivername'
  </code></pre>
  <p>I am trying to make this work following tutorials and answers contributed here on stackoverlow to similar questions, but none of them helped me out so far.</p>
  <p>What am I missing here? What's wrong with my mysql driver name?</p>