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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Iacopo Spalletti
September 21, 2014
Programming
1.1k
1
Share
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
Django dalle trincee: pattern e pratiche dopo 15 anni di esperienza su Django
yakky
0
89
Writing Async Microservices in Python
yakky
0
920
1 API - 3 Framework - 30 minutes
yakky
0
110
Building real time applications with Django and Channels 2 @ DjangoCon Europe
yakky
1
870
Building real time applications with Django and Channels 2 @ PyCon Italia
yakky
0
690
Building real time applications with Django
yakky
0
840
django knocker
yakky
0
76
django CMS application - A comprehensive approach
yakky
0
57
django CMS + Channels + DRF = ♥
yakky
0
340
Other Decks in Programming
See All in Programming
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
2
480
Tamach-sre-3_ANDPAD-shimaison93
mane12yurks38
0
240
Understanding Apache Lucene - More than just full-text search
spinscale
0
150
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
180
AI活用のコスパを最大化する方法
ochtum
0
360
今年もTECHSCOREブログを書き続けます!
hiraoku101
0
210
OTP を自動で入力する裏技
megabitsenmzq
0
130
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.5k
Nuxt Server Components
wattanx
0
230
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
750
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
250
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.2k
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1032
470k
Marketing to machines
jonoalderson
1
5.1k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
160
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
GraphQLとの向き合い方2022年版
quramy
50
14k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
370
Code Review Best Practice
trishagee
74
20k
Discover your Explorer Soul
emna__ayadi
2
1.1k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
780
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
620
Six Lessons from altMBA
skipperchong
29
4.2k
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