diff --git a/.gitignore b/.gitignore index 9193cfb..a1e953a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ *.pyc __pycache__/ -config/ -data/ venv/ + +config/* +data/* + +!config/config.yml.sample diff --git a/README.md b/README.md index 3f18342..c7f5100 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,15 @@ Guide ### Setup + cp config.yml.sample config.yml + vim config.yml ... -### Run +### Test + + ./app.py + # go to http://localhost:8080 + +### Deploy ... diff --git a/app.py b/app.py index 17f6422..c05872e 100755 --- a/app.py +++ b/app.py @@ -6,7 +6,7 @@ from pathlib import Path from flask import Flask, g from flask_mako import MakoTemplates, render_template -from calefaction import __version__ as version +import calefaction from calefaction.config import Config from calefaction.eve import EVE from calefaction.util import catch_errors, set_up_hash_versioning @@ -23,7 +23,7 @@ set_up_hash_versioning(app) def prepare_request(): g.config = config g.eve = eve - g.version = version + g.version = calefaction.__version__ @app.route("/") @catch_errors(app) diff --git a/config/config.yml.sample b/config/config.yml.sample new file mode 100644 index 0000000..2eb0ec1 --- /dev/null +++ b/config/config.yml.sample @@ -0,0 +1,22 @@ +# This is a sample config file for Calefaction. +# Copy this to config.yml and modify it to set up your website. + +corp: + # Find your corp's ID at, e.g., https://zkillboard.com/corporation/917701062/ + id: 123456789 + # Full corp name (doesn't need to match in-game name exactly, but should) + name: My Corp Name Here + +welcome: |- + (If you are seeing this message on the public internet, someone forgot to + configure their website. Whoops!) + + This message is displayed to anyone who reaches your website without + (or before) logging in. + + It's public, so don't give away any secrets. You might want to explain a bit + about your corp, with recruitment information, or invite corp members to log + in, or maybe just say something cryptic. + + You can type raw HTML in here. Newlines are ignored, except for double + linebreaks, which are treated as separate paragraphs. diff --git a/templates/_base.mako b/templates/_base.mako index 6d939fd..c671c4f 100644 --- a/templates/_base.mako +++ b/templates/_base.mako @@ -1,12 +1,9 @@ -<%! - from datetime import datetime -%>\