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
Démarrer un projet Django
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Ordoquy Xavier - Linovia
November 06, 2012
Programming
150
1
Share
Démarrer un projet Django
Quelques points à voir lorsque l'on démarre son projet Django.
Ordoquy Xavier - Linovia
November 06, 2012
More Decks by Ordoquy Xavier - Linovia
See All by Ordoquy Xavier - Linovia
SQLAlchemy - un ami qui vous veut du bien
xordoquy
0
11
pycon.fr 2018 - Django REST framework workshop
xordoquy
0
350
mauvaises bonnes idées pour REST
xordoquy
1
390
Authentication and Permissions with Django REST framework
xordoquy
0
190
Buildbot 0.9
xordoquy
0
110
Performances Django REST framework - DjangoCong 2016
xordoquy
0
130
Présentation de l'architecture REST - meetup Django Paris
xordoquy
0
110
Django REST framework workshop @Djangocon Europe 2015
xordoquy
0
130
Django REST framework - DjangoConG 2015
xordoquy
3
150
Other Decks in Programming
See All in Programming
Swift Concurrency Type System
inamiy
0
530
t *testing.T は どこからやってくるの?
otakakot
1
660
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
220
おれのAgentic Coding 2026/03
tsukasagr
1
150
ハーネスエンジニアリングとは?
kinopeee
10
5.3k
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
0
150
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
280
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
100
의존성 주입과 모듈화
fornewid
0
140
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
250
JOAI2026 1st solution - heron0519 -
heron0519
0
140
Xdebug と IDE による デバッグ実行の仕組みを見る / Exploring-How-Debugging-Works-with-Xdebug-and-an-IDE
shin1x1
0
380
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Building Adaptive Systems
keathley
44
3k
Exploring anti-patterns in Rails
aemeredith
3
320
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
100
The SEO identity crisis: Don't let AI make you average
varn
0
440
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.8k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
770
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Transcript
Démarrer un projet Django Xavier Ordoquy
Environnement virtuel • virtualenv / virtualenvwrapper • pip • utilisez
les fichiers requirements.txt !!! • $ pip install Django
Création • $ django-admin.py startproject demo $ find demo demo
demo/manage.py demo/demo demo/demo/__init__.py demo/demo/settings.py demo/demo/urls.py demo/demo/wsgi.py $ mkdir demo/media $ mkdir demo/theme
MEDIA et STATIC • STATIC: fichiers projet • MEDIA: fichiers
utilisateur • Utilisez Apache / Nginx / ... en production
settings.py from os.path import dirname, join, normpath DEBUG = True
PROJECT_ROOT = normpath(join('..', dirname(__file__))) MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media') STATIC_URL = '/static/' STATICFILES_DIRS += (join(PROJECT_ROOT, 'theme'),) INSTALLED_APPS += (django.contrib.staticfiles,)
urls.py from django.conf import settings from django.conf.urls.static import static urlpatterns
= ( ... ) urlpatterns += static( settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Django debug toolbar DjDT
templates contexte SQL
configuration INTERNAL_IPS = ('127.0.0.1',) INSTALLED_APPS = ( ... 'debug_toolbar', )
MIDDLEWARE_CLASSES = ( # ... 'debug_toolbar.middleware.DebugToolbarMiddleware', # ... ) $ pip install django-debug-toolbar
Sentry / Raven
None
configuration INSTALLED_APPS += ('raven.contrib.django',) SENTRY_DSN = http://fb..18:
[email protected]
/12 $ pip install
django-debug-toolbar
Applications génériques
Générique • Packaging Python: • facilité d’installation • gestion des
dépendances • pypi.python.org ? • Prévoir un système de migration
Générique • GenericForeignKey • Garder en dehors du projet
Trucs et astuces
generic class based views pour les prototypes
Mettez votre thème dans une application
Utilisez Debug Toolbar pour comprendre l’ORM
Il existe une application tiers: www.djangopackages.com pypi.python.org
irc: #django-fr Don’t ask to ask
Liens http://www.doughellmann.com/projects/virtualenvwrapper/ http://pypi.python.org/pypi/virtualenv https://github.com/django-debug-toolbar/django-debug-toolbar https://www.getsentry.com/docs/
[email protected]
@linovia_net irc: #django-fr Questions ?