@@ -49,7 +49,7 @@ $ pip install martor
4949
5050** 2.** Don't forget to add ` 'martor' ` to your ` 'INSTALLED_APPS' ` setting _ (without migrations)_ .
5151
52- ```
52+ ``` python
5353# settings.py
5454INSTALLED_APPS = [
5555 ... .
@@ -60,7 +60,7 @@ INSTALLED_APPS = [
6060
6161** 3.** Add url pattern to your ` urls.py. `
6262
63- ```
63+ ``` python
6464# urls.py
6565# django >= 2.0
6666urlpatterns = [
@@ -88,7 +88,7 @@ urlpatterns = [
8888Please register your application at https://api.imgur.com/oauth2/addclient
8989to get ` IMGUR_CLIENT_ID ` and ` IMGUR_API_KEY ` .
9090
91- ```
91+ ``` python
9292# Choices are: "semantic", "bootstrap"
9393MARTOR_THEME = ' bootstrap'
9494
@@ -166,7 +166,7 @@ ALLOWED_URL_SCHEMES = [
166166
167167Check this setting is not set else csrf will not be sent over ajax calls:
168168
169- ```
169+ ``` python
170170CSRF_COOKIE_HTTPONLY = False
171171```
172172
@@ -176,7 +176,7 @@ CSRF_COOKIE_HTTPONLY = False
176176
177177#### Model
178178
179- ```
179+ ``` python
180180from django.db import models
181181from martor.models import MartorField
182182
@@ -187,7 +187,7 @@ class Post(models.Model):
187187
188188#### Form
189189
190- ```
190+ ``` python
191191from django import forms
192192from martor.fields import MartorFormField
193193
@@ -198,7 +198,7 @@ class PostForm(forms.Form):
198198
199199#### Admin
200200
201- ```
201+ ``` python
202202from django.db import models
203203from django.contrib import admin
204204
@@ -219,7 +219,7 @@ admin.site.register(YourModel, YourModelAdmin)
219219
220220Simply safely parse markdown content as html ouput by loading templatetags from ` martor/templatetags/martortags.py ` .
221221
222- ```
222+ ``` html
223223{% load martortags %}
224224{{ field_name|safe_markdown }}
225225
@@ -232,7 +232,7 @@ Don't miss to include the required css & js files before use.
232232You can take a look at this folder [ martor_demo/app/templates] [ 14 ] for more details.
233233The below example is a one of the way to implement it when you choose the ` MARTOR_THEME = 'bootstrap' ` :
234234
235- ```
235+ ``` html
236236{% extends "bootstrap/base.html" %}
237237{% load static %}
238238{% load martortags %}
@@ -266,7 +266,7 @@ The below example is a one of the way to implement it when you choose the `MARTO
266266
267267Different with * Template Renderer* , the * Template Editor Form* have more css & javascript dependencies.
268268
269- ```
269+ ``` html
270270{% extends "bootstrap/base.html" %}
271271{% load static %}
272272
0 commit comments