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
940
First steps with django CMS
Basic django CMS introduction given at PyCon UK 2014
Iacopo Spalletti
September 21, 2014
Tweet
Share
More Decks by Iacopo Spalletti
See All by Iacopo Spalletti
Django dalle trincee: pattern e pratiche dopo 15 anni di esperienza su Django
yakky
0
56
Writing Async Microservices in Python
yakky
0
680
1 API - 3 Framework - 30 minutes
yakky
0
93
Building real time applications with Django and Channels 2 @ DjangoCon Europe
yakky
1
700
Building real time applications with Django and Channels 2 @ PyCon Italia
yakky
0
550
Building real time applications with Django
yakky
0
670
django knocker
yakky
0
57
django CMS application - A comprehensive approach
yakky
0
52
django CMS + Channels + DRF = ♥
yakky
0
310
Other Decks in Programming
See All in Programming
PipeCDのプラグイン化で目指すところ
warashi
1
310
NEWT Backend Evolution
xpromx
1
140
可変変数との向き合い方 $$変数名が踊り出す$$ / php conference Variable variables
gunji
0
190
チームのテスト力を総合的に鍛えて品質、スピード、レジリエンスを共立させる/Testing approach that improves quality, speed, and resilience
goyoki
5
1.2k
レトロゲームから学ぶ通信技術の歴史
kimkim0106
0
110
What's new in AppKit on macOS 26
1024jp
0
150
顧客の画像データをテラバイト単位で配信する 画像サーバを WebP にした際に起こった課題と その対応策 ~継続的な取り組みを添えて~
takutakahashi
4
1.3k
ふつうの技術スタックでアート作品を作ってみる
akira888
1
1.3k
The Modern View Layer Rails Deserves: A Vision For 2025 And Beyond @ RailsConf 2025, Philadelphia, PA
marcoroth
2
730
GPUを計算資源として使おう!
primenumber
1
250
Quand Symfony, ApiPlatform, OpenAI et LangChain s'allient pour exploiter vos PDF : de la théorie à la production…
ahmedbhs123
0
220
はじめてのWeb API体験 ー 飲食店検索アプリを作ろうー
akinko_0915
0
140
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
2.7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.3k
Making Projects Easy
brettharned
116
6.3k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
47
9.6k
Building Adaptive Systems
keathley
43
2.7k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.8k
How to Think Like a Performance Engineer
csswizardry
25
1.7k
Optimizing for Happiness
mojombo
379
70k
RailsConf 2023
tenderlove
30
1.1k
Into the Great Unknown - MozCon
thekraken
40
1.9k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
340
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 i.spalletti@nephila.co.uk @yakkys