hacking upload + generation
This commit is contained in:
parent
2a81116db6
commit
98e0a930cf
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
||||
default: run
|
||||
|
||||
run:
|
||||
@mkdir -p metadatum generated && \
|
||||
@mkdir -p metadatum static/generated && \
|
||||
FLASK_ENV=development FLASK_APP=app flask run
|
||||
|
5
app.py
5
app.py
@ -50,11 +50,12 @@ def upload():
|
||||
metadata_fpath = os.path.join(CWD, "metadatum", filename)
|
||||
f.save(metadata_fpath)
|
||||
|
||||
pdf = os.path.join(CWD, "generated", "test.pdf")
|
||||
pdf = os.path.join(CWD, "static", "generated", "{}.pdf".format(filename))
|
||||
metadata = "sqlite:///{}".format(os.path.join(CWD, "metadatum", filename))
|
||||
make_cards(
|
||||
pdf, metadata, ["title", "timestamp", "comments", "authors"], ["tags"]
|
||||
)
|
||||
return render_template("index.html", upload_form=upload_form, pdf=pdf)
|
||||
pdf_url = url_for("static", filename="generated/{}.pdf".format(filename))
|
||||
return render_template("index.html", upload_form=upload_form, pdf=pdf_url)
|
||||
|
||||
return render_template("index.html", upload_form=upload_form)
|
||||
|
@ -41,9 +41,9 @@
|
||||
|
||||
</form>
|
||||
|
||||
{% if pdf %}
|
||||
<p> FOOOO </p>
|
||||
{% endif %}
|
||||
<object data="{{ pdf }}" type="application/pdf">
|
||||
<iframe src="{{ pdf }}"></iframe>
|
||||
</object>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user