Showing posts with label My First. Show all posts
Showing posts with label My First. Show all posts

August 12, 2011

Simple way to get the "facebook message stream" on "Google+" .

August 12, 2011 0
Get the facebook message stream on google plus.

Download the extension Click here
For Google-Chrome Chrome extension
It's simple, easy to set up.
This extension support Internet Explorer 7+, Firefox 3.5+ and Chrome.
Install the extension and restart the WebBroser,you will get the "Facebook" button on Google+.

Here is my G+ account snapshot .
















Tutorial video from CrossRider


To get more information Click here


Read more...

June 13, 2011

Django-nonrel with mongoDB

June 13, 2011 2
Hi friends , I'm working with Borgets Solution. Recently I made a simple application on Django-nonrel with backend mongoDB.
Django-nonrel is an independent branch of Django that adds NoSQL database support to the ORM.Read more about the django-nonrel Django-Nonrel ...
I feel its somewhere bit complex to configure mongodb as backend on "Django-Nonrel" and make "Django-Administration" working.
lets start.

Installation


If you like to use Virtual-environment , then you can use it . Install pymongo
You need setuptools for installing pymongo , dont worry dunring installation of Pymongo , autamatically setuptools should be downloaded .
  • Download pymongo
    extract pymongo.tar.gz folder and install .
    	ashish@developer:~/Downloads $  tar -xzvf pymongo.tar.gz
    	ashish@developer:~/Downloads $  cd pymongo 
    	ashish@developer:~/Downloads/pymongo $ sudo python setup.py install 
    
  • or you can use $ easy_install pymongo

Install djangotoolbox
  • Download SourceCode of djangotoolbox and extract it > DjangoToolBox
    extract django-toolbox zip file and install .
    	ashsih@developer:~/Downloads$ unzip wkornewald-djangotoolbox-.zip
    	ashsih@developer:~/Downloads$ cd wkornewald-djangotoolbox-
    	ashsih@developer:~/Downloads/wkornewald-djangotoolbox- $ sudo python setup.py install
    

Install Django-nonrel
  • Download SourceCode of Django-Nonrel and extract it > Django-Nonrel
    	ashsih@developer:~/Downloads $ unzip wkornewald-django-nonrel-.zip 
    	ashsih@developer:~/Downloads $ cd wkornewald-django-nonrel- 
    	ashsih@developer:~/Downloads/wkornewald-django-nonrel- $ sudo python setup.py install 
    
Install MongoDB
  • Download MongoDB from official site of MongoDB and extract the Tar.gz package .
    I am using 32-bit . please prefer MongoDB installation on Linux
    	ashsih@developer:~/Downloads$ tar -xzvf mongodb-linux-.tgz 
    	ashsih@developer:~/Downloads$ cd mongodb-linux- 
    
  • Create a data directory
    	$ sudo mkdir -p /data/db/
    	$ sudo chown `id -u` /data/db
    
    You can also tell MongoDB to use a different data directory, with the --dbpath option.
    Run and connect to the server make sure that you are in MongoDB package folder .
    	ashsih@developer:~/Downloads$ cd mongodb-linux-/bin/
    	ashsih@developer:~/Downloads/mongodb-linux-/bin/ $ ./mongod				
    

Install django-mongodb-engine
  • Download source code of django-mongodb-engine from here > Django-MongoDB-Engine and extract it .
    	ashish@developer:~/Downloads$ unzip django-nonrel-mongodb-engine-.zip 
    	ashish@developer:~/Downloads$ cd django-nonrel-mongodb-engine-
    	ashish@developer:~/Downloads/django-nonrel-mongodb-engine-$ sudo python setup.py install
    

Phew !!! .. finally we completed .... :)

Let's start developing Django applcation


create new django Project
	$ django-admin.py startproject djangobookmarks
	$ cd djangobookmarks/ && python manage.py runserver
Open your browser and check > "localhost:8000" address
create new django application
	$ django-admin.py startapp bookmarks

Configuration

Database setup is easy as native django with sqlite3. Open "settings.py" and setup database "mongodb_engine".

DATABASES = {
'default': {
'ENGINE': 'django_mongodb_engine', # Add 'postgresql', 'mysql', 'sqlite3' etc.
'NAME': 'newdb', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '27017', # Set to empty string for default. Not used with sqlite3.
}
}

Lets start mongodb engine

$mongod
$mongo

Run server
$python manage.py runserver



Yeah,Now start developing your application as other databases.Here I'm not going to teach in details.please read "django docs"

Django Admin Activation.

If you want to use Django Administration,Than it is bit tricky..
Open "settings.py" and add "django.contrib.admin" in INSTALLED_APPS.

INSTALLED_APPS = (
...default apps...
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin doc.:
# 'django.contrib.admindocs',
'bookmarks',
)

Open "urls.py" and "uncomment the lines to enable django administration"

from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

from bookmarks.views import *

urlpatterns = patterns('',
.....
# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
)

Here is my "models.py" .

from django.db import models
from django.contrib.auth.models import User

# Create your models here.
class Link(models.Model):
url=models.URLField(unique=True)
def __unicode__(self):
return self.url

Bookmark(models.Model):
title=models.TextField(max_length=100)
user=models.ForeignKey(User)
link=models.ForeignKey(Link)
def __unicode__(self):
return self.title


create "admin.py" in application directory and register the models in django admin.

#!/usr/bin/env python
from django.contrib import admin
from bookmarks.models import Link,Bookmark #Models
admin.site.register(Link)
admin.site.register(Bookmark)


It will works without "django site".

Django Site registration
For more information visit django's documentation for The "Site" framework

Open "settings.py" and set SITE_ID for django_site(django administration).

Note :
Default SITE_ID is "1".That's for SQL based databases,but NoSql based DB generates Alphanumeric object Id.so we need to set that id here.
Open terminal and write.(for mongoDB)

$mongoexport -d (database_name) -c django_site
#example
$mongoexport -d mydatabase -c django_site

now,copy "id={}" and set SITE_ID="xxxxxxxxx" in "settings.py".
SITE_ID = '4dbea69bc9ce44192b00001d'



$python manage.py mongod
$python manage.py syncdb
$python manage.py runserver



Download Django_bookmark code
Thanking You !!!
Read more...

April 18, 2011

Testing with Google Appengine.

April 18, 2011 0
Yesterday in the evening ,
When i was seated in front of my computer than suddenly something comes in my mind.....
From a long time i never used Google App Engine ,Lets check my appengine knowledge.
With Appengine Docs i started writing the application and finally i did.

check it-Greeting App Engine

Its a simple greeting application based on GAE's helloworld example...
Also U can use ur gmail id to post greetings.

Lol.... ;-)
Still I know GAE..ye yippeee.....
Source code on bitbucket.

Read more...

April 13, 2011

My first play-framework application : DentoX2 - A System For Dentist

April 13, 2011 0
Hey everyone,
Thanks to all members of Play-googlegroups and my friends Priyanka & Pavan who help me to solve my technical doubts.
Finally i finished my Academic project in Play-Framework,It was most pleasing days of developing application with play,and really the result was probably the best.
The Project is "Dental Clinic Management System" with the name DentoX2 (suggested by priyanka )

UI theme for Administrator>Pillu-Web app theme

For more information
on DentoX2 visit the link....
    1. Dentox2 design
    2. DentoX2 Presentation
    3. DentoX2 Documentation

    Website :



    Blogging support :



    Administration Login :



    Administration Home Page :



    Patient List :



    Patient Form : with JQuery Date and time picker.



    FaceSheet :



    Appointment :with JQuery Calender .




    Read more...

    July 16, 2010

    Another adventures and experiments with Play on my Linux !!

    July 16, 2010 0
    Hey everyone,
    Along with my recent adventures and experiments with Play, I decided to force myself to become more proficient with Play. For all those who don't know what “Play” is , I will give u all a just of it..

    The Play framework is a clean alternative to bloated Enterprise Java stacks.

    I think its very nice framework to make web-based application by using any editor like Komodo or Emacs,and it provides libraries for database access,error handling,templating framework and session management,security,an automated test suite, a shiny web interface and an administration area and it also provides the codes for reuse.


    so, if u still feel like I need to be set straight,any suggestion or any question,Send me an email.

    Anyway,
    I have been using Linux since about 2007.
    I had JAVA self extracting file which was given to me by Mr. Jitendra Vishwakarma.
    So,I tried to run play in my Linux with the help of documentation.
    I had java ,but "i don't know how to install it?"

    Ever since I first started using Linux, I have been using Terminal for installing most of software's and applications...even today I do so.. ,
    really I don't know many commands of Linux.


    So, once again I started searching on Google about "how to install java in Linux ". I found solution for it and I dabbled with a tutorial here and there...and finally I get the java on my Path.

    My recent experiment with JAVA Installation has proved to be very fruitful, I say so to myself.

    If anyone is much interested to know "how to install the java in Linux?",then follow the instruction and commands.

    ~~~~~~~~~~~~~~~~~~~~~~~~
    Download and copy jdk-6-linux-i586.bin to $HOME/src (or a location of your choice).
    type>>
    % su -

    (some linux use "su" command and some don’t. So in such a case, use the "sudo" command and it will prompt you for a enter admin password. once u have entered the password it will not ask u again and again during the editing, deleting, moving the files .)

    "I don't know much about the RedHat and the Solaries,but as I have worked on ubuntu based linux, it accept the "sudo" command...."

    ~~~~~~~~~~~~~~~~~~~~~~~~

    #su (or sudo)
    # mkdir /usr/java (if it doesn't exist or start the line with "sudo")
    # mv $HOME/src/jdk-6-linux-i586.bin /usr/java (if it doesn' start line with "sudo")
    # cd /usr/java (if it doesn' start line with "sudo")
    # chmod +x jdk-6-linux-i586.bin (if it doesn' start line with "sudo")
    # ./jdk-6-linux-i586.bin

    ~~~~~~~~~~~~~~~~~~~~~~~~
    It will extract all the files of java and install it in your system.
    ~~~~~~~~~~~~~~~~~~~~~~~~
    Set the PATH and JAVA_HOME environment variables: (/etc/profile, $HOME/.bashrc or $HOME/.bash_profile).

    PATH=$PATH:/usr/java/jdk1.6.0/bin
    JAVA_HOME=/usr/java/jdk1.6.0
    export PATH

    ~~~~~~~~~~~~~~~~~~~~~~~~
    for more information about Java Installation try this "Enterprise Java for Linux HOWTO".

    After installing the java,I started developing the Simple Web-Application in Play.
    Here are the steps of creating application.

    Installation of play is very simple.
    Just download the latest binary package from the Play download page and unzip it to any path. Play uses command line a lot for creating,running and testing the application,it’s better to use a Linux or MacOS ,if you are using windows,its also fine.

    Play is correctly installed,now start Creating a Play application is pretty easy and fully managed by the Play command line utility.That allows for standard project layouts between all Play applications.

    Open a new command line and type:

    $python play new helloworld

    It will creates a new helloworld application.
    now we need to test it if its working or not?

    For run the application>Open a new command line and type:

    $python play run helloworld/

    Play will now load the application and start a Web server on port 9000.
    You can see the new application by opening a browser to
    http://localhost:9000


    Here is the snap of the simple " hello-world "application and "how to set the JAVA_HOME path in snap"

    And follow the Documentation for making "helloworld" application.

    Click On the Image
    To See The Tested "Hellowrld" Application.

    Read more...

    July 14, 2010

    My first Encounter with PlayFramework !!!!

    July 14, 2010 2
    Its a story very funnny and yet close to my heart...
    I just thought to share this with you.

    One month prior,everything in my life was going fine and very smooth. I was very happy with my python,my Django and was very engrossed in making different different application as a testing. I was so much happy and content with my work.. It seems that i got everything I'm my life. Don't want anything else now..

    Now as I'm in Final year of my Computer Science course i decided to make a very dynamic application which i haven't made yet,something big and challenging which will be my best work uptil now and i should reach my satisfaction level.....

    The day wen i went to college and i was still very happy with my plannings.. But the moment wen i got syllabus from my class teacher "Mr. Aishwarya Garg" and wen i just glanced on it..all my excitement was shattered....... projects have to be made either in "JAVA" or in ".NET"...

    That day was the worst day...I was very sad and totally discontent.... I wanted to pursue something big in Python...It's my passion....i just wanted to work in it only.... whole day i was thinking about python,syllabus,.Net and JAVA....My head was spinning between all of them....

    Finally at night when i came out of trauma that i was going through during the whole day... i started thinking now what should i go with.... I m not interested to learn "Dot Net" because most of my friends are going to make "Windows Application" using ".NET "...
    so i was not willing to think about it...I just ignored it.....

    The only option left was to select "JAVA"...
    "JAVA" was something that i am not interested to learn it for project, i also don't love it as the way i love "PYTHON"...but anyhow i made my mind and selected "JAVA" in utter pain....

    I decided to make a "web application in java...." but i don't know much about it excepts for the basic concepts.... but that was not a prob...."

    I told myself "MERE PASS GOOGLE HAI"...
    This word came from my Guru "PAVAN" who taught me to "how to use Google ?" and always he told me "Google Se pooch ! " . So thanks to him.
    " GOOGLE gives me all my answers.... "

    I started my rigorous searching on Google about "WEB-FRAMEWORK IN JAVA ".
    I'm searching...searching......but nothing excited me as my Python and Django
    I just love them....
    My search was going on and on and on...
    Then it was around 3am morning wen i started getting tired and sleepy....but i dont want to give up....i don't wanted to sleep....all that i wanted was to search something that excites me....

    I started getting hungry, i went in kitchen to search something so that i will not get sleep....
    I got my favorite "PARLE 20-20 (Short may niptao)"
    My mom anyhow came to know that I'm still awake and she started shouting at me...
    "kitna pareshan karta hai...din may bhi nai sota and raat may bhi jaagta rehta hai...kab soega...soja"
    but I hate wen somebody disturbs me in my work....
    I told her "Mom tum so jao...main thode der me sounga..."

    Now I sat in front of My Computer and started eating cookiee biscuit ...and again continued hunting for web framework........
    I found many "java web-frameworks".when I came across Cocoon.....But my mind said NAaaaa its not interesting.......Then "Cricket"...."hmm sounds good" but i was excited to know more about other java web-framework...
    I just opened my notebook and wrote the name "Cricket" and continued searching.....
    heehehehe.... then i came across "Spring,Struts,Tapestry " etc....
    but they were heavy ..
    it dint excited me.......
    I got irritated but still kept my search on......
    Then as i was surfing... and i wrote on Google "light-weight web-framework for java".....then I selected one hyperlink....
    Then something flashed in front my eye.....something that had a very excited name....... and I suddenly stop and read it.......

    It was "PLAY"............what...play...What is it? i started scratching my head....the moment i clicked on it,all my prob came to an end....It has got a exciting name....then even i thought to play with it....I stared reading its documentation over and over an over....
    I just cant stop reading it....plus its features and concept excited me.....It had a flavor like "Django" and "Ruby on Rails" that was the thing that increased my excitement and expectation a lot.... It was light,scalable,fast and robust and many more...more ...and more......wow...i was so happy with it...... I saw the demo video and thought that it is very easy to work with and something that i can do along with my TY studies and my python..plus it has got a beautiful look and feel and Admin facility just as my Django gives me....I quickly downloaded the software..and start testing in Windows XP.

    I started discovering it more and more and more.......It was around 5am in morning...i got tense that whether i should go to college or not...but i didn't care much about it...i started installing it following all the steps written in Documentation....

    But then i started getting error.... i was trying and getting seriously confused that I'm installing the way it should be....But man y it is not happening....y.....whats the prob yaar....
    Then it showed a error.....

    "sh:./play: /usr/bin/python: bad interpreter: no such file or directory"



    It means it requires "Python".......what python.....I got excited but was also confused.....Then i started intense investigation....Out of all my Curiosity,I came to know that PLAY Framework which is a java web framework is using python...

    Why Python ?? it was my first question..so i got the answer..
    ""
    We need a lot of scripts to manage Play applications, like creating a new application, running it, launching a browser, etc… Of course we could write these in Java directly. But running a Java VM for simple tasks like project creation is very slow. And Java itself is very limited when it comes to OS interaction.

    Python allowed us to write these scripts in a completely portable way. It’s fast to run, easy to write and available out of the box on most systems. It’s not on Windows, that’s why play comes with the bundle of a "Windows Python binary" with the framework.
    ""

    .....wow.........i was so happy that time.....somewhere I'm using python too in my project........really it made me smile and all my search was not in vain.....
    I finally selected it for my project...... I was so so so happy.......

    I told this to all my friends.....They heard this for the first time....They gave me a very bad expression and suggestion....But huh...who cares for them...I told this to my mam, she gave me a very blank look ......but I have decided to go with it, so no body can change my mind....I have not selected it for the purpose of job or anything....It was something new that i came across, wanted to try it,
    Play with it and give my best in it....... then i made a small "Hello World" application. It boosted my confidence......
    I started working on it more and more and more.......This was my feelings before and after selecting the project..... Though it was sad in the beginning....excited and surprising in he middle but it was totally best at the end..........
    Now wen i remember that day,,it brings smile on my face... I laugh for the way i searched and selected language.......
    hehehe.....

    see more about Play Web framework
    Read more...

    May 02, 2010

    Follow Us @soratemplates