Python-Django-DevOps Documentation Release 0.1 Daniele February 12, 2015
Contents 1 The community 1 2 Wisdom 3 3 Recipes 5 4 Contributing 7 5 Contents 9 5.1 Wisdom.................................................. 9 5.2 Recipes.................................................. 9 5.3 Contributing............................................... 10 6 Indices and tables 11 i
ii
CHAPTER 1 The community #django-devops on irc.freenode.net http://groups.google.com/group/python-devops 1
Python-Django-DevOps Documentation, Release 0.1 2 Chapter 1. The community
CHAPTER 2 Wisdom Comments, judgements and advice on different approaches, tools, methodologies etc. 3
Python-Django-DevOps Documentation, Release 0.1 4 Chapter 2. Wisdom
CHAPTER 3 Recipes Step-by-step cookbook-style tutorials designed to take inexperienced users all the way to a working setup of whatever is being introduced. 5
Python-Django-DevOps Documentation, Release 0.1 6 Chapter 3. Recipes
CHAPTER 4 Contributing Feel free to contribute anything! The Python/Django DevOp s Book of Wisdom and Recipes is not going to be much use if there are only apprentices and no sorcerers adding material to it. 7
Python-Django-DevOps Documentation, Release 0.1 8 Chapter 4. Contributing
CHAPTER 5 Contents 5.1 Wisdom 5.1.1 Online tools Security http://ponycheckup.com By Erik Romijn. Erik s pony checkup is an automated security checkup for Django websites. There are several security practices that can easily be probed from the outside, and this is what Erik s pony checkup looks for. Availability, uptime and monitoring https://www.pingdom.com Real-time monitoring. Plans from $10/month, with a free trial. 5.1.2 Server-side tools Self-inspectors https://github.com/evildmp/django-inspector By Daniele Procida. Django Inspector inspects and reports on Django sites. Starting at the site s / URL path, it will use the built in Django test Client and Beautiful- Soup to work its way through all the pages it can find links to on the site, and will report in various ways on what it has found. Useful for discovering broken URLs or obscure pages that throw errors. 5.2 Recipes 5.2.1 Using version control for your Django your project directory Your Django project directory needs to be treated with as much care as your applications. If you ever need to set up a new instance of the project (for example to set up a new development environment) you ll want the process as to: be as easy and quick as as possible replicate your live project precisely One way of doing this is to manage your project using version control, so that it can be cloned, branched, rolled back and otherwise managed in the same way as any other material you use version control to look after. 9
Python-Django-DevOps Documentation, Release 0.1 Required expertise basic use of version control software How to do it Create a new repository on your version control repository hosting service (GitHub, BitBucket, or whatever you like best) for the project. If you have an account that will allow you to create private repositories, use that. Initialise the project directory for version control. In Git, for example: git init Configure the version control system so that it ignores the file paths and types that you don t want include. In Git, this involves entering some patterns into a.gitignore file at the root of the repository, for example: *.pyc secret_settings.py processed_thumbnail_files temporary_uploads So, in this example we are excluding all compiled Python files, a file called secret_settings.py (if you don t have a private repository, you don t want to put secrets in it), a directory of rendered rather than source files, and a directory of files that don t need to be kept anyway. You will need to spend some time carefully setting up this aspect of configuration, to make sure unnecessary and worse - sensitive - files do not end up in a public repository. Danger: Your settings.py file contains sensitive information such as database passwords. You absolutely do not want to publish this information. One solution to the problem of sensitive information in your settings is to go through your settings file, carefully, and move that sensitive information into a file called for example secret_settings.py, and then, in settings.py: import secret_settings.py You ll have to keep the secret_settings safe somewhere else. 5.3 Contributing 5.3.1 Style guide In order to keep the formatting of book consistent, please try to follow the markup styles already used throughout the book. Please wrap lines at 78 columns See The page of example markup for a full set of markup examples. 10 Chapter 5. Contents
CHAPTER 6 Indices and tables genindex modindex search 11