rama
Comments
Reactions

Automatically backup mysql database to Amazon S3 using django (Python) script

By : rama

Many of us use Amazon S3 to backup  their mysql databases.As we do it so often we thought of writing an automated script which does this task of taking the backup of a mysql database and then moving it to the Amazon S3 .  Below is the django script .

download

   1: def upload_db_to_Amazons3():
   2: """ function which uploadd mysql database to amazon s3"""
   3:  
   4: AWS_ACCESS_KEY_ID = settings.AWS_ACCESS_KEY_ID
   5: AWS_SECRET_ACCESS_KEY = settings.AWS_SECRET_ACCESS_KEY
   6: BUCKET_NAME = settings.BUCKET_NAME
   7: MYSQL_DUMP_PATH = settings.MYSQL_DUMP_PATH
   8: DATABASE_NAME = settings.DATABASE_NAME
   9: ARCHIVE_NAME = settings.ARCHIVE_NAME
  10: .....
  11:  
  12: proc1 = subprocess.Popen(settings.MYSQL_DUMP_PATH+" --no-data  -u root -pwelcome   -x  --databases ...

more info..
Topics : Amazon mysql
shabda
Comments
Reactions

How to build a Facebook app in Django

By : Shabda Raaj

Facebook has a simple and robust API which allows users to build applications for the Facebook platform. We being the intelligent developers will use the superb Django framework to build our application.

The completed code for this is available at https://svn.uswaretech.com/favlang/. The completed application is deployed to facebook here.

How does a Facebook application work?

  1. The users make a request to apps.facebook.com/yourapp/page1/
  2. The Facebook servers make a request to yourserver.com/page1/
  3. You get the requests and can make calls to Facebook API, and use FQL to query the Facebook tables.
  4. You ...

more info..
Topics : facebook

How we built a Twitter Application

By : lakshman

Twitter, just like many other Web2.0 sites, has an excellent API. So much so, writing a twitter app is considered to be "Hello World" of Web2.0 Programming.

I wrote an application recently. It is DM++. By default, this application allows you to receive direct messages from twitter users you have @replied even if you currently don't follow them. You can even configure application to be able to receive direct messages from people you have @replied in only last 2 days, or receive Dm from all other twitter users.

Look how many people are currently complaining Cant DM ...

more info..
Topics : web2.0
rama
Comments
Reactions

Understanding DateTime, tzinfo, timedelta & TimeZone Conversions in python

By : rama

python-logo 3289799486_fd7df39a73

In this post we will look at the common operations that are being performed on dates & time ,  converting  a datetime from one timzone to another timezone.

Common Operations:             How to get the present datetime?

In [189]: cdatetime = datetime.now()
In [190]: cdatetime
Out[190]: datetime.datetime(2009, 2, 17, 17, 34, 58, 407806)
It returns the current localdate and time.When i print cdatetime it  printed as a tuple of nine elements
(2009=year, 2=month, 17=day, 17=hour, 34=minutes, 58=seconds, 407806=microseconds, tzinfo is None and is not printed)
what each element in tuple represents ...

more info..
Topics : datetime

Django popular stories Widget

By : rama

At uswaretech we strive hard to keep track of the latest happenings in Django.To assist  in this  we have created a Django popular stories widget which lists down the popular stories in django.We are writing about it as we wanted to share this widget to the django community to who, it may be helpful.Please have look at the widget which is appearing at the bottom of this post.And also the source code of this widget is available to everyone who want to use in their own applications.More details at the bottom of this post.

How ...

more info..
Topics : utilities
© Agiliq, 2009-2012