SlideShare una empresa de Scribd logo
1 de 37
Descargar para leer sin conexión
Development environment 
for Django project - my way 
! 
Robert Lujo, 2014
about me 
• software 
• professionally 17 y. 
• python since 2.0, django since 0.96 
• freelancer 
• more info -> linkedin
“Software Development 
Environment” is …? 
I found no unique / unified answer …
Software Development 
Environment (1) 
refers to a server tier designated to a specific stage in a 
release process. 
List of tiers: Local, Development, Integration, Test/QA, UAT, 
Stage/Pre-production, Production/Live 
Hm…! 
https://en.wikipedia.org/wiki/Development_environment_ 
%28software_development_process%29
Software Development 
Environment (2) 
a collection of procedures and tools for developing, testing 
and debugging an application or program. 
Getting closer …! 
http://www.techopedia.com/definition/16376/development-environment
Integrated development 
environment - IDE 
! 
software application that provides comprehensive facilities to 
computer programmers for software development. 
… source code editor, build automation tools and a debugger... 
Intelligent code completion features ... compiler, interpreter, ... 
version control system and various tools are integrated to simplify 
the construction of a GUI ... class browser, an object browser, 
and a class hierarchy diagram. 
Closer and closer …! 
https://en.wikipedia.org/wiki/Integrated_development_environment
Software Development 
Environment (3) 
contains everything required by a team to build and 
deploy software-intensive systems (where software is an 
essential and indispensable element) 
I approve!! 
http://www.ibm.com/developerworks/rational/library/define-scope-development- 
environment/index.html
What is “everything”? 
Software development lifecycle (SDLC) 
• Planning 
• Designing 
• Implementation, testing and documenting 
• Deployment and maintenance 
https://en.wikipedia.org/wiki/Software_development 
!
What about “a team”? 
Interacts with: 
• Software project management - organisation, 
coordination, covers: risk, change, software configuration 
and release management 
https://en.wikipedia.org/wiki/Software_project_management 
• Software development process a.k.a. software 
development methodology - e.g. waterfall, agile … 
https://en.wikipedia.org/wiki/Software_development_process
My priorities 
1. implement at least 90% of the most important 
requested features 
2. shortest possible time needed for “from request 
to deploy” cycle 
3. low-cost scaling - human/machines - initial 
setup of DevEnv or running system 
4. ensure high quality deliverables
! 
now, the real stuff 
! 
btw. where has Django disappeared?
Initial setup - proj layout 
~/env 
├── proj-1 
├── cli-1 
├── … 
├── biz 
├── … 
└── proj-N
Initial setup - proj layout 
~/env/biz 
├── archive 
├── biz-web (GIT) 
│ ├── ... (to be continued) 
├── biz-data(GIT) 
├── biz-ie (GIT) 
├── doc -> ln -s ~/Dropbox/…/biz/doc 
└── temp
Initial setup - python proj layout 
~/env/biz/biz-web (GIT) 
├── bin 
├── doc (sphinx,rst: readme,todo, 
│ install, ...) 
├── pybiz (venv python installation) 
├── reqs (base.txt, dev.txt) 
├── src 
│ ├── (to be continued) 
│ ... 
└── var 
├── biz.sqlite 
├── biz-app.log 
├── biz-jobs.log 
└── bulk-data
Initial setup - django proj layout 
~/env/biz/biz-web/src 
├── bizproj (global project folder - formats, settings) 
├── bizjobs 
│ ├── ... 
├── bizapp 
│ ├── management / commands 
│ ├── migrations 
│ ├── scripts 
│ ├── templates 
│ │ ├── biz 
│ │ │ ├── components 
│ │ │ ├── backoffice 
│ │ │ ├── protected 
│ │ │ ├── public 
│ │ │ └── trial 
│ │ ├── admin 
│ │ ├── rosetta 
│ └── templatetags 
├── locale (de/en) 
├── media 
└── static (js, css, images, libs, fonts) # to bizapp?
Initial setup - django settings 
~/env/biz/biz-web/src/bizproj/settings 
! 
base.py 
from .secret import * 
! 
dev.py 
dev_demo.py 
! 
test.py 
! 
secret.py # not in git repo 
EMAIL_HOST_USER = "..." 
DATABASES = { 
! 
secrete.py.template # is in git repo 
! 
dbrouter.py 
testrunner.py
Initial setup - .gitignore 
! 
~/env/biz/biz-web/.gitignore 
… 
pybiz 
var 
src/media/* 
secret.py 
fabfile_settings.py 
*.pyc 
*.swp 
*.pickle 
*.sqlite 
*.bak 
…
File and directory naming 
• very careful in naming ! 
• naming convention - inherit existing + 
adaptations! 
• very careful in choosing folder/structure! 
• bigger files better than many files! 
• less files/folders is better than more!
Project dependencies 
• as small as possible - more components -> more complex -> more integration/ 
upgrade/other issues 
• choose very carefully 
• proven, stable, I/team is familiar with 
• easily installable/upgradeable 
• adaptable (when possible) 
• when choosing new 
• read documentation/read reviews/choose several/experiment/make 
decision 
• bigger community -> better
Project dependencies 
• solutions 
1. make a script to setup everything from the 
scratch 
2. install manually/reuse existing images and 
then freeze state in VM, Vagrant, Docker 
image 
3. combine both
Project dependencies 
• make a shell script 
• two types of dependencies 
• pip installable 
pip install -r reqs/dev.txt 
• pip non-installable 
• set of shell commands to install everything that is missing 
• Problem: different OS-es, e.g. OSX, Linux CentOS? 
if [ $(uname) == 'Linux' ] …
Project deps - pip requirements 
! 
~/env/biz/biz-web/reqs 
! 
base.txt : 
django>=1.5,<1.6 
pillow 
reportlab 
johnny-cache 
markdown 
elasticsearch 
beautifulsoup4 
lxml 
requests 
celery[redis] 
… 
! 
dev.txt : 
-r base.txt 
south 
django_extensions 
django-debug-toolbar 
django-rosetta # for translation 
mock 
ipdb 
…
Project deps - shell script 
! 
non-PIP installables 
! 
~/env/biz/biz-web/bin/biz # chmod u+x 
! 
case "$1" in 
env) 
if [ ! -d $BIZ_HOME/pybiz ]; then 
cd $BIZ_HOME 
sudo apt-get install python-devel 
sudo apt-get install python-pip 
sudo apt-get install python-xml 
sudo apt-get install elasticsearch 
... 
pip install virtualenv 
virtualenv pybiz 
fi 
! 
(to be continued …)
Project deps - shell script 
! 
PIP installables 
! 
(continued …) 
! 
if [ -f $BIZ_HOME/pybiz/bin/activate ]; then 
source $BIZ_HOME/pybiz/bin/activate 
echo "pip=`which pip`, python=`which python`” 
! 
pip install -q --requirement=$BIZ_HOME/reqs/dev.txt 
! 
cd $BIZ_HOME/src/bizapp 
export PYTHONPATH=$PYTHONPATH:$BIZ_HOME/src 
echo "== env 'BIZ' initialized, checking base packages" 
python -c"import django; 
print(' Django - ok v%s' % django.get_version())" 
python -c"import redis ;print(' redis - ok')" 
python -c"import celery ;print(' celery - ok')" 
python -c"import bizappp ;print(' biz app - ok’)" 
… 
fi 
! 
(to be continued …)
Project deps - shell script 
! 
check services 
! 
echo "== Is redis running?" 
ps ax | grep -v grep | grep redis 
!! 
echo "== Is elasticsearch running?" 
ps ax | grep -v grep | grep elasticsearch | awk "{print $1, $2,  
$3, $4, $5, "..."}" 
! 
…
Project management shell script 
• why? 
• to have one central place where to do project management 
• what? everything that needs automation 
• setup initial environment, update environment 
• open editor/IDE 
• run tests 
• deployment, remote management
Project management shell script 
! 
# biz 
! 
Usage: 
! 
*env - will initialize dev environment 
! 
redis - start redis in background 
elas - start elasticsearch in background 
cel - start celery worker in background 
! 
doc-update/du - will update doc/build/html wiki doc 
doc - will open doc/build/html/index.html - home of wiki 
! 
log2 - will tail app log (if located in local var directory) 
! 
run/n - django-admin runserver 
django/d - django-admin 
sp - django-admin shell_plus 
! 
test-ping/tp - ping production 
test/t - django-admin test --settings=test_settings 
trans-make|tm - TRANSLATION - calls makemessages 
! 
r/remote - will call fabric script for deployment and remote operations 
! 
migrate|mig - do south migration - only dev system 
mig-auto - create new south auto-migration - only dev system 
! 
browse|b - browse to localhost:8000 
issues - browse to opened issues on bitbucket 
! 
* - should be called with source/.
Editor: ViM 
• although steep learning curve, is: 
• very adaptable 
• unique features philosophy 
• not in the way, very effective 
• personal preference: 
• I don’t feel comfortable in IDE 
• I like to be close to “bare metal” 
• to use editor designed for source code editing
• personal preference: 
Editor: ViM 
• I don’t like plugins too much, only .vimrc 
• when working on the server to have the same possibilities 
• configuration 
• server 
scp ~/.vimrc user@server:/home/user/ 
• local development machine 
ln -s ~/Dropbox/env/.vimrc ~ 
• flavors 
• gVim / MacVim - GUI, ViM - on every server
Development on the server 
• with project shell script one can do directly on 
the server 
• devenv setup/upgrade 
• webapp setup/upgrade 
• vim & shell-script -> do “live” development 
• run dev server
File browser 
• personal preference: 
• I like side by side file browsers 
• usual file operations: create folders, check files, 
search for files, zip etc. 
• easy integration with editor (F4) 
• not found “one-to-rule-them-all” 
• TotalCommander, FreeCommander, DoubleCmd …
Idea evaluation 
• evaluate a new idea or to test concept 
• ipython / django shell_plus 
• use reload: 
from biz import models 
models.test_something() 
# change models and save 
reload(models) 
models.test_something() 
• next step is - create a module/function
• I use a lot 
Debugging 
• plain-old pdb or sometimes ipdb 
• conditional breakpoints: 
if i==500: 
import pdb; pdb.set_trace() 
• conditional breakpoints (2): 
try: 
bad_bad_code() 
except: 
import pdb; pdb.set_trace() 
• server side - logging, send emails on error 
logger.error(“this will be send by email) 
logger.error(“in try/except - will be send by email with traceback”)
• Unit tests 
• integration tests 
Testing 
• “click-testing” - local development server 
• automating http requests to staging/production 
servers (from curl, nagios to dedicated services) 
• “click-testing” - staging/production servers
Deployment 
• must be simple, automated, fast and reliable 
• usually: 
• setup environment 
• git push+pull / collectstatic / restart server 
• analyse logs 
• run integration tests on server instance 
• example: 
git ci -am”very important fix” 
biz r test upgrade prod upgrade
Philosophy 
• “Unix philosophy by Mike Gancarz” filtered: 
Make each program do one thing well. 
Use software leverage to your advantage. 
Use shell scripts to increase leverage and 
portability. 
(btw. Store data in flat text files) 
https://en.wikipedia.org/wiki/Unix_philosophy
Thanks for the patience! 
Questions? 
! 
robert.lujo@gmail.com 
@trebor74hr

Más contenido relacionado

La actualidad más candente

PHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding stylePHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding styleBo-Yi Wu
 
Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015Chef
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and PracticeBo-Yi Wu
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at ScaleKris Buytaert
 
Giving back with GitHub - Putting the Open Source back in iOS
Giving back with GitHub - Putting the Open Source back in iOSGiving back with GitHub - Putting the Open Source back in iOS
Giving back with GitHub - Putting the Open Source back in iOSMadhava Jay
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovskyphp-user-group-minsk
 
Docker for Development
Docker for DevelopmentDocker for Development
Docker for Developmentallingeek
 
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in BerlinDeploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in BerlinAlessandro Nadalin
 
Modulesync- How vox pupuli manages 133 modules, Tim Meusel
Modulesync- How vox pupuli manages 133 modules, Tim MeuselModulesync- How vox pupuli manages 133 modules, Tim Meusel
Modulesync- How vox pupuli manages 133 modules, Tim MeuselPuppet
 
The Scientific Filesystem
The Scientific FilesystemThe Scientific Filesystem
The Scientific FilesystemVanessa S
 
Wonderful world of (distributed) SCM or VCS
Wonderful world of (distributed) SCM or VCSWonderful world of (distributed) SCM or VCS
Wonderful world of (distributed) SCM or VCSVlatko Kosturjak
 
Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with PhingMichiel Rook
 
Porting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidPorting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidVlatko Kosturjak
 
Optimizing Spring Boot apps for Docker
Optimizing Spring Boot apps for DockerOptimizing Spring Boot apps for Docker
Optimizing Spring Boot apps for DockerGraham Charters
 
Ripping web accessible .git files
Ripping web accessible .git filesRipping web accessible .git files
Ripping web accessible .git filesVlatko Kosturjak
 
11 tools for your PHP devops stack
11 tools for your PHP devops stack11 tools for your PHP devops stack
11 tools for your PHP devops stackKris Buytaert
 
Virtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayVirtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayPuppet
 

La actualidad más candente (20)

PHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding stylePHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding style
 
Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and Practice
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
 
Ansible project-deploy
Ansible project-deployAnsible project-deploy
Ansible project-deploy
 
The Environment Restaurant
The Environment RestaurantThe Environment Restaurant
The Environment Restaurant
 
Giving back with GitHub - Putting the Open Source back in iOS
Giving back with GitHub - Putting the Open Source back in iOSGiving back with GitHub - Putting the Open Source back in iOS
Giving back with GitHub - Putting the Open Source back in iOS
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovsky
 
Docker for Development
Docker for DevelopmentDocker for Development
Docker for Development
 
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in BerlinDeploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
 
Modulesync- How vox pupuli manages 133 modules, Tim Meusel
Modulesync- How vox pupuli manages 133 modules, Tim MeuselModulesync- How vox pupuli manages 133 modules, Tim Meusel
Modulesync- How vox pupuli manages 133 modules, Tim Meusel
 
The Scientific Filesystem
The Scientific FilesystemThe Scientific Filesystem
The Scientific Filesystem
 
Wonderful world of (distributed) SCM or VCS
Wonderful world of (distributed) SCM or VCSWonderful world of (distributed) SCM or VCS
Wonderful world of (distributed) SCM or VCS
 
Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with Phing
 
Porting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidPorting your favourite cmdline tool to Android
Porting your favourite cmdline tool to Android
 
Optimizing Spring Boot apps for Docker
Optimizing Spring Boot apps for DockerOptimizing Spring Boot apps for Docker
Optimizing Spring Boot apps for Docker
 
Ripping web accessible .git files
Ripping web accessible .git filesRipping web accessible .git files
Ripping web accessible .git files
 
11 tools for your PHP devops stack
11 tools for your PHP devops stack11 tools for your PHP devops stack
11 tools for your PHP devops stack
 
Virtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayVirtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 May
 

Similar a Django dev-env-my-way

Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Michael Lihs
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsGR8Conf
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?AFUP_Limoges
 
What makes me "Grunt"?
What makes me "Grunt"? What makes me "Grunt"?
What makes me "Grunt"? Fabien Doiron
 
Prescriptive System Security with InSpec
Prescriptive System Security with InSpecPrescriptive System Security with InSpec
Prescriptive System Security with InSpecAll Things Open
 
Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Mandi Walls
 
Towards Continuous Deployment with Django
Towards Continuous Deployment with DjangoTowards Continuous Deployment with Django
Towards Continuous Deployment with DjangoRoger Barnes
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Fabrice Bernhard
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Pipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as CodePipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as CodeKris Buytaert
 
Deliver Python Apps with Docker
Deliver Python Apps with DockerDeliver Python Apps with Docker
Deliver Python Apps with DockerAnton Egorov
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios
 
IzPack at LyonJUG'11
IzPack at LyonJUG'11IzPack at LyonJUG'11
IzPack at LyonJUG'11julien.ponge
 
OSDC 2016 - Continous Integration in Data Centers - Further 3 Years later by ...
OSDC 2016 - Continous Integration in Data Centers - Further 3 Years later by ...OSDC 2016 - Continous Integration in Data Centers - Further 3 Years later by ...
OSDC 2016 - Continous Integration in Data Centers - Further 3 Years later by ...NETWAYS
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby TeamArto Artnik
 
InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017Mandi Walls
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment TacticsIan Barber
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsPablo Godel
 

Similar a Django dev-env-my-way (20)

Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
 
What makes me "Grunt"?
What makes me "Grunt"? What makes me "Grunt"?
What makes me "Grunt"?
 
Django
DjangoDjango
Django
 
Prescriptive System Security with InSpec
Prescriptive System Security with InSpecPrescriptive System Security with InSpec
Prescriptive System Security with InSpec
 
Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019
 
Towards Continuous Deployment with Django
Towards Continuous Deployment with DjangoTowards Continuous Deployment with Django
Towards Continuous Deployment with Django
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Pipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as CodePipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as Code
 
Deliver Python Apps with Docker
Deliver Python Apps with DockerDeliver Python Apps with Docker
Deliver Python Apps with Docker
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
 
IzPack at LyonJUG'11
IzPack at LyonJUG'11IzPack at LyonJUG'11
IzPack at LyonJUG'11
 
OSDC 2016 - Continous Integration in Data Centers - Further 3 Years later by ...
OSDC 2016 - Continous Integration in Data Centers - Further 3 Years later by ...OSDC 2016 - Continous Integration in Data Centers - Further 3 Years later by ...
OSDC 2016 - Continous Integration in Data Centers - Further 3 Years later by ...
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017InSpec For DevOpsDays Amsterdam 2017
InSpec For DevOpsDays Amsterdam 2017
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web Applications
 

Más de Robert Lujo

Natural language processing (NLP) introduction
Natural language processing (NLP) introductionNatural language processing (NLP) introduction
Natural language processing (NLP) introductionRobert Lujo
 
ElasticSearch - index server used as a document database
ElasticSearch - index server used as a document databaseElasticSearch - index server used as a document database
ElasticSearch - index server used as a document databaseRobert Lujo
 
Object.__class__.__dict__ - python object model and friends - with examples
Object.__class__.__dict__ - python object model and friends - with examplesObject.__class__.__dict__ - python object model and friends - with examples
Object.__class__.__dict__ - python object model and friends - with examplesRobert Lujo
 
Funkcija, objekt, python
Funkcija, objekt, pythonFunkcija, objekt, python
Funkcija, objekt, pythonRobert Lujo
 
Python - na uzlazu ili silazu?
Python - na uzlazu ili silazu?Python - na uzlazu ili silazu?
Python - na uzlazu ili silazu?Robert Lujo
 
Razvoj softvera: crno/bijeli svijet?
Razvoj softvera: crno/bijeli svijet?Razvoj softvera: crno/bijeli svijet?
Razvoj softvera: crno/bijeli svijet?Robert Lujo
 

Más de Robert Lujo (6)

Natural language processing (NLP) introduction
Natural language processing (NLP) introductionNatural language processing (NLP) introduction
Natural language processing (NLP) introduction
 
ElasticSearch - index server used as a document database
ElasticSearch - index server used as a document databaseElasticSearch - index server used as a document database
ElasticSearch - index server used as a document database
 
Object.__class__.__dict__ - python object model and friends - with examples
Object.__class__.__dict__ - python object model and friends - with examplesObject.__class__.__dict__ - python object model and friends - with examples
Object.__class__.__dict__ - python object model and friends - with examples
 
Funkcija, objekt, python
Funkcija, objekt, pythonFunkcija, objekt, python
Funkcija, objekt, python
 
Python - na uzlazu ili silazu?
Python - na uzlazu ili silazu?Python - na uzlazu ili silazu?
Python - na uzlazu ili silazu?
 
Razvoj softvera: crno/bijeli svijet?
Razvoj softvera: crno/bijeli svijet?Razvoj softvera: crno/bijeli svijet?
Razvoj softvera: crno/bijeli svijet?
 

Último

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Último (20)

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

Django dev-env-my-way

  • 1. Development environment for Django project - my way ! Robert Lujo, 2014
  • 2. about me • software • professionally 17 y. • python since 2.0, django since 0.96 • freelancer • more info -> linkedin
  • 3. “Software Development Environment” is …? I found no unique / unified answer …
  • 4. Software Development Environment (1) refers to a server tier designated to a specific stage in a release process. List of tiers: Local, Development, Integration, Test/QA, UAT, Stage/Pre-production, Production/Live Hm…! https://en.wikipedia.org/wiki/Development_environment_ %28software_development_process%29
  • 5. Software Development Environment (2) a collection of procedures and tools for developing, testing and debugging an application or program. Getting closer …! http://www.techopedia.com/definition/16376/development-environment
  • 6. Integrated development environment - IDE ! software application that provides comprehensive facilities to computer programmers for software development. … source code editor, build automation tools and a debugger... Intelligent code completion features ... compiler, interpreter, ... version control system and various tools are integrated to simplify the construction of a GUI ... class browser, an object browser, and a class hierarchy diagram. Closer and closer …! https://en.wikipedia.org/wiki/Integrated_development_environment
  • 7. Software Development Environment (3) contains everything required by a team to build and deploy software-intensive systems (where software is an essential and indispensable element) I approve!! http://www.ibm.com/developerworks/rational/library/define-scope-development- environment/index.html
  • 8. What is “everything”? Software development lifecycle (SDLC) • Planning • Designing • Implementation, testing and documenting • Deployment and maintenance https://en.wikipedia.org/wiki/Software_development !
  • 9. What about “a team”? Interacts with: • Software project management - organisation, coordination, covers: risk, change, software configuration and release management https://en.wikipedia.org/wiki/Software_project_management • Software development process a.k.a. software development methodology - e.g. waterfall, agile … https://en.wikipedia.org/wiki/Software_development_process
  • 10. My priorities 1. implement at least 90% of the most important requested features 2. shortest possible time needed for “from request to deploy” cycle 3. low-cost scaling - human/machines - initial setup of DevEnv or running system 4. ensure high quality deliverables
  • 11. ! now, the real stuff ! btw. where has Django disappeared?
  • 12. Initial setup - proj layout ~/env ├── proj-1 ├── cli-1 ├── … ├── biz ├── … └── proj-N
  • 13. Initial setup - proj layout ~/env/biz ├── archive ├── biz-web (GIT) │ ├── ... (to be continued) ├── biz-data(GIT) ├── biz-ie (GIT) ├── doc -> ln -s ~/Dropbox/…/biz/doc └── temp
  • 14. Initial setup - python proj layout ~/env/biz/biz-web (GIT) ├── bin ├── doc (sphinx,rst: readme,todo, │ install, ...) ├── pybiz (venv python installation) ├── reqs (base.txt, dev.txt) ├── src │ ├── (to be continued) │ ... └── var ├── biz.sqlite ├── biz-app.log ├── biz-jobs.log └── bulk-data
  • 15. Initial setup - django proj layout ~/env/biz/biz-web/src ├── bizproj (global project folder - formats, settings) ├── bizjobs │ ├── ... ├── bizapp │ ├── management / commands │ ├── migrations │ ├── scripts │ ├── templates │ │ ├── biz │ │ │ ├── components │ │ │ ├── backoffice │ │ │ ├── protected │ │ │ ├── public │ │ │ └── trial │ │ ├── admin │ │ ├── rosetta │ └── templatetags ├── locale (de/en) ├── media └── static (js, css, images, libs, fonts) # to bizapp?
  • 16. Initial setup - django settings ~/env/biz/biz-web/src/bizproj/settings ! base.py from .secret import * ! dev.py dev_demo.py ! test.py ! secret.py # not in git repo EMAIL_HOST_USER = "..." DATABASES = { ! secrete.py.template # is in git repo ! dbrouter.py testrunner.py
  • 17. Initial setup - .gitignore ! ~/env/biz/biz-web/.gitignore … pybiz var src/media/* secret.py fabfile_settings.py *.pyc *.swp *.pickle *.sqlite *.bak …
  • 18. File and directory naming • very careful in naming ! • naming convention - inherit existing + adaptations! • very careful in choosing folder/structure! • bigger files better than many files! • less files/folders is better than more!
  • 19. Project dependencies • as small as possible - more components -> more complex -> more integration/ upgrade/other issues • choose very carefully • proven, stable, I/team is familiar with • easily installable/upgradeable • adaptable (when possible) • when choosing new • read documentation/read reviews/choose several/experiment/make decision • bigger community -> better
  • 20. Project dependencies • solutions 1. make a script to setup everything from the scratch 2. install manually/reuse existing images and then freeze state in VM, Vagrant, Docker image 3. combine both
  • 21. Project dependencies • make a shell script • two types of dependencies • pip installable pip install -r reqs/dev.txt • pip non-installable • set of shell commands to install everything that is missing • Problem: different OS-es, e.g. OSX, Linux CentOS? if [ $(uname) == 'Linux' ] …
  • 22. Project deps - pip requirements ! ~/env/biz/biz-web/reqs ! base.txt : django>=1.5,<1.6 pillow reportlab johnny-cache markdown elasticsearch beautifulsoup4 lxml requests celery[redis] … ! dev.txt : -r base.txt south django_extensions django-debug-toolbar django-rosetta # for translation mock ipdb …
  • 23. Project deps - shell script ! non-PIP installables ! ~/env/biz/biz-web/bin/biz # chmod u+x ! case "$1" in env) if [ ! -d $BIZ_HOME/pybiz ]; then cd $BIZ_HOME sudo apt-get install python-devel sudo apt-get install python-pip sudo apt-get install python-xml sudo apt-get install elasticsearch ... pip install virtualenv virtualenv pybiz fi ! (to be continued …)
  • 24. Project deps - shell script ! PIP installables ! (continued …) ! if [ -f $BIZ_HOME/pybiz/bin/activate ]; then source $BIZ_HOME/pybiz/bin/activate echo "pip=`which pip`, python=`which python`” ! pip install -q --requirement=$BIZ_HOME/reqs/dev.txt ! cd $BIZ_HOME/src/bizapp export PYTHONPATH=$PYTHONPATH:$BIZ_HOME/src echo "== env 'BIZ' initialized, checking base packages" python -c"import django; print(' Django - ok v%s' % django.get_version())" python -c"import redis ;print(' redis - ok')" python -c"import celery ;print(' celery - ok')" python -c"import bizappp ;print(' biz app - ok’)" … fi ! (to be continued …)
  • 25. Project deps - shell script ! check services ! echo "== Is redis running?" ps ax | grep -v grep | grep redis !! echo "== Is elasticsearch running?" ps ax | grep -v grep | grep elasticsearch | awk "{print $1, $2, $3, $4, $5, "..."}" ! …
  • 26. Project management shell script • why? • to have one central place where to do project management • what? everything that needs automation • setup initial environment, update environment • open editor/IDE • run tests • deployment, remote management
  • 27. Project management shell script ! # biz ! Usage: ! *env - will initialize dev environment ! redis - start redis in background elas - start elasticsearch in background cel - start celery worker in background ! doc-update/du - will update doc/build/html wiki doc doc - will open doc/build/html/index.html - home of wiki ! log2 - will tail app log (if located in local var directory) ! run/n - django-admin runserver django/d - django-admin sp - django-admin shell_plus ! test-ping/tp - ping production test/t - django-admin test --settings=test_settings trans-make|tm - TRANSLATION - calls makemessages ! r/remote - will call fabric script for deployment and remote operations ! migrate|mig - do south migration - only dev system mig-auto - create new south auto-migration - only dev system ! browse|b - browse to localhost:8000 issues - browse to opened issues on bitbucket ! * - should be called with source/.
  • 28. Editor: ViM • although steep learning curve, is: • very adaptable • unique features philosophy • not in the way, very effective • personal preference: • I don’t feel comfortable in IDE • I like to be close to “bare metal” • to use editor designed for source code editing
  • 29. • personal preference: Editor: ViM • I don’t like plugins too much, only .vimrc • when working on the server to have the same possibilities • configuration • server scp ~/.vimrc user@server:/home/user/ • local development machine ln -s ~/Dropbox/env/.vimrc ~ • flavors • gVim / MacVim - GUI, ViM - on every server
  • 30. Development on the server • with project shell script one can do directly on the server • devenv setup/upgrade • webapp setup/upgrade • vim & shell-script -> do “live” development • run dev server
  • 31. File browser • personal preference: • I like side by side file browsers • usual file operations: create folders, check files, search for files, zip etc. • easy integration with editor (F4) • not found “one-to-rule-them-all” • TotalCommander, FreeCommander, DoubleCmd …
  • 32. Idea evaluation • evaluate a new idea or to test concept • ipython / django shell_plus • use reload: from biz import models models.test_something() # change models and save reload(models) models.test_something() • next step is - create a module/function
  • 33. • I use a lot Debugging • plain-old pdb or sometimes ipdb • conditional breakpoints: if i==500: import pdb; pdb.set_trace() • conditional breakpoints (2): try: bad_bad_code() except: import pdb; pdb.set_trace() • server side - logging, send emails on error logger.error(“this will be send by email) logger.error(“in try/except - will be send by email with traceback”)
  • 34. • Unit tests • integration tests Testing • “click-testing” - local development server • automating http requests to staging/production servers (from curl, nagios to dedicated services) • “click-testing” - staging/production servers
  • 35. Deployment • must be simple, automated, fast and reliable • usually: • setup environment • git push+pull / collectstatic / restart server • analyse logs • run integration tests on server instance • example: git ci -am”very important fix” biz r test upgrade prod upgrade
  • 36. Philosophy • “Unix philosophy by Mike Gancarz” filtered: Make each program do one thing well. Use software leverage to your advantage. Use shell scripts to increase leverage and portability. (btw. Store data in flat text files) https://en.wikipedia.org/wiki/Unix_philosophy
  • 37. Thanks for the patience! Questions? ! robert.lujo@gmail.com @trebor74hr