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
PostgreSQLのRow Level SecurityをPHPのORMで扱う Eloquent vs Doctrine #phpcon #track2
77web
2
490
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
320
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
710
初学者でも今すぐできる、Claude Codeの生産性を10倍上げるTips
s4yuba
14
8.8k
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
1.2k
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
260
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
120
datadog dash 2025 LLM observability for reliability and stability
ivry_presentationmaterials
0
440
LT 2025-06-30: プロダクトエンジニアの役割
yamamotok
0
690
Composerが「依存解決」のためにどんな工夫をしているか #phpcon
o0h
PRO
1
250
すべてのコンテキストを、 ユーザー価値に変える
applism118
3
1.1k
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
600
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Designing Experiences People Love
moore
142
24k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.9k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
The Straight Up "How To Draw Better" Workshop
denniskardys
234
140k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
A better future with KSS
kneath
239
17k
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]