Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
First steps with django CMS
Search
Iacopo Spalletti
September 21, 2014
Programming
1.2k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
First steps with django CMS
Basic django CMS introduction given at PyCon UK 2014
Iacopo Spalletti
September 21, 2014
More Decks by Iacopo Spalletti
See All by Iacopo Spalletti
FastHTML: HTML applications, the Python way
yakky
0
56
Django dalle trincee: pattern e pratiche dopo 15 anni di esperienza su Django
yakky
0
110
Writing Async Microservices in Python
yakky
0
950
1 API - 3 Framework - 30 minutes
yakky
0
110
Building real time applications with Django and Channels 2 @ DjangoCon Europe
yakky
1
900
Building real time applications with Django and Channels 2 @ PyCon Italia
yakky
0
720
Building real time applications with Django
yakky
0
870
django knocker
yakky
0
82
django CMS application - A comprehensive approach
yakky
0
65
Other Decks in Programming
See All in Programming
New "Type" system on PicoRuby
pocke
1
930
Creating Composable Callables in Contemporary C++
rollbear
0
130
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.1k
AIで効率化できた業務・日常
ochtum
0
140
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
680
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
180
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
240
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
160
エージェンティックRAGにAWSで入門しよう!
har1101
8
1.6k
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
130
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
170
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
Featured
See All Featured
Leo the Paperboy
mayatellez
7
1.8k
Chasing Engaging Ingredients in Design
codingconduct
0
220
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
230
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
210
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
44k
Accessibility Awareness
sabderemane
1
140
It's Worth the Effort
3n
188
29k
The browser strikes back
jonoalderson
0
1.2k
A better future with KSS
kneath
240
18k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
390
Transcript
PYCON UK 2014 FIRST STEPS WITH DJANGO CMS by Iacopo
Spalletti @yakkys
WHO AM I? Founder and Lead developer @NephilaIt django CMS
core developer django CMS installer author
DJANGO CMS FIRST LOOK BRIEF OVERVIEW OF DJANGO CMS FEATURES
FEEL FREE TO COME TO THE BOOTH OR AT THE SPRINTS FOR MORE
WHAT'S DJANGO CMS? 'JUST' A CMS FOR DJANGO (APPARENTLY) With
a twist!
DJANGO CMS HOW IS DIFFERENT? IT'S LIMITED (BY DESIGN) YOU
CANNOT "EXTEND" A PAGE
DJANGO CMS WHY IS THAT? WHY NOT? WE HAVE DJANGO
MODELS! GOOD DJANGO CITIZEN
DJANGO CMS CONTRIBUTING FEATURES django CMS provides features that your
applications can use
BASIC CONCEPTS PAGE PLACEHOLDER PLUGIN APPHOOK FRONTEND EDITOR
LIVES IN A LIVE AND DRAFT VERSION DEFINED BY THE
TEMPLATE APPLIED TO IT PAGE THE BUILDING BLOCK OF THE CMS
PLACEHOLDER ACTIVE AREAS WITHIN YOUR PAGES PLUGIN CONTAINERS DEFINED IN
THE TEMPLATES JUST A TEMPLATETAG
PLACEHOLDER HOW TO DEFINE A PLACEHOLDER? {% placeholder "first_placeholder" %}
PLACEHOLDER THERE IS MORE class MyModel(models.Model): name = models.CharField(max_length=200) abstract
= models.TextField() content = PlaceholderField() Composition, not inheritance
PLUGIN Placeholder = Container Plugin = Content
PLUGIN WHAT'S A PLUGIN? A content A bridge towards other
Django applications
PLUGIN WRITING PLUGIN IS EASY class MyPlugin(CMSPluginBase): name = _('My
plugin') render_template = 'myapp/myplugin.html'
PLUGIN 1. PLUGIN CLASS class MyPlugin(CMSPluginBase): name = _('My plugin')
model = MyPluginModel render_template = 'myapp/myplugin.html' def render(self, context, instance, placeholder): newslist = News.objects.all().order_by('-date') context.update({ 'instance': instance, 'news_list': newslist[:instance.posts] }) return context Plugin = ModelAdmin + template + get_context_data
PLUGIN 2. THE PLUGIN MODEL It's the plugin configuration class
MyPluginModel(CMSPlugin): title = models.CharField(max_length=200) posts = models.PositiveIntegerField()
PLUGIN 3. THE TEMPLATE Template is a standard Django template
fragment to which the plugin generated context is provided <div class="news_list"> <h2>{{ instance.title }}</h2> {% for news in news_list %} <a href="{{ news.get_absolute_url }}"> {{ news.title }}</a><br> {% endfor %} </div>
APPHOOK Is a bridge between the CMS and other Django
applications In rough terms, it appends the application URLConf to the page tree
It wraps the URLCon in a class APPHOOK SOME CODE
class MyApp(CMSApp): name = _("My App") urls = ["apps.my_app.urls"] menus = [MyMenu] apphook_pool.register(MyApp)
APPHOOK THAT'S ALL :)
FRONTEND EDITOR WARNING! IT'S ADDICTIVE!
FRONTEND EDITOR WHAT'S IT? NEW IN DJANGO CMS 3 ADMIN
OUTSIDE THE ADMIN
FRONTEND EDITOR FOLLOW THE WHITE PONY
FRONTEND EDITOR TOOLBAR COMPLETE SIMPLE DYNAMIC CUSTOMIZABLE
FRONTEND EDITOR ANCHE NEI VOSTRI MODEL EVERY MODEL CAN BE
FRONTEND-ENABLED {% render_model instance "abstract" %} {% render_model_block instance %} <h3>{{ instance.title }}</h3> <div class="date">{{ instance.date }}</div> {% endrender_model_block %}
SHAMELESS PLUG!
GRAZIE! SEE YOU TOMORROW! DJANGO CMS SPRINT And tips and
support to use django CMS Iacopo Spalletti
[email protected]
@yakkys