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
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
7
pycon.fr 2018 - Django REST framework workshop
xordoquy
0
340
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
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
210
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
組織で育むオブザーバビリティ
ryota_hnk
0
180
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
730
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
210
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
470
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
140
AtCoder Conference 2025
shindannin
0
1.1k
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
650
React Native × React Router v7 API通信の共通化で考えるべきこと
suguruooki
0
100
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
4k
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
Featured
See All Featured
Tell your own story through comics
letsgokoyo
1
810
A Soul's Torment
seathinner
5
2.3k
My Coaching Mixtape
mlcsv
0
49
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
110
Discover your Explorer Soul
emna__ayadi
2
1.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
310
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Crafting Experiences
bethany
1
50
Thoughts on Productivity
jonyablonski
74
5k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
120
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
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 ?