Django Markdown Tutorial - A Simple Blog Example | Django/Python Project

Поделиться
HTML-код
  • Опубликовано: 16 сен 2024
  • Learn how to use Markdown in your Django blog posts or other places on your website.
    In this tutorial, I build a very simple blog where I make it possible to use Markdown in the blog post content.
    Markdown is a way to write readable content that can be converted to HTML and similar.
    In this Django tutorial, I will use a Python package called "markdown" to do the magic for us. This Python package will convert Markdown to HTML.
    To show the HTML safely in our blog, we use a Django filter called "safe".
    ---
    Important links
    GitHub: github.com/Ste...
    Discord: / discord
    Patreon: / codewithstein
    Twitter: / codewithstein
    Website: codewithstein.com
    ---
    #codewithstein #django #python #markdown #blog #learndjango

Комментарии • 62

  • @mypegionworld7612
    @mypegionworld7612 3 года назад +1

    Your channel is a goldmine and since i am not at the level of being a patreon supporter... I just watch all the RUclips ad's and leave a like... Thanks Stein.. You are awesome.❤️

    • @CodeWithStein
      @CodeWithStein  3 года назад +1

      Thanks 😁😁 watching ads and liking videos is great 😁 RUclips loves when people do this, so it is good for my channels growth 👍🏻

    • @rvft
      @rvft 2 года назад

      Same here bro, this man is a legend. No bullsh, no minutes long self promotions, no time waste. Just straightforward coding. Thank you so much, Stein!

    • @CodeWithStein
      @CodeWithStein  2 года назад +1

      Thanks 😁😁

  • @mon-ou5el
    @mon-ou5el Год назад +1

    your tutorial is amazing and quite quick to start!

  • @sh.shomuratov9176
    @sh.shomuratov9176 2 года назад +3

    Excellent tutorials. I am newbie Django learner. Thank you for making this tut!

    • @CodeWithStein
      @CodeWithStein  2 года назад +1

      Thank you so much! I'm glad you liked it :-D

  • @jimmysindia
    @jimmysindia 2 года назад +1

    Thank You stein

  • @sadegh9614
    @sadegh9614 2 года назад +1

    The training was very smooth and excellent
    Thank you, good luck

  • @beatrizgomes8077
    @beatrizgomes8077 2 года назад +1

    Thank you so much, you explain so well

  • @sshbk5878
    @sshbk5878 2 года назад +1

    Thank you, so much! Now it is super easy for me to implement it!

  • @мишаконстантинов-в4д

    I was looking for that lots of time

  • @ReanimatorVG
    @ReanimatorVG Год назад +1

    Thank you!

  • @tdye
    @tdye 3 года назад

    I was just looking for something like this!

  • @rangabharath4253
    @rangabharath4253 3 года назад +1

    Awesome thank you 😊

  • @NotoriousArnav
    @NotoriousArnav 2 года назад +1

    ahhhhh.......Hats off to You! I got it all in my mind In One video, but I have a question and that is how to enable syntax highlighting on the code block that is shown in the frontend, and also another question that from the frontend can we import a library like such for syntax highlighting, or should we do it from backend

    • @CodeWithStein
      @CodeWithStein  2 года назад

      Hi, Thanks 😁 there are several libraries for this using javascript and Css. Not 100% sure of the names, but try to Google markdown code block highligth or similar ☺️

  • @Ryokans
    @Ryokans Год назад +1

    Thanks bro. Tried using regular expressions for the conversion, but it was way too complicated.

  • @dacadev
    @dacadev 3 года назад

    Men thanks, excelent video!!

  • @ignvqm
    @ignvqm 3 года назад

    Thanks a lot :D

  • @pantheonCaspian
    @pantheonCaspian 2 дня назад

    i am unable to insert images with this method between my text on the website. A lot of markdown features are also not working. Someone please help.

  • @KrspyKrmMcDs
    @KrspyKrmMcDs Год назад +1

    Thanks for the tutorial. I set my blog up basically the same way, but I have an issue that I can't resolve. My first code block works great, I'm using codehilite and all the coloring and stuff looks good. The second code block and any subsequent blocks aren't being stylized and some characters have red err squares around them, and when I look at the inspector tools, those characters have around them. ex. # for a comment. I'm assuming there is some syntax error either in the first code block or something in the HTML.

    • @CodeWithStein
      @CodeWithStein  Год назад

      Hmm that is weird :/ have you checked my code on GitHub to see if you have any typos?

    • @KrspyKrmMcDs
      @KrspyKrmMcDs Год назад +1

      @@CodeWithStein I'm not sure what the issue was. I gave up on it and tried django-summernote. I was able to get the results I wanted with it. I appreciate the response!

    • @CodeWithStein
      @CodeWithStein  Год назад

      Great ☺️

  • @srikarkandula5313
    @srikarkandula5313 3 года назад

    Great video

  • @EpoKeins
    @EpoKeins 2 года назад +1

    Great!
    That's exactly what I was searching for!
    Is it possible to create the blog posts by uploading markdown files to the django project (as static files?) which will be converted to html on `collectstatic` - to be displayed in HTML on the final blog page?
    This would give me the opportunity to write blog posts in markdown, just upload the files and download them them as needed if I want to edit something.

    • @CodeWithStein
      @CodeWithStein  2 года назад

      Hey! It's probably possible, but I have never tried it so I can't help you :-S

    • @truthteller8228
      @truthteller8228 2 года назад +1

      You don't need the static files to do that.. Just copy the markdown from your editor into the admin content text editor and save it.. That is the simplest solution to it.. That is what I do anyways, because the admin text editor is kind of wonky to use.
      Also, I imagine it would be more efficient and less costly to generate the files as a user needs them. This way your server isn't storing the data multiple times, in the database and also as a static file.

  • @slc8991
    @slc8991 2 года назад

    Excuse me, which plugins are you using for vscode?

    • @CodeWithStein
      @CodeWithStein  2 года назад

      Hey, not too many. Vetur, Pylance and Python. I think I made this video on my previous mac, so I don't have the exact list anymore :-s

  • @ibrahimoglu
    @ibrahimoglu 3 года назад

    👍

  • @tdye
    @tdye 3 года назад

    How would you upload / display a image for your blog post using Markdown? Would Django know where to look for the image when it renders the template on the server?

    • @CodeWithStein
      @CodeWithStein  3 года назад +1

      You can't upload it through Markdown, but if you have it on the server, you can show it like this:
      ![alt text](/media/django-sign-up-1.jpg "Django Sign Up Page")

  • @prakalpitneupane9253
    @prakalpitneupane9253 2 года назад

    Hi, How can we make that code block copyable anyone has any idea on it ?

    • @CodeWithStein
      @CodeWithStein  2 года назад

      Hey, you need to use a javascript snippet to copy it to the clip-board. If you google this, you will find it :-D

  • @harrisonfok8267
    @harrisonfok8267 3 года назад

    Hi Stein! It would be nice if you can include Docker as well for your apps!

    • @CodeWithStein
      @CodeWithStein  3 года назад +2

      Hi, I’m working on a little tutorial video for Docker with Django + Postgresql 😉

    • @harrisonfok8267
      @harrisonfok8267 3 года назад +1

      @@CodeWithStein nice! Looking forward to it!

    • @harrisonfok8267
      @harrisonfok8267 3 года назад

      @@CodeWithStein because I don’t quite know how to do Docker yet lol….It'd be nice if you can do a web app that involves this too!
      I’ll pay you more after that 🤣🤣

  • @sadksahin7436
    @sadksahin7436 3 года назад

    thanks

  • @LinkstaRuViews
    @LinkstaRuViews Год назад

    How insert images?

    • @CodeWithStein
      @CodeWithStein  9 месяцев назад

      Hmm, not done that in markdown before :/ Have you tried googling it?

  • @N10-b8f
    @N10-b8f 3 года назад

    Hi Stein. Please make a django admin dashboard from scratch. There is no video on RUclips showing how to build django admin dashboard from scratch.

    • @CodeWithStein
      @CodeWithStein  3 года назад

      Hi!
      I've been thinking about creating an advanced blog series. Here I want to create a "cms" or at least a custom place where you can login to manage the posts, comments and similar :-)

    • @N10-b8f
      @N10-b8f 3 года назад +1

      @@CodeWithStein Yes please. By the way thank you for your other tutorials. Learned a lot from you. Thank you!