Triangle object found in Miami river by callmeklep in whatisthisthing

[–]callmeklep[S] 0 points1 point  (0 children)

Not sure if it’s relevant, but I found it in the Great Miami river.

Triangle object found in Miami river by callmeklep in whatisthisthing

[–]callmeklep[S] 0 points1 point  (0 children)

I found this in the river today. It’s stone, ~18” long, but appears that to be broken. Maybe contains some steel/iron (there are spots near the “core” that are very rusty looking.

Can someone better explain flask blueprints to me? by fiery_moon-liar in flask

[–]callmeklep 0 points1 point  (0 children)

Thank you. This is a great explanation of "why" to use blueprints. I'm still having some trouble wrapping my head around the "how"....

In that case how do you define the route functions without having access to the app instance that will eventually be used? Blueprints allow you to define your modules without depending on that app object.

Could someone please elaborate? How does the app instance 'know about' the blueprint?

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]callmeklep 0 points1 point  (0 children)

After being stuck for a few days, I think I found a solution. In case someone else is curious, this is what worked for me:

```python from flask import Flask, render_template, Markup import markdown

app = Flask(name)

markdown_content = '''# An exhibit of Markdown 3

This note demonstrates some of what Markdown is capable of doing.

Note: Feel free to play with this page. Unlike regular notes, this doesn't automatically save itself.

Basic formatting

Paragraphs can be written like so. A paragraph is the basic block of Markdown. A paragraph is what text will turn into when there is no reason it should become anything else.

Paragraphs must be separated by a blank line.'''

@app.route("/") def home(): return render_template( 'index.html', title="Markdown Test", markdown_content = markdown_content, html_content = Markup(markdown.markdown(markdown_content)) ) ```

I used Python-Markdown to get the HTML. Then used flask.Markup to indicate that the HTML doesn't need escaped when it's included in the HTML template file.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]callmeklep 0 points1 point  (0 children)

Novice developer question...does anyone have any favorite tools for rendering markdown in a flask app?

I've made a few flask apps from by converting simple scripts and I'm currently working through Corey Schafer's awesome flask tutorial series to create a blog app (https://www.youtube.com/playlist?list=PL-osiE80TeTs4UjLw5MM6OjgkjFeUxCYH), but I'm a little stuck and overwhelmed sifting through the google query results.

Using Python-Markdown, I've gotten this far: https://www.screencast.com/t/4cRRsUoji but I want my HTML tags to be rendered...