How to create a login screen using core python language without using any framework

Hans Mulder hansmu at xs4all.nl
Fri Oct 5 05:29:09 EDT 2012


On 5/10/12 10:03:56, shivakrshn49 at gmail.com wrote:
> I need to develop a simple login page using Python language with
> two fields and a button, like:
> 
>     Username, Password, Login
> 
> I know there are some beautiful Python frameworks like
> 
>     Django, Grok, WebPy, TurboGears
>
> which support web development using Python, but mine is a basic
> requirement consisting of only 3 screens (pages):
> 
> * 1st page  -  Login page (Redirects to 2nd page when login button
>   is clicked) 
> * 2nd page  -  Page with records in the form of a list, with an
>   option for adding new records (Redirects to 3rd page when "Add
>   Records" button is clicked)
> * 3rd page  -  Page with fields, which are saved as records for
>   the list on 2nd page  (After entering details and clicking Submit)

Implementing your application using any of those frameworks you
mentioned, would be easy.

> So, I have decided to develop the above functionality using Python
> **without** using any framework, so that I can have flexibility as
> well as write my own code. 

This is a bad idea.  You'll get much more flexibility using
an existing framework then you'd ever achieve by reinventing
the wheel on your own.  Especially if you have no experience
in this field.

> 1. Is it possible to create a login page using Python without
> using a framework?

Yes.

But it's a lot of work.  You'd effectively be rewriting all
the functionality you'd get for free with a framework.  And
it wouldn't be as flexible, because frameworks can flex in
directions that you didn't think of.

> 2. I haven't worked on web services and don't know the basics of
> web development in Python.

In that case, your chances of success are fairly slim.

> 3. If possible, can you provide me an example on how to create a
> login page using Python and achieve the functionality described
> above?

The frameworks you mentioned earlier come with tutorials.
These tutorials contain such examples.

You should really use an existing framework.  Once you're
aware of how much functionality you get out of a framework
(any of them), you wouldn't dream of rewriting all that
functionality on your own.


Hope this helps,

-- HansM








More information about the Python-list mailing list