DONE: As expected, I’ve gone down a Django rabbit hole Its really annoying as all I want to do is enable markdown and a media library to my site so I can record progress in other areas. Instead I’m finding myself needing to understand much more about how Django works via settings, and a lot more details about models and forms. I’ll give this one more week as it’s becoming an unwelcome distraction.
BLOCKERS: Django…and web front ends Last week at work handover.
GOALS: Get one markdown library working so I can start using my blog properly.
I am currently working on … my blog. Then LMPTHW, and some Python testing course to finish.
I am struggling with understanding … how to implement markdownx
I am finally understanding … Django’s mysite layer.
Hm… I’m curious, this sounds like a very common requirement. Isn’t there anybody who can help you with it? It’d be a shame if you decided to drop the blog just because you couldn’t get Markdown working! Keep going!
@florian I’ve not dropped it. Just getting deeper into the project than I hoped at present. I’ve got 5 other projects to dedicate my time too and Django was not one of them.
I have looked at Martor already and its exactly what I wanted to implement. I’d be happy with just the admin view implementation at this time but I just don’t get it. I followed the setup guide but I don’t really get the Usage part. I might have another go but if you are about on Riot at any point @io_io give me a shout and I might tap you up for some knowledge. Does this need JS/JQuery to work or is it pure python?
Edit: I’m making some progress… I got markdown working in Admin console. That’s step 1. Now to get it to render to the page. I read some SO pages about this…
Hey, not using Riot yet
Just make sure you add all you need in your settings.py.
Then in your posts model add that martor field like in the example, add it in your post’s form then in the admin.py. Then add it in your template.
Should work.
Do you use Slack? And if so, what mail address?
You just add {% load martortags %} above your post form, inside your edit post template,
then {{ form.as_p|safe_markdown }} which means you add a safe markdown filter.
Of course, replace form.as_p with whatever form you use in your edit post template. I just gave you an example of where you should add things.
Check this bit about filters: https://docs.djangoproject.com/en/3.0/ref/templates/builtins/#std:templatefilter-safe
mmm… seems fine, I wouldn’t mind it as long as it’s just me who sees it
Can you use markdown in the post?
And what happens if you click on that editor preview link?
Did you enable all configs in the settings? Jquery etc?
Yes, a TLS certificate.
I don’t know how “good” they are, saw recently @zedshaw being grumpy about them, so better ask him.
I am using Let’s encrypt cause it’s free. https://letsencrypt.org/
Mysql? Why not Postgres?
Because Postgres is an additional charge and I’m just using a cheap hacker account:
Rationale from Forum:
It’s because of the way we have the MySQL server vs the Postgres server setup.
For MySQL, it is multi-tenanted (ie. you are using the same MySQL server as other people who are just accessing the same server as different users), so sometimes you may suffer from a noisy neighbor etc.
We did not take this approach for Postgres (partly because we believe there is less good support for postgres multi-tenancy), and instead you get your own Postgres server running inside of your own docker container. This way, you can be the admin user (MySQL users won’t get admin rights and for example won’t be able to do db triggers) and do stuff like create your own users, enable plugins etc. (Although to be clear you still don’t get root / there may be stuff you can’t install etc on Postgres)
(and that basically makes Postgres way more resource hungry)
I’d prefer Postgres as have that running fine locally. But cannot justify the cost for a single user application at this time.
DONE: Some progress with C and Lisp.
I’ve also been experimenting with Flask, trying to wrap my head around how to build a simple backend for a blog site. Then came that other thread… about Python vs. JS and now…
GOALS: … I’ve decided to ditch Python and use JS with the frameworks that Zed suggested. What I read about the concepts behind Svelte and Sapper really seems super slick (even though I can’t say that I understand half of the technical stuff).
Next part of the journey! All that web stuff seems kind of intimidating… in contrast, with C, and even more so, Lisp, where I feel like I’m sitting in a quiet monastery high up in the mountains, pondering some obscure branch of math, undisturbed by the chaos of real creation that’s boiling in the lowlands…