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