Add A Rich Text Editor To A Django Blog - Django Blog #21

Поділитися
Вставка
  • Опубліковано 21 лип 2024
  • In this video I'll show you how to add a Rich Text Editor to your django blog.
    We'll be using django-ckeditor (an easy to use rich text editor) which will allow as to stylize our blog posts and add images and links easily.
    Once we pip install django-ckeditor, all we have to do is make a quick tweak to our models.py file, then make a migration and push that migration, and we can start using the text editor in our blog!
    #Django #PythonDjango #DjangoBlog

КОМЕНТАРІ • 260

  • @Codemycom
    @Codemycom  4 роки тому +1

    ▶️ Watch Entire Django Blog Playlist ✅ Subscribe To My UA-cam Channel:
    bit.ly/3bWN6wj bit.ly/2IGzvOR
    ▶️ See More At: ✅ Join My Facebook Group:
    Codemy.com bit.ly/2GFmOBz
    ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
    Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN

  • @Joisthename
    @Joisthename 3 роки тому +11

    Of all the tutorials I’ve watched about python django- I never thought I could get this far in this amazing playlist. I’ve learned a lot and yes! I’m gratefuuuuul

  • @Hollands2511
    @Hollands2511 4 роки тому +2

    Great vid! Straight to the point and just the right amount of detail. 5 minutes of this video had me finish what I tried to do for half an hour myself

  • @coolshoeshine
    @coolshoeshine 2 роки тому

    Another super excellent video where it just straight up answered a question with no bs in the way. You sir are a king amongst men.

    • @Codemycom
      @Codemycom  2 роки тому +1

      Glad you enjoyed it!

  • @ali_sadrian
    @ali_sadrian Рік тому

    Your youtube channel is the best in the game. I'm a legit fan of yours now

  • @khadijahalsmiere3718
    @khadijahalsmiere3718 3 роки тому +5

    OMG ! did you know that you just saved my life?? big thank you and big like and big subscribe and big notification on! you deserve it man.

  • @geeorge
    @geeorge 3 роки тому +1

    this is the 4th editor I'm trying to use with django and the first time it actually works. Many thanks!!

  • @chiccoaderik
    @chiccoaderik 10 місяців тому

    Always great and surprisingly quick and easy what you do for us.
    I will never stop thanking you.
    Excuse me for my barely enough English.
    Riccardo

    • @Codemycom
      @Codemycom  10 місяців тому

      Thanks, I appreciate it!

  • @ryanegbe873
    @ryanegbe873 9 місяців тому

    wow, great video, I must say. 5:33 Line 24 has saved me from the frustration I have been going through for a week now. Thank You so much💗💗💗💗💗💗

    • @Codemycom
      @Codemycom  9 місяців тому

      Happy to hear it!

  • @softwareengineer8923
    @softwareengineer8923 7 місяців тому +1

    It was quite informative, thank you!

  • @muhammadsalmanahmed5541
    @muhammadsalmanahmed5541 3 роки тому

    I was trying to figure this out for a long time. Thank You.

  • @RugvedhiGuru
    @RugvedhiGuru 4 роки тому

    awesome content bro ...
    love it ..
    Best Django Tuts on youtube..
    u make it look so easy ..

  • @aminvasefpoor5383
    @aminvasefpoor5383 2 роки тому

    Man! You saved my life with this video! Thanks :D

  • @christopherk4166
    @christopherk4166 3 роки тому +5

    For anybody else who was wondering - I've been doing a bit of research on how safe it is render the generated rich text on a page. Obviously, you wouldn't want people to be injecting tags into your page. Thankfully django-ckeditor sanitizes the code before it gets saved in your database. tags don't work either. Neither do inline styles or script attributes like 'onclick'.

    • @danieldiaz855
      @danieldiaz855 3 роки тому

      Yeah but the risk remains because you can see and modify the source code!

    • @christopherk4166
      @christopherk4166 3 роки тому +1

      @@danieldiaz855 If I remember correctly, I tested this with by modifying the POST data before it was sent. The validation and sanitation happens server-side.

  • @andrewsmichael7047
    @andrewsmichael7047 3 роки тому

    Your teaching is so cool to understand, Thank you

    • @Codemycom
      @Codemycom  3 роки тому

      Thanks! Glad you're enjoying it!

  • @deyvidsantos3663
    @deyvidsantos3663 2 роки тому

    Excellent video and excellent explaining, Thank you very much.

  • @bartcarpenter9427
    @bartcarpenter9427 3 роки тому

    Great video...Is there a more robust editor available for Django? Select the font type, size, page breaks etc?

  • @princegupta8022
    @princegupta8022 4 роки тому

    The way you teach is Awesome 💓

  • @amritsubramanian8384
    @amritsubramanian8384 3 роки тому

    you are exceptional, thanks for giving me a hand on developing a blog

  • @rangabharath4253
    @rangabharath4253 4 роки тому

    awesome as always. Clear explanation

    • @Codemycom
      @Codemycom  4 роки тому

      Thanks! Glad you liked it

  • @kashibrown9989
    @kashibrown9989 2 роки тому

    this is amazing man... THANK YOU!

    • @Codemycom
      @Codemycom  2 роки тому +1

      Welcome! Glad you found it useful!

  • @juricapuljiz5738
    @juricapuljiz5738 2 роки тому

    Wow, closest thing to magic, thanks so much!

  • @agentNirmites
    @agentNirmites Рік тому +1

    This video is great!

  • @leonardodasilvadiasjunior3899

    Very amazing, master. Congratulations, you are the man.

  • @080somyasrivastava6
    @080somyasrivastava6 3 роки тому

    Thanks for such an amazing tutorial

  • @tailorjaimin5161
    @tailorjaimin5161 4 роки тому

    Thank You So Much for your videos
    I am implemented with you 😀

  • @adamflanagan1879
    @adamflanagan1879 Рік тому

    I love that I tried it myself with def __init__ just to watch the video after and see a different and better way to do it. This is a really, really good UA-cam tutorial series!

  • @watsoncyrusanikwai3888
    @watsoncyrusanikwai3888 2 роки тому

    Awesome man! Thanks!

  • @ali_sadrian
    @ali_sadrian Рік тому

    Thank you Sir! Amazing!

  • @ketanpatil3064
    @ketanpatil3064 3 роки тому

    Thank you for the video Mr.White

  • @CitizenCoder
    @CitizenCoder Місяць тому

    Hey manh, first I wanted to say I love your teaching style and how easy you make things. I was able to easily integrate this with my existing app. However, I found out after getting it installed and running that the company no longer supports it, and they want you to pay to upgrade etc(not afraid of paying, but no budget at the moment). Is there another one that you would recommend to use, that is maybe just as easy to implement? I've looked at Quill but I can't seem to get it working. Thanks for your video and your time.

  • @nbleijie
    @nbleijie 4 роки тому

    Hi great video! Works like a charm! One question though, how do you remove certain buttons from the toolbar?

    • @Codemycom
      @Codemycom  4 роки тому

      I'm not sure you do...check the documentation

  • @brunopetinatijs
    @brunopetinatijs 3 роки тому

    OMG YOU HELPED ME SO MUCH THANKS

  • @motiurrahman8751
    @motiurrahman8751 Рік тому

    Take love and respect mate!

  • @jonadabedesantanapinho3072
    @jonadabedesantanapinho3072 Рік тому

    Thank you, brow!

  • @rahamanhabib1347
    @rahamanhabib1347 4 роки тому +1

    Great!!! It worked... Responsive problem in design though

  • @innocent8484
    @innocent8484 Рік тому

    When I try to export my query to a word file, I cannot use the safe feature, so I cannot read the data. I cannot view the value because the tag is recorded in the database. Is there a solution for this?

  • @bhanuprakash9765
    @bhanuprakash9765 3 роки тому

    I got it...what iam searching for...tnq

  • @bintangpratomo8879
    @bintangpratomo8879 3 роки тому

    hiiii
    i have a question about the ckeditor.
    the django ckeditor has no class name each element, so how i can set default class name on each element?
    example : when i add an image, the image element tag will be like this

  • @harmankibue2497
    @harmankibue2497 3 роки тому +1

    Hello is it a must to have a form file in order for ckeditor to work?

  • @mikey8099
    @mikey8099 6 місяців тому

    Does adding 'safe' tag makes the default escaping for that field disabled. If yes does it means that the data entered in that field is not sanitized?

  • @bnodtwari
    @bnodtwari 3 роки тому +1

    Hey I am not finding a well verged explanation on how to style this even in the documentation, could you please explain?

  • @krankerapfel
    @krankerapfel 3 роки тому

    Thank you for this great video ! Do you know if it's possible to pick a picture in our project database. Or if we can dev a custom button ?

    • @Codemycom
      @Codemycom  3 роки тому

      Sorry, not sure what you mean

  • @ali_sadrian
    @ali_sadrian Рік тому

    Are the fields (bold, italic, etc) editable? For instance can I remove the image icon from it?

  • @adelabu-ghazaleh1228
    @adelabu-ghazaleh1228 3 роки тому

    Great man thank you

  • @CodeBreakersOfficial
    @CodeBreakersOfficial 3 роки тому

    you are awesome sir plz make a video on inventory management system

  • @fabiof.deaquino4731
    @fabiof.deaquino4731 4 роки тому +1

    Great job :)

  • @mtrkhan566
    @mtrkhan566 4 роки тому

    Thanks for this video

  • @tanayawankar5804
    @tanayawankar5804 3 роки тому

    Best tutorial 👌

  • @lawrenlelko
    @lawrenlelko 2 роки тому

    ckeditor - is responsive! WooHoo!

  • @trong-datnguyen3426
    @trong-datnguyen3426 2 роки тому +1

    when I add post, the field title tag appear "Select a valid choice. That choice is not one of the available choices.
    ", anyone get same error with?

  • @gabrieuz
    @gabrieuz 2 роки тому

    Thank You.

  • @achillestroy3122
    @achillestroy3122 Рік тому

    Can we add a signature from this editor like if I create some letter or application and at the end I want to add my signature how can I do that ?

  • @Best_Real_Experience
    @Best_Real_Experience Рік тому

    May allah bless you ..🤲❤❤you just saved me

  • @maihuire11
    @maihuire11 3 роки тому

    Excellent.

  • @antorzuck
    @antorzuck 2 роки тому

    ladies and gentleman, this guy is a legend

  • @jaysuthar2617
    @jaysuthar2617 3 роки тому

    Thank You so much

  • @Node2020
    @Node2020 3 роки тому

    but how to edit the size of the ckeditror image in HTML so that on the pre-display page the image fits into the card?Thank you!

    • @WVZoro
      @WVZoro 3 роки тому

      put it inside a div with the height and weight you want. it should adapt to that div

  • @ferdousahmed5159
    @ferdousahmed5159 3 роки тому +1

    How can i upload images from my pc with ckeditor

  • @user-py9ff5ue1y
    @user-py9ff5ue1y 4 місяці тому

    How can I add additional fonts to ckeditor? I would really love if somebody got a straight forward solution for it

  • @Jesufemi_O
    @Jesufemi_O 3 роки тому +1

    Hi, great content here! Please, I'm looking to use CKeditor with Django rest framework browsable API, how do I go about serializing the body field in my post serializer? thank you :)

  • @andresmon33
    @andresmon33 3 роки тому

    how can I protect that ckeditor input of malicius script tag?

  • @programmer518
    @programmer518 3 роки тому

    hello thank for this video
    I have two questions how to change the language in ckeditor and
    is django-ckeditor-5 same as this pakage?
    thank you

  • @benjaminhodges3589
    @benjaminhodges3589 3 роки тому

    Anybody know why linebreaks aren't showing up/working for me when using this?

  • @nikithashekhar1522
    @nikithashekhar1522 Рік тому +1

    (Hidden field author) Select a valid choice. That choice is not one of the available choices.
    Why does it shows this when i try to post a new blog ? Please Answer

  • @elegantdigitalskills3073
    @elegantdigitalskills3073 3 роки тому +1

    Hello, John Elder, you are a true Legend.
    well i am having problems when Adding post with Ckeditor. I have added Safe to avoid the html tags but it only disappeared on home page. when i click on one blog post to read i find tags in there and no line breaks...

    • @Codemycom
      @Codemycom  3 роки тому +1

      if you added safe to the home page...yeah, it will only effect things on the homepage...you have to add it to the blog post pages if you want it there too.

    • @elegantdigitalskills3073
      @elegantdigitalskills3073 3 роки тому

      @@Codemycom Thanks for your response. It worked well. Be blessed

    • @Codemycom
      @Codemycom  3 роки тому

      @@elegantdigitalskills3073 Awesome

  • @manny7662
    @manny7662 8 місяців тому

    What if I'm using a crispy form with ckeditor?

  • @cyber_coding6469
    @cyber_coding6469 Рік тому

    what about responsiveness of your website once you add ck-editor

  • @pinochaatum5450
    @pinochaatum5450 Рік тому

    Hi, I want to use {{ form.body }} instead of {{ form.as_p }} in order to customize my add page but it doesnt work. Not showing editor.

  • @imadsalim9586
    @imadsalim9586 4 роки тому

    Hi Mr John Elder, you are doing great job , plz can you make video bout creating chatbot using django

    • @Codemycom
      @Codemycom  4 роки тому +1

      I don't really know anything about chatbots, sorry

  • @zainulhassan9186
    @zainulhassan9186 3 роки тому

    CKEditor Not Working to My Post Page .Because
    I am Styling My Website Using CSS Only.
    What Can I Do For This ?

  • @sairamsr7131
    @sairamsr7131 3 роки тому

    NoReverseMatch at /addpost/
    Reverse for 'Blog' with arguments '('4', '8')' not found. 1 pattern(s) tried: ['blog/(?P[0-9]+)$'] how to solve this error
    this thing i am geting both places while creating and updating article
    actully i tried using success_url = reverse_lazy("home") but after updating image or url in rich text editor thowrs me this error

  • @kruthikeshmk
    @kruthikeshmk Рік тому

    Can we still do this without forms.py on a text input field?

  • @funwithpython883
    @funwithpython883 3 роки тому

    Can I get help with how to insert a local image in TinyMCE?

  • @twoandhalfbengals
    @twoandhalfbengals Рік тому

    cool.. can you explain how to make this work on AWS and S3? keep getting files forbidden. It's trying to load from my app, not sure why..

  • @akashpatil4613
    @akashpatil4613 2 роки тому

    Ckeditor is not working when I used the AWS S3 bucket. Somebody plz help !!!

  • @ulvidamirli2758
    @ulvidamirli2758 4 роки тому

    Thanks!!

  • @shalinikrishna7950
    @shalinikrishna7950 4 роки тому

    How can we style the images with classes like img-fluid and viewports?

    • @Codemycom
      @Codemycom  4 роки тому

      Click the code button on the editor an type in any classes you like

  • @aminalih4764
    @aminalih4764 3 роки тому +1

    Hello , thank for video
    I have a question this rich text work correctly on django admin panel but in my admin panel it doesn't work
    how can I fix it ?

    • @rajpanchal2169
      @rajpanchal2169 3 роки тому

      if You solve it tell me please

    • @aminalih4764
      @aminalih4764 3 роки тому

      @@rajpanchal2169 Hello friend , according to the ckeditor (RichText) documentation we should add some custom setting in SETTING.py file in django project

  • @ps-vq3wf
    @ps-vq3wf 2 роки тому +1

    |safe tag is not recognized in react. The html tags are appearing as they are. How can we solve this ?

    • @Codemycom
      @Codemycom  2 роки тому

      This is not a react course

  • @idkname
    @idkname Рік тому

    what if upload img, it works?

  • @ufukcicek9976
    @ufukcicek9976 10 місяців тому

    Hello,
    I also use Editorjs in my project.
    But I have a problem, I can save images and files in the editor in my local, but when I deeploy the project, I get an error. It says it can't find the file. I searched a lot but couldn't find a solution.
    Do you have any idea about this topic?

    • @Codemycom
      @Codemycom  10 місяців тому

      Sorry, never heard of that

  • @bashbukari1089
    @bashbukari1089 4 роки тому

    nice video

  • @vanessaveizaga962
    @vanessaveizaga962 2 роки тому +1

    hola! sigo todos los pasos del video, y el editor me aparece en el admin, pero no en la página. Que será?
    Gracias por tus videos!!

    • @Codemycom
      @Codemycom  2 роки тому +1

      rewatch the video and try again

  • @koreckie4967
    @koreckie4967 2 роки тому

    Hi, is there any way to put the max size of an image. For example when I upload an image and it is over 500 width and 500 height then the post is not created and there will be an alert.

    • @Codemycom
      @Codemycom  2 роки тому

      Probably, but I don't have videos on that

    • @koreckie4967
      @koreckie4967 2 роки тому

      @@Codemycom so do you know any way to do it?

  • @andrewsmichael7047
    @andrewsmichael7047 3 роки тому

    Please master, can you help with a tutorial on how to send reset password link to a user on production, I have followed some tutorials and it's working on local host but saying SmtpRefuse To send error on production...
    Thank you

    • @FalseDev
      @FalseDev 3 роки тому

      Check your mail credentials in production

  • @bigsandip
    @bigsandip 4 роки тому

    Nice

  • @almiracontracting5119
    @almiracontracting5119 2 роки тому

    thanks

  • @sriram9786
    @sriram9786 3 роки тому

    How jt handles cross site request attack. Meaning how it handles tag injected how it is going to clean the harmful tags?? Thank you 🌹 your videos are always awesome. Waiting for your reply

    • @Codemycom
      @Codemycom  3 роки тому

      django uses csrf tokens

    • @sriram9786
      @sriram9786 3 роки тому +1

      @@Codemycom I am asking cross site scripting sorry.

  • @theglammcoder
    @theglammcoder 4 роки тому

    Hey , ckeditor is going out of my container of my add_post page, Any idea how can i adjust the size of ckeditor ???

    • @prakhar_pratyush
      @prakhar_pratyush 3 роки тому

      In settings.py file
      CKEDITOR_CONFIGS = {
      'default': {
      'width': 'auto',
      }
      }

    • @darwinsterritory
      @darwinsterritory 3 роки тому

      @@prakhar_pratyush You did such a good deed, and no one even said thank you to you, but you helped me a lot and I say thank you friend!)

  • @universefacts6757
    @universefacts6757 11 місяців тому

    How to interact with this using js events?

  • @dradrigapatrick
    @dradrigapatrick 3 роки тому

    I used to think these things are hard, but now you have show to me that they are actually not.
    How do you guys remember all of these stuff!!
    I need the trick.
    I love the Tutorial. I can see where am going.

    • @Codemycom
      @Codemycom  3 роки тому

      Glad you're enjoying the videos!

  • @joelmiruni8660
    @joelmiruni8660 3 роки тому

    When I post content using the CKEditor, also the HTML tags are displayed on the page am rendering. For example, when I type HELLO WORLD in the editor, on my page it looks like this HELLO WORLD. Kindly it will be of great help to me if assisted.

    • @rossideas
      @rossideas 3 роки тому +1

      I had that issue and it was the "safe" word needed to be added to home.html, categories.html and article_details.html both for it to work correctly.

    • @joelmiruni8660
      @joelmiruni8660 3 роки тому

      @@rossideas thanks, i did this way {{post.body|safe}} and worked. And have you checked ...Add Blog Post Page - Django Blog #4... on these tutorial series, when i press the post button nothing happens, just being redirected on the same add post page.

  • @edwardhanson8039
    @edwardhanson8039 10 місяців тому

    i did not use the form.as_p, i made an html form and linked it to the model, the ckeditor is not showing, how do i solve it please?

  • @narej3059
    @narej3059 3 роки тому

    What can i use to add a box to type "code" in, like in stackoverflow with the ``

    • @Codemycom
      @Codemycom  3 роки тому

      Not sure what you mean

    • @narej3059
      @narej3059 3 роки тому

      @@Codemycom in stackoverflow you can make the text appear like code, and it appears inside a grey box when u use ```code here```

    • @Codemycom
      @Codemycom  3 роки тому +2

      @@narej3059 You'll likely need to tweak your css to handle that sort of thing..sorry, it's beyond the scope of these videos

    • @narej3059
      @narej3059 3 роки тому +1

      @@Codemycom np it works perfect ckeditor has a 'code' style in the "style" drop down so cool! Keep the good vids thank you

  • @lucky0020
    @lucky0020 3 роки тому

    Great video but when user add emoji or image it breaks the layout and style of html page, is there any solution to this problem?

    • @rogueDukakis
      @rogueDukakis Рік тому

      It has to do with "slice" on the home page. I'm trying to figure it out.

  • @ulvidamirli2758
    @ulvidamirli2758 3 роки тому

    What if I want non-styled version of text for my list view page. But styled in my detail page view. Thanks again for awesome tutorial, BTW!

    • @Codemycom
      @Codemycom  3 роки тому +1

      Nothing stopping you from doing that

    • @ulvidamirli2758
      @ulvidamirli2758 3 роки тому

      @@Codemycom yeah, I found the answer. Using strip_tags from django.utils.html

    • @jaybon2076
      @jaybon2076 2 роки тому

      @@ulvidamirli2758 how did you do this exactly? I can't seem to figure it out

    • @jaybon2076
      @jaybon2076 2 роки тому

      figured it out, {{ post.body | slice:":200" | safe | striptags }} in the home.html doc

  • @technoinfoworldwide2329
    @technoinfoworldwide2329 4 роки тому

    how to add desktop videos on ckeditor(not a youtube link) as there is no any option of adding video ..make a tutorial on this..

    • @Codemycom
      @Codemycom  4 роки тому

      I doubt I'll do that. No one hosts their own videos, you use youtube or vimeo. You would just paste in the embed code youtube or vimeo gives you into the blog form there, there's nothing to it.

    • @technoinfoworldwide2329
      @technoinfoworldwide2329 4 роки тому

      @@Codemycom why not sir, there are some site which hosts their own video too..i had found ckeditor plugin of video in its official documentation but when i tried to implement ,it doesn't work.you may try it

  • @sriram9786
    @sriram9786 3 роки тому

    Hey John I have a doubt. Will this be a security gole for cross site scripting attack.

    • @Codemycom
      @Codemycom  3 роки тому +1

      No

    • @sriram9786
      @sriram9786 3 роки тому

      @@Codemycom can we do that without installing the module. In front end and somehow clean the data and use safe in django template view. Waiting for the answer love you. Thank you for your reply

    • @Codemycom
      @Codemycom  3 роки тому

      @@sriram9786 no

  • @darshitvekariya1936
    @darshitvekariya1936 Рік тому

    if check comment for you have like version issue:
    proper work but some version issues in the low python version
    else:
    keep smiling and continue the video to Improve knowledge

    • @Codemycom
      @Codemycom  Рік тому +1

      yes it is

    • @darshitvekariya1936
      @darshitvekariya1936 Рік тому

      ok sir let me explain my project is old like 2 year
      there is a version issue and I am stuck can you have any temporary solution
      sorry for what I said not working..

    • @Codemycom
      @Codemycom  Рік тому

      @@darshitvekariya1936 You can use any version you want