Skip to main content

Posts

Showing posts with the label deployment

Django: How to debug Django

There are several ways of debugging Django. I'll try to cover most common and tell what I know/use time to time. This article may become useful to Django newbies and is not intended to be "the only truth". It may help you know in general about debugging techniques commonly used in Python/Django projects that author is aware of. Let's get started. There are several methods to discuss here. 1. Print out into console. It may become handy while working with critical bugs that only appear in production for e.g. and are not traceable at development environment... The only way here to run your project manually and do debug in production. Those requirements are so rare that I only use standart (builtin) tools. There is a thing called PDB (Python Debugger). That comes in a standart set of usual python distribution. So it will be available to you at almost any environment where you have console access to your project. Here is an official documentation for pdb module ....

Automating everyday system routine with Fabric (Python)

Lets talk about your console work. I use it on everyday basis. I need to log on to  my deployment/stage/whatever, server and do some redundancy. E.g. download some logs, clean up some caches and/or redeploy something. Here is the occasion, when  Fabric  comes handy. You can eliminate all the redundancy and cover tons of operations you need to do every day, using console, shortcutting them to one of your simple commands, like:  fab deploy_production -H root@mydeployment.com  interested? Let's move on then. Notie this command is not a masterpiece, but must give you the understanding of usual workflow. 1. Installation and purposes Let's go ahead, installing Fabric and automating some simple operations. You can read  official docs  about alternative methods. But installation is fairly simple. And is the matter of typing: $pip install fabric Nothing more special is required. You will need fabric at system wide scale. I install...