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.

44 lines
1.1 KiB

import sys
from flask import Flask, render_template, request
from items import get_items
from random import choice
if sys.version_info.major < 3:
app = Flask(__name__)
def style():
return render_template('style.css')
def index():
featureType = choice(["Item","Place","Spell"])
item = choice(get_items("../"+featureType+"s/*"))
return render_template('index.html',featureType=featureType,featureText=item)
def items():
return render_template('listing.html',title="Items",items=get_items("../Items/*"))
def places():
return render_template('listing.html',title="Places",items=get_items("../Places/*"))
def characters():
return render_template('listing.html',title="Characters",items=get_items("../Characters/*"))
def spells():
return render_template('listing.html',title="Spells",items=get_items("../Spells/*"))
if __name__ == "__main__":