Skip to content

Commit

Permalink
Use the same setup as tribble-tracker
Browse files Browse the repository at this point in the history
Change-Id: Iac53e99e6800133b638616b164dec76f73fc684a
  • Loading branch information
zifnab06 committed Jan 8, 2017
1 parent 0d8cac1 commit 1f998d6
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 24 deletions.
3 changes: 1 addition & 2 deletions .gitignore
@@ -1,8 +1,7 @@
*.pyc
__pycache__

config.json
local_config.py
app.cfg

#virtualenv
bin
Expand Down
5 changes: 5 additions & 0 deletions app.cfg.example
@@ -0,0 +1,5 @@
MONGODB_DB = 'descent'
MONGODB_USERNAME = 'into'
MONGODB_PASSWORD = 'madness'
MONGODB_HOST = 'with'
MONGODB_PORT = 'kittens'
22 changes: 6 additions & 16 deletions app.py
@@ -1,28 +1,18 @@
#!/usr/bin/python3
from database import Rom

from flask import Flask
from flask_mongoengine import MongoEngine

import datetime
import json
import local_config
import os
import sys

from classes import *
from flask import *
from mongoengine import *

app = Flask(__name__)
app.config.from_object(local_config)

configfile = "config.json"

if not os.path.isfile(configfile):
print("Could not find " + configfile + " aborting!")
sys.exit()

with open(configfile) as config_file:
config = json.load(config_file)
app.config.from_pyfile('app.cfg')

connect('lineage_updater', host=config['dbhost'])
db = MongoEngine(app)

@app.route("/api/<string:apiversion>/<string:device>/<string:romtype>")
def index(apiversion, device, romtype):
Expand Down
4 changes: 0 additions & 4 deletions config.json.example

This file was deleted.

File renamed without changes.
2 changes: 0 additions & 2 deletions local_config.py.example

This file was deleted.

4 changes: 4 additions & 0 deletions requirements.txt
@@ -1,9 +1,13 @@
click==6.7
Flask==0.12
flask-mongoengine==0.8.2
Flask-WTF==0.14
itsdangerous==0.24
Jinja2==2.9.1
MarkupSafe==0.23
mongoengine==0.11.0
pkg-resources==0.0.0
pymongo==3.4.0
six==1.10.0
Werkzeug==0.11.15
WTForms==2.1

0 comments on commit 1f998d6

Please sign in to comment.