title: Internal server error 500 after launching flask python
body: <p>I am following the tutorial: <a href="https://pythonhosted.org/Flask-SQLAlchemy/quickstart.html" rel="nofollow">https://pythonhosted.org/Flask-SQLAlchemy/quickstart.html</a> but something I am missing. I am using Pycharm 4.0.6 as interpreter. Almost everything is working but when I add db.session.commit() it saying me: Internal Server Error 500</p>
  
  <p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>
  
  <pre><code>from flask import Flask
  from flask.ext.sqlalchemy import SQLAlchemy
  app = Flask(__name__)
  
  app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
  db = SQLAlchemy(app)
  
  class User(db.Model):
      id = db.Column(db.Integer, primary_key=True)
      username = db.Column(db.String(80), unique=True)
      email = db.Column(db.String(120), unique=True)
  
      def __init__(self, username, email):
          self.username = username
          self.email = email
      def __repr__(self):
          return '&lt;User %r&gt;' % self.username
  
  @app.route('/')
  def hello_world():
      db.create_all()
      admin = User('admin', 'admin@example.com')
      guest = User('guest', 'guest@example.com')
      db.session.add(admin)
      db.session.add(guest)
      db.session.commit()
      return 'Hello World'
  
  
  
  if __name__ == '__main__':
      app.run()
  </code></pre>