Thursday, October 11, 2012

Django-mapistration Posted to Pypi

So, a long awaited task got completed today.

On 2nd Oct, I published my first django app - django-mapistration , on django packages.

Today , I put this app on pypi as well. on this url.

So , a pip install django-mapistration would download the app


Feels AWESOME!!!!! 

Thursday, August 30, 2012

No sound after hibernate in Ubuntu 11.04 - the Natty Narwhal

This problem want there earlier, but came after a update .

To solve it, either restart or

sudo alsa force-reload

This reloads drivers..and viola ..u have sound

Friday, June 8, 2012

Testing Django facebook app with https


While working on Facebook app- Shine Ipledge , I had devised my own methods in order to test the app .

I had created two other FB apps for testing , one for local server and other for staging server. Staging was always identical to the main FB app on production server. It had a https server, self signed.

Earlier for locally testing app , I used to run the app using runserver command.
In its settings, it had a website url , which I added in my hosts file, and ran the app straight away
Basic problems were solved, but it lacked where I needed to see how my app looked on a facebooks canvas , with 760 width. !! Now since fb canvas app always runs on a https protocol, I needed to run my local server on https.

Running django local deployment server with https using django runserver command was not possible. All I needed was a server to deploy app on my local machine with https certificate. Initially I tried stunnel, but it didnt work for me.(If you would like try, try this link)

At last I went for Apache. I knew how to set up its configurations . Using openssh I created a self signed certificate, and used it to deploy the fb app.

If you are unclear, please go ahead ask questions in comment.

Thursday, May 31, 2012

How to Test Facebook App using selenium

I had given a lot of thought for building test cases for the FB app .
Major areas for testing were -
a) New user registration
b) Permission acceptance flow
c) Other features of the app. but most of which should be manually tested.

Enter, Selenium . It simple automate browsers.  Its really simple . I did the following

1) Fired firefox. Added Selenium IDE Plugin . It basically records user actions , initially in HTML which later can be exported to python or other supporting laguage.

2) After step 1, half work is already done   :)

3)  Now on to FB part. Here I was trying to automate New User Registration Flow. Here I needed a new test user everytime I run the script.

Enter , Facebook's Test User Api.
a) First get App Access Token
b) Then get a new test user credentials

4) Now include this flow in your test case, Call the script to get test user credentials, and login and go to app, and viola, Test Case Completed.

5) There is one small thing though, :) , the python exported test case gave error on the action when it tries to select frame of the app. Here we can use switch_to_frame method.

Rest all was a piece of Cake.
//Edit - Not exactly piece of cake, cause the test cases are performing a bit weird.  :)

Monday, May 21, 2012

Session problems in canvas FB app on IE

While building Shine App , I learnt a number of things . One of them is that IE doesnt store third party cookies . Because of this IE doesnt store session cookies of any app .

Particularly in my app, I needed sessions. Hence , on not finding one , I assumed session is lost and I redirected the user for re-authentication.

Solution of this is passing on specific headers, named P3P and giving them value as
CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"

I still havent figured out the meaning of these . Ill learn more about it in future.
 Web Development is definitely fun :)