A blog about Django, Python, mongo DB, LINUX, Amazon Web Services


Amazon SES - Handling Bounces and Complaints

Posted On 14 January 2013 By MicroPyramid

In general while sending emails, we will prepare some recipient addresses as our mailing list, which are valid and our recipients want and expect our mail. But some times, some emails which are invalid will bounce, and if valid recipients do not want your mail, they may mark your email as spam in their email client. High bounce and complaint rates put your account at risk of being shut down. So in order to avoid such problem we'll handle the bounces and complaints

Hosting Django Application with Nginx and UWSGI

Posted On 17 December 2012 By MicroPyramid

Django is a python based web- application development framework. Setting up a sample app and running it as easy as pie. Nginx is a webserver and like every other webserver it has it Pro's and Con's. Nginx was an answer to concurrency issue(handling thousands of concurrent connections) faced in apache and raised to fame.

Amazon AWS IAM Roles and Policies

Posted On 04 December 2012 By MicroPyramid

When You want to Provide access to Amazon Web Services Console or if you're planning to provide REST API Keys to your Developers of a Third Party Person, Using Providing access to Root Account Console or API Keys is not advisable since they basically will have full level access. Instead we can rely on IAM(Identity and Access Management).

CORS with Amazon S3 and CloudFront

Posted On 24 November 2012 By MicroPyramid

We struggle to load fonts from CloudFront because of CORS.

CORS - Cross Origin Resource Sharing is a security measure to block macious scripts or resources loading from foreign domain origins. This security will become hurdle when want to load resources from Amazon CloudFront. this is often encounter when we want to load fonts from CloudFront. Here is simple yet detailed steps to enable CORS on CloudFront.

Python Web Scraping with Beautiful soup

Posted On 05 November 2012 By MicroPyramid

Download all One Piece animation series episodes by scraping site using BeautifulSoup python library.


Posted On 21 October 2012 By MicroPyramid

The group() command, Aggregation Framework and MapReduce are collectively aggregation features of MongoDB. group(): Group Performs simple aggregation operations on a collection documents. Group is similar to GROUP_BY in mysql. Output format : Returns result set inline. Sharding: Its not support in shared environment. Limitations:

Django Generic many to many field implementation

Posted On 16 October 2012 By MicroPyramid

Django application has a GM2MField that combines the features of the standard Django "ManyToManyField" and "GenericForeignKey".

pip install django-gm2m

Daemonizing any command with SUPERVISOR

Posted On 12 September 2012 By MicroPyramid

Daemonizing a command means to make it run as a background process.

so when we have a command that we want to daemonize there are many ways to do it, most common methods are:

1. using upstart
2. adding it to /etc/rc.local
3. creating a script in /etc/init.d and adding them to runlevel folders manually (i.e. incase you want to start, stop a command)

Django Subdomains to do advanced things

Posted On 05 September 2012 By MicroPyramid

We always struggle to give users customization's even before they login to the system like abc.micropyramid.com and django don't know how to handle that out of the box.

We can do it by writing simple middle ware. Django Middle ware have access to request and responses, so, we can get hold on to request and pass it on to django views for further process. Here we will add new property to request and can render pages by seeing at the subdomain property.

Using Django's built in signals and writing custom signals.

Posted On 13 August 2012 By MicroPyramid

Django has a beautiful feature of signals which will record all the actions performed on particular model. In the current blog post we’ll learn how to use django’s built in signals and how to create custom signal.

Django has lot of built in signals like pre_save, post_save, pre_delete and post_delete and etc. Now we’ll learn how to use django’s pre_delete signal with a simple example. In the way we use pre_delete in the present blog post we can use other signals also in the same way.

Need any Help in your Project?Let's Talk