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
Packager son projet Django
Search
Bruno Renié
April 14, 2012
Programming
590
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Packager son projet Django
Bruno Renié
April 14, 2012
More Decks by Bruno Renié
See All by Bruno Renié
Visibility for web developers
brutasse
3
480
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
Staticfiles : tout ce qu'il faut savoir, rien que ce qu'il faut savoir
brutasse
4
590
Introduction to Django
brutasse
3
460
Other Decks in Programming
See All in Programming
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
370
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
140
JAWS-UG横浜 #102 AWSサ終供養LT会 成仏できない AWS サービスたち 〜本日、三体供養します〜
maroon1st
0
270
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
0
170
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
450
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
420
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
3.3k
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
190
これって Effect でできたのでは? / TSKaigi Mashup Kansai #2
susisu
0
100
FDEが実現するAI駆動経営の現在地
gonta
2
240
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
130
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
0
1.4k
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
1
170
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
260
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
How GitHub (no longer) Works
holman
316
150k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.7k
Music & Morning Musume
bryan
47
7.3k
Transcript
Bruno Renié Djangocong 2012 Packager son projet Django
distribuer / déployer du code
git
dépendances rollback traçabilité
PaaS
contraintes géographiques architecturales culturelles
packaging
installer son application comme une simple bibliothèque* * configuration laissée
au soin de l'utilisateur
simplicité traçabilité reproductibilité
OS Application deb / RPM setup.py
None
django nettoyez-moi tout ça
arrêter d'altérer sys.path project/ __init__.py urls.py app1/ __init__.py models.py app2/
from project.app1.views import stuff
Application réutilisable : package séparé from project.app.models import Stuff from
registration.models import RegistrationProfile Application non réutilisable : embarquée
requirements : versions explicites Django==1.4 PIL==1.1.6 pas de liens git
setup.py from distutils.core import setup from setuptools import find_packages with
open('requirements.txt') as reqs: install_requires = reqs.read().split('\n') setup( name='project', version=__import__('project').__version__, packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=install_requires, )
MANIFEST.in pour tout ce qui est non-python include requirements.txt recursive‐include
project * recursive‐exclude project *.pyc recursive‐exclude project *.scss exclude project/settings.py
settings project/default_settings.py Packagé : Déployé : settings.py from project.default_settings import
* DATABASES = { … }
layout final requirements.txt setup.py MANIFEST.in project/ __init__.py default_settings.py settings.py app1/
app2/
Déploiement
env/ public/ static/ settings.py wsgi.py ./env/bin/gunicorn wsgi:application utiliser add2virtualenv pour
rendre wsgi et settings importables sans toucher PYTHONPATH
pip et paquets privés --find-links : file:///path/to/packages --index-url : structure
de type http://pypi.python.org/simple/ bien héberger tous ses paquets pypi tombe, les versions disparaissent
Workflow final Déployer (incrément n° de version) python setup.py sdist
(upload) pip install ‐U project ‐‐find‐links … Rollback pip install project==X.Y.Z ‐‐find‐links …
https://github.com/brutasse/fab-bundle @brutasse
[email protected]