Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Deploying Django
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Brian Riley
February 22, 2012
860
12
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Deploying Django
Presenting my setup at LA Django Meetup Feb. 21, 2012.
Brian Riley
February 22, 2012
More Decks by Brian Riley
See All by Brian Riley
Python for the Ruby Programmer
brianriley
0
240
Debugging your gunicorns
brianriley
2
170
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Become a Pro
speakerdeck
PRO
31
6.3k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
WENDY [Excerpt]
tessaabrams
14
40k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
The untapped power of vector embeddings
frankvandijk
2
1.9k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
260
エンジニアに許された特別な時間の終わり
watany
109
250k
Transcript
DEPLOYING DJANGO Brian Riley @btriley
DEPLOYING DJANGO or, you could just use Heroku Brian Riley
@btriley
WHO AM I? • been working with Django since 2006
• put Django into production many times, using just about every setup • work at EdgeCast
DEPLOYING IS CONFUSING • gunicorn or uwsgi • nginx or
apache • ? or ? or, you could just use Heroku
THE STACK
THE STACK: WEB SERVER • serving static media files •
proxying to dynamic applications “nginx is an HTTP and reverse proxy server”
NGINX CONF server { listen 80 default; server_name example.com; location
/static/ { root /path/to/project; } location / { proxy_pass http://127.0.0.1:8000; } }
THE STACK: WSGI SERVER “Gunicorn 'Green Unicorn' is a Python
WSGI HTTP Server for UNIX” ./manage.py run_gunicorn
UPSTART • comes with Ubuntu • automates startup/shutdown of processes
• use to manage your gunicorn service: service gunicorn [start | stop | restart]
description "Gunicorn for my Django application" start on runlevel [2345]
stop on runlevel [!2345] #Send KILL after 5 seconds kill timeout 5 respawn env PROJECT_ROOT="/opt/my_django_app" script exec python $PROJECT_ROOT/portal/manage.py run_gunicorn -- settings=settings.production --preload -w 16 --log-level debug --log- file /var/log/my_django_app/gunicorn.log -p /var/run/gunicorn.pid end script /etc/init/gunicorn.conf
AUTOMATION: FABRIC • command-line tool for running remote shell commands
• fab deploy
QUESTIONS? @btriley yes, you could just use Heroku