mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
Fix some problems related to postgresql and models
This commit is contained in:
parent
b7ba8e43c4
commit
97132ce88a
6 changed files with 22 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
budget/budget.db
|
||||
budget/memory
|
||||
budget/settings.py
|
||||
*.pyc
|
||||
|
|
12
README.rst
12
README.rst
|
@ -12,10 +12,17 @@ To make it run, you just have to do something like::
|
|||
|
||||
$ virtualenv venv
|
||||
$ source venv/bin/activate
|
||||
$ pip install -r requirements.txt
|
||||
$ pip install -r budget/requirements.txt
|
||||
$ cd budget
|
||||
$ python run.py
|
||||
|
||||
It is also better to actually turn the debugging mode on when you're
|
||||
developing. You can create a `settings.py` file in the `budget` directory, with
|
||||
the following content::
|
||||
|
||||
DEBUG = True
|
||||
SQLACHEMY_ECHO = DEBUG
|
||||
|
||||
Deploy it
|
||||
=========
|
||||
|
||||
|
@ -33,6 +40,9 @@ To deploy it, I'm using gunicorn and supervisord::
|
|||
|
||||
Don't forget to set the right permission for your files !
|
||||
|
||||
Also, create a `settings.py` file with the appropriate values if you need to
|
||||
use a different database for instance.
|
||||
|
||||
How to contribute
|
||||
=================
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
DEBUG = True
|
||||
DEBUG = False
|
||||
SQLALCHEMY_DATABASE_URI = 'sqlite:///budget.db'
|
||||
SQLACHEMY_ECHO = DEBUG
|
||||
SECRET_KEY = "tralala"
|
||||
|
||||
DEFAULT_MAIL_SENDER = ("Budget manager", "budget@notmyidea.org")
|
||||
|
||||
try:
|
||||
from settings import *
|
||||
except ImportError:
|
||||
pass
|
||||
|
|
|
@ -92,7 +92,7 @@ class Person(db.Model):
|
|||
_to_serialize = ("id", "name", "activated")
|
||||
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
project_id = db.Column(db.Integer, db.ForeignKey("project.id"))
|
||||
project_id = db.Column(db.String, db.ForeignKey("project.id"))
|
||||
bills = db.relationship("Bill", backref="payer")
|
||||
|
||||
name = db.Column(db.UnicodeText)
|
||||
|
@ -163,7 +163,7 @@ class Bill(db.Model):
|
|||
|
||||
class Archive(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
project_id = db.Column(db.Integer, db.ForeignKey("project.id"))
|
||||
project_id = db.Column(db.String, db.ForeignKey("project.id"))
|
||||
name = db.Column(db.UnicodeText)
|
||||
|
||||
@property
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
from web import main, db, mail
|
||||
from api import api
|
||||
import os
|
||||
|
||||
from flask import *
|
||||
|
||||
app = Flask(__name__)
|
||||
app.config.from_object("default_settings")
|
||||
|
||||
app.register_blueprint(main)
|
||||
app.register_blueprint(api)
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
flask
|
||||
flask-wtf
|
||||
flask-sqlalchemy
|
||||
flask-mail
|
Loading…
Reference in a new issue