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
580
4
Share
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
470
Decentralization & real-time with PubSubHubbub
brutasse
1
170
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
580
Introduction to Django
brutasse
3
450
Other Decks in Programming
See All in Programming
Liberating Ruby's Parser from Lexer Hacks
ydah
2
1.9k
AI-DLC Deep Dive
yuukiyo
9
4.6k
Swift Concurrency Type System
inamiy
1
540
JOAI2026 1st solution - heron0519 -
heron0519
0
140
事業会社でのセキュリティ長期インターンについて
masachikaura
0
260
UIの境界線をデザインする | React Tokyo #15 メイントーク
sasagar
2
380
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
1
170
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3.5k
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
210
10 Tips of AWS ~Gen AI on AWS~
licux
5
430
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
140
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
180
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
150
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Testing 201, or: Great Expectations
jmmastey
46
8.1k
Believing is Seeing
oripsolob
1
110
A better future with KSS
kneath
240
18k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
YesSQL, Process and Tooling at Scale
rocio
174
15k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
680
Practical Orchestrator
shlominoach
191
11k
SEO for Brand Visibility & Recognition
aleyda
0
4.5k
Evolving SEO for Evolving Search Engines
ryanjones
0
180
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]