Commit Graph

8 Commits

Author SHA1 Message Date
Kfir Hadas 87dd95f1e0 Refactor into an app factory [2 of 2] (#322)
* Replace all `from nyaa import app` imports with `app = flask.current_app` (or `from flask import current_app as app` where possible)
* Add a separate config object for top-level and class statements as `nyaa.extensions.config`
Required because those codes don't have app context at the time of evaluation/execution.
* Remove `routes.py` file and register all blueprints in `nyaa/__init__.py`
* Refactor `nyaa/__init__.py` into an app factory
* Update tools
* Update tests (temporary, will be replaced)
2017-08-01 21:02:08 +03:00
Kfir Hadas 0181d6cb33 Prepare for app factory [1 of 2] (#315)
* Move db, assets, debug toolbar and fix_paginate into nyaa.extensions
* Change all `from nyaa import db` imports to `from nyaa.extensions import db`
* Move `nyaa.torrents.create_magnet_from_es_info` context processor into template-utils blueprint
* Fix tools (wrap in `with app.app_context():` where needed)
2017-07-30 20:35:16 +03:00
TheAMM 79dae38f37 Patch db_migrate.py to always use the 'db' command
This means you can (have to) use the Flask-Migrate commands directly:
"./db_migrate.py stamp head" etc instead of "./db_migrate.py db stamp head"
2017-05-27 23:19:38 +03:00
TheAMM 1b3e05339d Update db_create.py to add categories for both Nyaa and Sukebei
Also includes a reminder to stamp the database version for Alembic.
2017-05-27 18:14:43 +03:00
nyaadev 152e547ac5 Add flask-Migrate + alembic for automated database migrations.
Update some dependencies to their latest version.
Make executable scripts executable (chmod +x).
2017-05-21 17:47:16 +02:00
Yara Naika b147cfeb81 Ghetto migrate solution, in case you re-run db_create, it won't add categories again 2017-05-13 23:51:29 -07:00
TheAMM 517d3e8e32 [templates, config] Add SITE_FLAVOR for selecting nyaa/sukebei, update templates
By default TABLE_PREFIX is derived from flavor.
Added back Date column, adjusted column widths
2017-05-13 02:41:52 +03:00
nyaadev 00d65e312c Initial commit. 2017-05-12 20:51:49 +02:00