$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Démarrer un projet Django
Search
Ordoquy Xavier - Linovia
November 06, 2012
Programming
1
140
Démarrer un projet Django
Quelques points à voir lorsque l'on démarre son projet Django.
Ordoquy Xavier - Linovia
November 06, 2012
Tweet
Share
More Decks by Ordoquy Xavier - Linovia
See All by Ordoquy Xavier - Linovia
SQLAlchemy - un ami qui vous veut du bien
xordoquy
0
6
pycon.fr 2018 - Django REST framework workshop
xordoquy
0
330
mauvaises bonnes idées pour REST
xordoquy
1
380
Authentication and Permissions with Django REST framework
xordoquy
0
190
Buildbot 0.9
xordoquy
0
100
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
120
Django REST framework - DjangoConG 2015
xordoquy
3
140
Other Decks in Programming
See All in Programming
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
110
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
270
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
130
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
570
AI 駆動開発ライフサイクル(AI-DLC):ソフトウェアエンジニアリングの再構築 / AI-DLC Introduction
kanamasa
11
3.5k
Cap'n Webについて
yusukebe
0
150
認証・認可の基本を学ぼう前編
kouyuume
0
260
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
1.7k
Pythonではじめるオープンデータ分析〜書籍の紹介と書籍で紹介しきれなかった事例の紹介〜
welliving
2
520
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
120
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
440
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
270
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1371
200k
Discover your Explorer Soul
emna__ayadi
2
1k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.2k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
110
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
48
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Technical Leadership for Architectural Decision Making
baasie
0
180
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
750
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
68
It's Worth the Effort
3n
187
29k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Mind Mapping
helmedeiros
PRO
0
38
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 ?