Skip to content

Commit

Permalink
Fixed manage.py
Browse files Browse the repository at this point in the history
  • Loading branch information
viatsko committed Aug 28, 2016
1 parent 564115a commit aac5187
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 8 deletions.
7 changes: 6 additions & 1 deletion README.md
Expand Up @@ -20,8 +20,13 @@ Boilerplate application for a Flask JWT Backend and a React/Redux Front-End with
```sh
$ export DATABASE_URL="postgresql://localhost/yourdb"
$ python manage.py create_db
$ python manage.py db init
$ python manage.py db upgrade
$ python manage.py db migrate
```

To update database after creating new migrations, use:

```sh
$ python manage.py db upgrade
```

Expand Down
4 changes: 2 additions & 2 deletions application/app.py
@@ -1,8 +1,8 @@
from flask import request, render_template, jsonify, url_for, redirect, g
from models import User
from .models import User
from index import app, db
from sqlalchemy.exc import IntegrityError
from utils.auth import generate_token, requires_auth, verify_token
from .utils.auth import generate_token, requires_auth, verify_token


@app.route('/', methods=['GET'])
Expand Down
1 change: 1 addition & 0 deletions config.py
Expand Up @@ -7,6 +7,7 @@ class BaseConfig(object):
SECRET_KEY = "SO_SECURE"
DEBUG = True
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SQLALCHEMY_TRACK_MODIFICATIONS = True


class TestingConfig(object):
Expand Down
4 changes: 2 additions & 2 deletions index.py
@@ -1,7 +1,7 @@
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask_sqlalchemy import SQLAlchemy
from config import BaseConfig
from flask.ext.bcrypt import Bcrypt
from flask_bcrypt import Bcrypt

app = Flask(__name__, static_folder="./static/dist", template_folder="./static")
app.config.from_object(BaseConfig)
Expand Down
4 changes: 2 additions & 2 deletions manage.py
@@ -1,5 +1,5 @@
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand

from application.app import app, db

Expand Down
26 changes: 26 additions & 0 deletions migrations/versions/ed657e16ce20_.py
@@ -0,0 +1,26 @@
"""empty message
Revision ID: ed657e16ce20
Revises: 41c073a46b63
Create Date: 2016-08-28 11:50:20.973452
"""

# revision identifiers, used by Alembic.
revision = 'ed657e16ce20'
down_revision = '41c073a46b63'

from alembic import op
import sqlalchemy as sa


def upgrade():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###


def downgrade():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
2 changes: 1 addition & 1 deletion testing_config.py
@@ -1,4 +1,4 @@
from flask.ext.testing import TestCase
from flask_testing import TestCase
from application.app import app, db
from application.models import User
import os
Expand Down

0 comments on commit aac5187

Please sign in to comment.