skip to Main Content

how can I display code as code in the browser using python django. Example

if True:
    print("Hello World")

I want the above code to be displayed in the browser with different colors

2

Answers


  1. im not familiar with django but it some editors you use the accent key code

    Login or Signup to reply.
  2. You need to use some editor that allows to do that, something like ckeditor or quill
    Or maybe something more minimalist (if you don’t need the editor) like pygments

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search