title: Flask-SLAlchemy session.add() and session.commit() don't work
body: <p>I have a heroku app that I am trying to add a database to. I am using Flask-SLAlchemy, PostgreSQL (and psql). I've already created a table in the database, but I cannot add any rows to it. Here is what I believe to be all relevant code:</p>
  
  <pre><code>import flask
  import keys
  import requests_oauthlib
  import json
  import os
  import psycopg2
  import urlparse
  from flask import (Flask, jsonify, render_template, redirect, url_for, request, make_response)
  from flask.ext.sqlalchemy import SQLAlchemy
  
  app = Flask(__name__)
  app.config['SQLALCHEMY_DATABASE_URI'] = 'heroku-url-here'
  db = SQLAlchemy(app)
  
  class Page (db.Model):
      __tablename__ = "pages"
      title = db.Column('Title', db.String)
      date = db.Column('Date', db.String, primary_key=True)
      writing = db.Column('Writing', db.String)
  
      def __init__(self, title, date, writing):
          self.title = title
          self.date = date
          self.writing = writing
  
      def __repr__(self):
          return '&lt;Page %r&gt;' % self.date
  
  
  app.secret_key = keys.secret_key
  # db.create_all()
  # this created the database already after I ran it once, it made a psycopg2 error after that first time.
  
  @app.route('/db', methods=['GET', 'POST'])
  def db():
      if request.method == 'POST':
          title = request.form['title']
          date = request.form['date']
          writing = request.form['writing']
          newest = Page(title, date, writing)
          print newest
          db.session.add(newest)
          db.session.commit()
      else:
          title = None
          date = None
          writing = None
      return flask.redirect(flask.url_for('home'))
  </code></pre>
  
  <p>In my heroku logs, there are no errors shown. The code runs to the the print newest line, and the newly created Page is printed as <code>&lt;Page u'whatever-the-date-was'&gt;</code>. When a form is submitted in my html template, it calls the function by using the action <code>{{url_for('db')}}</code>.</p>
  
  <p>This is my first time using heroku and flask and basically doing any back-end stuff, so please explain thoroughly if you have an answer. Thanks in advance!</p>