Contact me to be added to this repository. Push the creations you make for D&D, and they will be displayed in a nice website. See the website for how to contribute.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
964 B

4 years ago
4 years ago
  1. import sys
  2. from flask import Flask
  3. from flask import render_template
  4. from flask import request
  5. from items import get_items
  6. from items import get_spells
  7. if sys.version_info.major < 3:
  8. # XXX OOF
  9. reload(sys)
  10. sys.setdefaultencoding('utf8')
  11. app = Flask(__name__)
  12. @app.route('/style.css')
  13. def style():
  14. return render_template('style.css')
  15. @app.route('/')
  16. def index():
  17. return render_template('index.html')
  18. @app.route('/items')
  19. def items():
  20. return render_template('items.html',title="Items",items=get_items("../Items/*"))
  21. @app.route('/places')
  22. def places():
  23. return render_template('items.html',title="Places",items=get_items("../Places/*"))
  24. @app.route('/characters')
  25. def characters():
  26. return render_template('items.html',title="Characters",items=get_items("../Characters/*"))
  27. @app.route('/spells')
  28. def spells():
  29. return render_template('spells.html',title="spells",spells=get_spells())
  30. if __name__ == "__main__":
  31. app.run()