简体   繁体   English

如何使用 python django 将代码显示为带颜色的代码

[英]How to display code as code with color using python django

how can I display code as code in the browser using python django. Example如何使用 python django 在浏览器中将代码显示为代码。示例

if True:
    print("Hello World")

I want the above code to be displayed in the browser with different colors我想让上面的代码在不同的浏览器中显示 colors

im not familiar with django but it some editors you use the accent key code我不熟悉 django 但有些编辑器你使用重音键code

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你需要使用一些允许这样做的编辑器,比如ckeditorquill或者更简约的东西(如果你不需要编辑器)比如pygments

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2025 STACKOOM.COM