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
Staticfiles : tout ce qu'il faut savoir, rien q...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Bruno Renié
April 14, 2012
Programming
600
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Staticfiles : tout ce qu'il faut savoir, rien que ce qu'il faut savoir
Bruno Renié
April 14, 2012
More Decks by Bruno Renié
See All by Bruno Renié
Visibility for web developers
brutasse
3
490
Decentralization & real-time with PubSubHubbub
brutasse
1
190
Deployability of Python Web Applications
brutasse
17
2.4k
Stop writing settings files
brutasse
21
2.6k
Class-based Views: patterns and anti-patterns
brutasse
9
1.7k
Packager son projet Django
brutasse
4
600
Introduction to Django
brutasse
3
460
Other Decks in Programming
See All in Programming
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
430
My Marp Sample
sinoue0108
0
120
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.5k
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
120
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
110
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
640
typoなんかねぇよ
raspython3
0
590
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
270
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
250
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
220
Discordを用いたラボオートメーション関連情報収集の自動化
noguhiro2002
0
450
初めての模倣学習とVLA
natsutan
0
300
Featured
See All Featured
Building AI with AI
inesmontani
PRO
1
1.2k
4 Signs Your Business is Dying
shpigford
187
23k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
HDC tutorial
michielstock
2
820
Become a Pro
speakerdeck
PRO
31
6.2k
Accessibility Awareness
sabderemane
1
180
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Into the Great Unknown - MozCon
thekraken
41
2.7k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Google's AI Overviews - The New Search
badams
0
1.6k
Docker and Python
trallard
47
4.1k
Transcript
Staticfiles tout rien que ce qu'il faut savoir Bruno Renié
Djangocong 2012
Django >= 1.4 django-staticfiles >= 1.2
MEDIA STATIC données dynamiques données statiques wat
STATIC_ROOT STATIC_URL STATICFILES_FINDERS STATICFILES_DIRS STATICFILES_STORAGE django-admin.py collectstatic
STATIC_ROOT STATIC_URL STATICFILES_FINDERS STATICFILES_DIRS STATICFILES_STORAGE django-admin.py collectstatic
Layout project/ app1/static/style.css app2/static/jquery.js app1 static app2 static
Configuration minimale # settings.py STATIC_URL = '/static/' # urls.py from
django.contrib.staticfiles.urls \ import staticfiles_urlpatterns urlpatterns += staticfiles_urlpatterns() # settings.py # urls.py
et c'est tout
Référencer un fichier {% load staticfiles %} {% static "jquery.js"
%} staticfiles static
app1/static/foo.css app2/static/foo.css {% static "foo.css" %} Conflits Comme les templates
foo.css foo.css "foo.css"
Namespaces Applications réutilisables / éviter les conflits app1/static/app1/foo.css app2/static/app2/foo.css {%
static "app2/foo.css" %} app1/foo.css app2/foo.css "app2/foo.css"
STATICFILES_DIRS Applications non-standard
En production # settings.py STATIC_ROOT = '/path/to/public/static' $ python manage.py
collectstatic # settings.py
et c'est tout
Cache busting STATICFILES_STORAGE = ( 'django.contrib.' 'staticfiles.storage.' 'CachedStaticFilesStorage' ) {%
static "foo.css" %} ↓ /static/foo.1cc9fe7eb4b9.css
{% static %} ♡ @brutasse