Avoid Django’s invalid HTTP_HOST error message

Avoid Django’s invalid HTTP_HOST error message

I have several Django projects published, and I constantly get my email inbox and log files inundated with errors of spiders and hack attempts to connect to my applications. Those error messages have the email subject: “[Django] ERROR (EXTERNAL IP): Invalid... My Python & Django deployment workflow and tools

My Python & Django deployment workflow and tools

//embedr.flickr.com/assets/client-code.js If you’re new to Python web development with Django, there are some things that tutorials don’t teach. Deploying to a server when you finish your local development can be a frustrating task. Here is a rundown of... Using Django models in external Python scripts

Using Django models in external Python scripts

Since Django 1.4 the syntax to import you models in external scripts has changed. The setup_environ method has been deprecated for a while and it no longer exists in Django 1.6. Assuming you’re using a virtualenv and your script is one directory outside the main...

Select sort algorithm explained with code and dance

Select sort is a very simple algorithm but it’s very inefficient for large lists, but it is good when memory is an issue, since it is an in-place sorting algorithm. Meaning it is an algorithm that doesn’t need to use extra memory to store sorted from...

Insert-sort algorithm explained with code and dance

Insert sort is a fast algorithm for small lists. On some languages, insert sort is used to sort small arrays (small sometimes means less than 10) instead of more complex algorithms because it’s fast enough and doesn’t need much memory. To perform...