Friday, 30 January 2015

flask introduction and installation

after more days i have came back for give you something if you are new in python and web development and also you are not good in django then i will prefer you FLASK framework this is a nice and more easy framework and also flask have a good Document.
so if you wan to hands on django then i prefer at first start flask then django

Flask is a small framework by most standards, small enough to be called a “micro-framework.” It is small enough that once you become familiar with it.
But being small does not mean that it does less than other frameworks. Flask was designed as an extensible framework from the ground up; it provides a solid core with the basic services, while extensions provide the rest. Because you can pick and choose the extension packages that you want.
Flask has two main dependencies. The routing, debugging, and Web Server Gateway Interface (WSGI) subsystems come from Werkzeug, while template support is provided by Jinja2.There is no native support in Flask for accessing databases, validating web forms, authenticating users, or other high-level tasks. These and many other key services most web applications need are available through extensions that integrate with the core packages.

this is a small introduction of flask so now i will tell you how install and cooked your project in flask

ok now start flask installation first of all open your terminal and go to your project folder and next type bellow command

$ pip install flask

after some process your flask installation will complete so now you can write your code
first test a program because of your flask install completely
open text editer and copy bellow program and save by "" name

from flask import Flask
app = Flask(__name__)
def index():
    return '<h1>Hello World!</h1>'
if __name__ == '__main__':

after save file open terminal and type


next open your browser and type then you will see your first flask project output

continue ............

Friday, 28 November 2014

Monday, 27 October 2014

create thumbnail on image upload in django

Django does not provide any standard way of organizing thumbnails.
Even though community has some applications to work with thumbnails, they are usually over kill if You only want to create a thumbnail for an ImageField. So here is my solution to handle thumbnails.

To hande thumbnails I over-wrote my model's save method to read original image field into a StringIO, manipulate the image and save it into a thumbnail image.
first of you need a python PIL library so first install it :

sudo apt-get install libjpeg libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev
pip install PIL 

Here is the code.

Monday, 6 October 2014

x-mvc form validation

in new x-mvc i have added form validation it is so simple and usable

reference link :

How to use

Install from npm
npm install x-mvc
Instantiate a new form_validation object


/** construct a new form_validation object passing the data array to validate
  * date array should contain a set of objects formatted as following
  * {fieldName: value}
var data = {
    name: 'foo bar',
    email: ''
var form_validation = new req.library.form_validation(data);

Saturday, 27 September 2014

a pagination module/library for node.js (x-pagination)

today i have realize that this world not enough for future data then i think we need to hire MARS or other planet .

so can not all data in one page it will more time consumption and not reliable and page will open so slow and if you have more data then page will time out so then we need a mechanism where we can handle all data smoothly and systemically that we need pagination all data will split with a limit and show in different page.
so i have developed a module that will help create pagination in node.js
this is recently cooked by me you can find this in bellow link

bellow all detail

Friday, 26 September 2014

x-image-processing a image processing package for node.js



a simple image upload and processing module in node.js
and this image processing module under development but all time it usable
So hope this library help someone like me.

this module just cooked and i know this is not better test but i will try to give more better test so if you have any idea and suggestion so you can write in comment  i will be thank full for me
this image processing inherit from node gm package but this is more usable and simple and easy to use

Any ideas are appreciated.
follow bellow link


  • image crop
  • image resize
  • image upload

x-mvc a mvc package for node.js



today i will give a small description on a recent cooked mvc package this is developed for node.js and also this is so easy just download and use it and also it development on going for more better test you can check this in -

(if you have any idea or suggestion please write in comment it is very great full for me)

this is a simple node.js mvc structure this is a extended version of just-mvc it is more better of just-mvc. in this mvc we have added more feture like:
  • create slug
  • flush message
  • more comfortable structure