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
Confident Asset Deployments with Webpack & Django
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Scott Burns
July 19, 2016
Technology
1.3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Confident Asset Deployments with Webpack & Django
Presented at Djangocon US 2016 on Tuesday, July 19th 2016.
Scott Burns
July 19, 2016
More Decks by Scott Burns
See All by Scott Burns
Learning From the Pros: Modern Data Management for Clinicians and Scientists
sburns
1
67
An Introduction to Channels
sburns
0
270
Empathy-as-a-Service
sburns
0
130
Improving Research With Advanced REDCap Interfaces
sburns
1
750
ROSIE: Automated Image Processing Infrastructure
sburns
0
160
Other Decks in Technology
See All in Technology
全員がプロダクトへ向き合う組織を持続成長させるために——組織づくりのフライホイールと4象限 / The Flywheel Model and Four Quadrants for Organizational Design
hiro_torii
3
820
Hub & Spoke 環境のネットワークルーティングを分解してみる
tsuyataku
1
520
推論の観測、できていますか? 〜 Google Cloud Gemini Enterprise Agent Platformで 3つの Gemini モデルを実測して踏んだ、評価の罠 〜
shukob
PRO
0
140
[RSJ26] NarrativeFlow: Flow-Based Vision-Language-Action Model Using Robot Velocity Fields
keio_smilab
PRO
0
150
V8コントリビュート超入門
riyaamemiya
0
130
PdMをやめて、 "プロダクトビルダー"という 働き方に変えました / PdM to Product Builder
shikichee
2
700
IoTハンズオンの舞台裏
shirouz
2
120
データエンジニアリングワークショップ:Auto LoaderとSparkで学ぶデータパイプライン構築
databricksjapan
PRO
0
150
Bet AI Day 2026丨バクラク Autopilot、業務システムの再設計
layerx
PRO
2
1.2k
いま、生成AIにKaggleをどこまで 任せられるか — ROGIIコンペでの進め方とTips
k951286
3
1.4k
Webとヘルスデータ
yukukotani
0
170
grill-me(grilling):AI駆動開発を超助けてくれるSkill / grill me
mathbullet
0
100
Featured
See All Featured
The Mindset for Success: Future Career Progression
greggifford
PRO
0
490
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
GraphQLとの向き合い方2022年版
quramy
50
15k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
270
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Navigating Weather and Climate Data
rabernat
0
510
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
360
Transcript
CONFIDENT ASSET DEPLOYMENTS WITH WEBPACK & DJANGO SCOTT BURNS (@SCOTTSBURNS)
DJANGOCON US 2016 #CONFIDENT-DEPLOYS
SHHH, I HAVE A SECRET @scottsburns Confident Asset Deployments
OWAIS LONE GITHUB.COM/OWAIS
̣ PHILOSOPHY ̣ SPECIFICS ̣ PHILOSOPHY @scottsburns Confident Asset Deployments
CONFIDENT ASSET DEPLOYMENTS? @scottsburns Confident Asset Deployments
DEPLOYMENTS Confident Asset Deployments @scottsburns
̣CHANGES ̣FEATURES ̣FIXES Confident Asset Deployments @scottsburns
ASSET @scottsburns Confident Asset Deployments
̣JAVASCRIPT ̣CSS ̣IMAGES @scottsburns Confident Asset Deployments
CONFIDENT @scottsburns Confident Asset Deployments
̣EASY TO BEGIN ̣REVERSIBLE ̣FAST @scottsburns Confident Asset Deployments
̣AUTOMATED ̣FEW 3RD PARTIES ̣TESTED @scottsburns Confident Asset Deployments
WHY NOW? Confident Asset Deployments @scottsburns
TOOLCHAINS HAVE IMPROVED Confident Asset Deployments @scottsburns
COMMUNITIES MOVE AT DIFFERENT SPEEDS Confident Asset Deployments @scottsburns
BUILD BRIDGES, NOT WRAPPERS Confident Asset Deployments @scottsburns
CODE PLEASE Confident Asset Deployments @scottsburns
WEBPACK? Confident Asset Deployments @scottsburns
Confident Asset Deployments @scottsburns https://webpack.github.io/ WEBPACK
$ npm install -s -g \ webpack \ webpack-bundle-tracker Confident
Asset Deployments @scottsburns INSTALLATION
WEBPACK.CONFIG.JS Confident Asset Deployments @scottsburns var path = require("path") var
webpack = require('webpack') var BundleTracker = require('webpack-bundle-tracker') module.exports = { entry: { app: ’./static/index.js’ }, output: { path: path.resolve('./static/bundles/'), filename: "[name]-[hash].js", },...
WEBPACK.CONFIG.JS Confident Asset Deployments @scottsburns ... plugins: [ new BundleTracker(
{filename: ‘./webpack-stats.json’}), ], module: { loaders: […] // not enough time :( }, }
$ webpack —-config \ webpack.config.js Confident Asset Deployments @scottsburns BUILD
THE BUNDLE
{ “status":"done", “chunks”: { “app”: [{ “name": "app-1234567890.js", “path”: “/app/static/bundles/
app-1234567890.js”} ] } } Confident Asset Deployments @scottsburns WEBPACK-STATS.JSON
Confident Asset Deployments @scottsburns
app/ ├─ manage.py ├─ webpack.config.js ├─ webpack-stats.json ├─ static │
├─ index.js │ └─ bundles/ # git ignore │ └─ app-1234567890.js └─ app/ └─ urls.py, app.wsgi, etc… Confident Asset Deployments @scottsburns STRUCTURE
<head> ... </head> <body> <div id="root">...</div> <script src=“{% static ‘bundles/app-1234567890.js’
%}” type=“text/javascript” charset=“utf-8”> </body> Confident Asset Deployments @scottsburns INDEX.HTML
$ pip install \ django-webpack-loader Confident Asset Deployments @scottsburns
... STATICFILES_DIRS = ( ‘static’, ) ... Confident Asset Deployments
@scottsburns SETTINGS.PY
... WEBPACK_LOADER = { 'BUNDLE_DIR_NAME': 'bundles/', ‘STATS_FILE': 'webpack-stats.json', } ...
Confident Asset Deployments @scottsburns SETTINGS.PY
... INSTALLED_APPS = ( ... ‘webpack_loader', ... ) ... Confident
Asset Deployments @scottsburns SETTINGS.PY
{% load render_bundle from webpack_loader %} <head> ... </head> <body>
<div id="root">...</div> {% render_bundle ‘main' %} </body> Confident Asset Deployments @scottsburns INDEX.HTML
<head> ... </head> <body> <div id="root">...</div> <script src="/static/bundles/app-1234567890.js" type="text/javascript" charset=“utf-8">
</body> Confident Asset Deployments @scottsburns (RENDERED) INDEX.HTML
Confident Asset Deployments WEBPACK-STATS.JSON INDEX.HTML APP-1234567890.JS @scottsburns
Confident Asset Deployments WEBPACK-STATS.JSON INDEX.HTML APP-0987654321.JS @scottsburns
DON’T SERVE ASSETS FROM DJANGO Confident Asset Deployments @scottsburns
WHY NOT (PURE) STATICFILES? Confident Asset Deployments @scottsburns
̣PRODUCTION ENV ̣SLOW ̣POST-PROCESSORS @scottsburns Confident Asset Deployments
SEPARATE THE CONCERNS Confident Asset Deployments @scottsburns
FRONT-END DEVS WILL ❤ YOU Confident Asset Deployments @scottsburns
(DEV)OPS WILL ❤ YOU Confident Asset Deployments @scottsburns
NEW DEVS WILL ❤ YOU Confident Asset Deployments @scottsburns
̣BUILD ̣DEPLOY ̣REPEAT @scottsburns Confident Asset Deployments
THANK YOU ❤ @scottsburns Confident Asset Deployments