-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add flatpages and ckeditor for a light cms experience
- Loading branch information
1 parent
ff26917
commit 4817f63
Showing
5 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
# from django.contrib import admin | ||
from django.contrib import admin | ||
from django.contrib.flatpages.admin import FlatPageAdmin | ||
from django.contrib.flatpages.models import FlatPage | ||
from django.db import models | ||
from ckeditor.widgets import CKEditorWidget | ||
|
||
# Register your models here. | ||
class FlatPageCustom(FlatPageAdmin): | ||
formfield_overrides = { | ||
models.TextField: {'widget': CKEditorWidget} | ||
} | ||
|
||
admin.site.unregister(FlatPage) | ||
admin.site.register(FlatPage, FlatPageCustom) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% extends 'base.html' %} | ||
|
||
{% block title %} | ||
{{ flatpage.title }} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{{ flatpage.content }} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters