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
xordoquy
November 06, 2012
Programming
1
140
Démarrer un projet Django
Quelques points à voir lorsque l'on démarre son projet Django.
xordoquy
November 06, 2012
Tweet
Share
More Decks by xordoquy
See All by xordoquy
pycon.fr 2018 - Django REST framework workshop
xordoquy
0
300
mauvaises bonnes idées pour REST
xordoquy
1
360
Authentication and Permissions with Django REST framework
xordoquy
0
180
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
Django REST framework workshop - DjangoCong 2015
xordoquy
1
120
Other Decks in Programming
See All in Programming
AI駆動のマルチエージェントによる業務フロー自動化の設計と実践
h_okkah
0
150
レベル1の開発生産性向上に取り組む − 日々の作業の効率化・自動化を通じた改善活動
kesoji
0
190
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
550
Team operations that are not burdened by SRE
kazatohiei
1
310
猫と暮らす Google Nest Cam生活🐈 / WebRTC with Google Nest Cam
yutailang0119
0
120
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
270
プロダクト志向ってなんなんだろうね
righttouch
PRO
0
190
Result型で“失敗”を型にするPHPコードの書き方
kajitack
5
650
ソフトウェア品質を数字で捉える技術。事業成長を支えるシステム品質の マネジメント
takuya542
1
13k
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
280
Hypervel - A Coroutine Framework for Laravel Artisans
albertcht
1
120
0626 Findy Product Manager LT Night_高田スライド_speaker deck用
mana_takada
0
170
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Writing Fast Ruby
sferik
628
62k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.9k
KATA
mclloyd
30
14k
Being A Developer After 40
akosma
90
590k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.4k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
740
4 Signs Your Business is Dying
shpigford
184
22k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
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 ?