Saturday, August 28, 2010

Django Application : Create blog

Django : A Simple Blog Example

  First Create application in Django project directory
#python startapp blog
 Edit your file and add appilcation code 
For example :-
    # Uncomment the next line to enable the admin:
also add  Email host to send email.
by default its for locahost, but if your host have not configure EMAIL_HOST then you add this in 


 Edit Urls in main file in  project Directory. 
from django.conf.urls.defaults import *
from django.contrib import admin

urlpatterns = patterns('',
(r'^admin/', include(,
(r'^blog/', include('')),

Saturday, August 14, 2010

Automation Project is approved : And

Project registration for Automation has been approved.

Tuesday, August 10, 2010

Check Django version

Start the interactive Python interpreter
>>> import django

>>> print django.VERSION

Monday, August 9, 2010

Batch resize/Compress all images in a folder.

Make a new file (not as root):
Run In Terminal
#gedit ~/.gnome2/nautilus-scripts/batch640x480

and then Add
# Use this script to batch resize all images in a folder. 
# First open the folder and then use the script.  
for file in `ls -l` 
name=`echo $file | cut -f1 -d.`
convert -geometry 680x500 -quality 65 $file ${name}_680x500.jpg

Save this file and make this file executable:
#chmod +x ~/.gnome2/nautilus-scripts/batch640x480
Go to the folder you'd like to resize. Then rightclick and find the 'batch640x480' script.
I use this script for resizing large amounts of photo's for a website

Sunday, August 8, 2010

Drupal error : Function ereg() is deprecated

Its is very simple to solve
open file includes/ in drupal directory
Goto line no in which this error is show

where you can see something like this
elseif ($depth >= $min_depth && ereg($mask, $file))
Now add @ sign before ereg($mask, $file)
copy below line past this line
elseif ($depth >= $min_depth && @ereg($mask, $file))

Its works

Thursday, August 5, 2010

Python : CMS


A powerful, flexible Content Management solution that is easy to install, use and extend

Plone lets non-technical people create and maintain information for a public website or an intranet using only a web browser. Plone is easy to understand and use — allowing users to be productive in just half an hour — yet offers a wealth of community-developed add-ons and extensibility to keep meeting your needs for years to come.

Click here for further detail


Skeletonz is a new content management system (CMS) based on Python. It differs from others by being simple, but yet very powerful and extensible. If you need a simple system that you and your users are going love then Skeletonz might be the solution you are looking for! The system is open source and released under GNU GPL.

Click here for further detail

Wednesday, August 4, 2010

Django : Auto-Generate file from PostgreSQL / MySQL / SQLite database

inspectdb inspectdb
Introspects the database tables in the database pointed-to by the NAME setting and outputs a Django model module (a file) to standard output.
This feature is meant as a shortcut, not as definitive model generation. After you run it, you'll want to look over the generated models yourself to make customizations. In particular, you'll need to rearrange models' order, so that models that refer to other models are ordered properly.
Primary keys are automatically introspected for PostgreSQL, MySQL and SQLite, in which case Django puts in the primary_key=True where needed.
inspectdb works with PostgreSQL, MySQL and SQLite. Foreign-key detection only works in PostgreSQL and with certain types of MySQL tables.
Example :
Use command
#python inspectdb >>
this will automatically convert the django database into file .