Saturday, 11 May 2013

How to use Python in Web Application Development

Since last few weeks I have been Searching about How to develop Web Application using Python ?. Then I found solution to this question.

To use Python in Web Application or Web Development, you have to use Python Framework like Django, Pylons, web2py etc.

One of very Famous Framework is Django which is updated regularly. It is open source project. Web Application is very easy to develop with Django. Since Django is Python Framework, you have to have Python installed on your machine to run Django.

Python is directly available on Linux. To install python on windows visit How to install Python And rst2pdf on Windows platform. Now i Suppose you have python installed on your Machine.

There are two version of Django available to you.

  1. The latest official release and
  2. the development version.

Note: Official release is tested and stable version, while Development version contains latest features of Django.

Now download any version from https://www.djangoproject.com/download/.

How to Install Django on Windows and Linux?

Now for Linux run following Command to Install Django:

  • tar xzvf Django-1.5.1.tar.gz(Unzip the compressed file).
  • cd Django-1.5.1(Directory name may vary as per versino.)
  • sudo python setup.py install(terminal will ask for root password).

And For Windows

  • Unzip the tar file using 7-zip or other software.
  • Goto to directory that contains setup.py file.
  • Run python setup.py install command.

Now Django is installed on your Machine.To check installation Go to your Python interpreter then:

  • run import django command.
  • then run django.VERSION command.
  • You should see output: (1, 5, 1, 'final', 0) (Which shows version of Django on your Machine).

To Develop Website using Django you should have basic knowledge of Python.

Django is very famous for its documentation, So you can Start developing Website using this Framework. Documentation is available at https://docs.djangoproject.com/. Another Useful link is https://www.djangobook.com/


Was this helpful? Yes No

Ads: Ebay UK: ebay Best selling and shopping at:ebay

Thursday, 18 April 2013

How to use rst2pdf tool on Windows and Linux

In this post I am gonna write basic tutorial on how create PDF using Rst2pdf tool on windows or linux. Rst2pdf can generate very rich quality PDFs from lightly marked up text files(.rst).

It can be installed easily.On Ubuntu linux you can install it using "Ubuntu software centre". To see how to install rst2pdf on windows visit my previous post How to install Python And rst2pdf on Windows platform . Now I Suppose you have rst2pdf installed on your Computer.

Following code itself explains how to use this language. Following is a example code and its output:

Note: Space and NewLine is most important in this language.

Input:
Example File
============
.. contents::

.. section-numbering::

.. footer::

 Page: ###Page###/###Total###, Example file.

Section/Header 1
----------------

Texts underlined with '=' will be main header and 
Texts underlined with '-' are Sub-section.

Sub-section
~~~~~~~~~~~

Texts underlined with '~' will be Sub-sub-section

Text format
------------

Texts enclosed within **bold** will be Bold.
And those enclosed within *italic* will be Italicized

* ``Texts in double block-quote`` will lok different.

Auto numbering
~~~~~~~~~~~~~~
#. '#' will number the line automaticaly
#. this will be line number 2. 

Images
~~~~~~

.. image:: logo.png

you can specify attribute of image also

.. image:: logo.png
   :height: 140px
   :width: 250px
   :scale: 100
   :alt: alternate text

you can put inline images also:

Assuming |logo.png| is already there on your machine.

.. |logo.png| image:: logo.png
   :height: 10px
   :width: 10px

Block
~~~~~

* you can put any text like command in box using '::'. 
For example, to convert .rst to PDF enter following command ::

 rst2pdf myFile.rst

* you can number the line as follow:

.. code-block:: c
 :linenos:

 #include 
 int main() {
 printf("Hello World\n");
 return 0;
 }

Links
~~~~~

**Links** can be put in following manner

My Blog ``_

you can put **reference link** like this way.
For example, you can visit my blog  [#]_

.. [#] `<http://khuntronak.blogspot.com/>`_

Lists
~~~~~

* a bullet point using "*"

  - a sub-list using "-"

    + yet another sub-list

  - another item

Copy this code into file myFile.rst and Execute rst2pdf myFile.rst and it will generate myFile.pdf.

You can also run rst2pdf myFile.rst -o outputFileName.pdf .
You can see the output PDF file how to use rst2pdf - example file here.

There are many other things you can do with this markup language/


Ads: Ebay UK: ebay UK Best selling and shopping at:ebay