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
4
560
Packager son projet Django
Bruno Renié
April 14, 2012
Tweet
Share
More Decks by Bruno Renié
See All by Bruno Renié
Visibility for web developers
brutasse
3
450
Decentralization & real-time with PubSubHubbub
brutasse
1
150
Deployability of Python Web Applications
brutasse
17
2.3k
Stop writing settings files
brutasse
21
2.6k
Class-based Views: patterns and anti-patterns
brutasse
9
1.6k
Staticfiles : tout ce qu'il faut savoir, rien que ce qu'il faut savoir
brutasse
4
540
Introduction to Django
brutasse
3
410
Other Decks in Programming
See All in Programming
ソフトウェア品質を数字で捉える技術。事業成長を支えるシステム品質の マネジメント
takuya542
1
13k
ruby.wasmで多人数リアルタイム通信ゲームを作ろう
lnit
3
480
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
120
Porting a visionOS App to Android XR
akkeylab
0
460
The Modern View Layer Rails Deserves: A Vision For 2025 And Beyond @ RailsConf 2025, Philadelphia, PA
marcoroth
1
150
#QiitaBash MCPのセキュリティ
ryosukedtomita
1
1.3k
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
550
Flutterで備える!Accessibility Nutrition Labels完全ガイド
yuukiw00w
0
160
MDN Web Docs に日本語翻訳でコントリビュートしたくなる
ohmori_yusuke
1
120
NPOでのDevinの活用
codeforeveryone
0
840
おやつのお供はお決まりですか?@WWDC25 Recap -Japan-\(region).swift
shingangan
0
140
iOS 26にアップデートすると実機でのHot Reloadができない?
umigishiaoi
0
130
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1370
200k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
5.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
690
Navigating Team Friction
lara
187
15k
How GitHub (no longer) Works
holman
314
140k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
The Pragmatic Product Professional
lauravandoore
35
6.7k
GraphQLとの向き合い方2022年版
quramy
49
14k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.4k
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]