Results 1 to 10 of 10

Thread: How to start creating webpage using python?

  1. #1
    Join Date
    May 2008
    Location
    Bontoc Mountain Province
    Beans
    54
    Distro
    Ubuntu Studio 9.04 Jaunty Jackalope

    Question How to start creating webpage using python?

    OBJECTIVE: create a simple website using python.
    PROBLEM: i don't know where and what to start with. can anyone suggest the best and simplest way to start?
    OPERATING SYSTEM: Ubuntu Jackalope

    thanks.............

  2. #2
    Join Date
    Oct 2005
    Location
    Seattle, WA
    Beans
    494
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to start creating webpage using python?

    Look into Django. It is a development framework based in Python. I've used it, works well. You can find plenty of tutorials online. If you run into anything you can't find, let me know and I'll help.
    www.runtime-era.com - Blog About My Journey as a Developer

  3. #3
    -grubby is offline May the Ubuntu Be With You!
    Join Date
    Aug 2007
    Beans
    Hidden!

    Re: How to start creating webpage using python?

    Quote Originally Posted by era86 View Post
    look into django. It is a development framework based in python. I've used it, works well. You can find plenty of tutorials online. If you run into anything you can't find, let me know and i'll help.
    +1

  4. #4
    Join Date
    Jun 2009
    Beans
    26

    Re: How to start creating webpage using python?


  5. #5
    Join Date
    Apr 2008
    Location
    London, UK
    Beans
    590
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to start creating webpage using python?

    If you want something simple, try cherrypy

  6. #6
    Join Date
    Oct 2005
    Location
    Davao, Philippines
    Beans
    4,831

    Re: How to start creating webpage using python?

    I also lean on cherrypy while also suggesting that you look into plone.

  7. #7

    Re: How to start creating webpage using python?

    Meh, frameworks take a long time to learn. Here's your get-started-in-30-seconds tutorial:

    Install everything:

    Code:
    sudo apt-get install libapache2-mod-python
    sudo a2enmod python
    Edit this file:

    Code:
    gksudo gedit /etc/apache2/sites-available/default
    Insert this after <Directory /var/www/>:
    Code:
    AddHandler mod_python .py
    PythonHandler mod_python.publisher
    PythonDebug On
    Reload apache:
    Code:
    sudo /etc/init.d/apache2 restart
    Insure apache is running by going here: http://localhost

    Make your first web-app:
    Code:
    gksudo gedit /var/www/hello.py
    Enter this:
    Code:
    def index(request):
    	return "Hello World!"
    Visit http://localhost/hello.py to see your running app.

    More:
    http://www.howtoforge.com/embedding-...on-debian-etch
    Last edited by curvedinfinity; June 22nd, 2009 at 04:45 PM.
    "Simplicity is the ultimate sophistication." - Leonardo da Vinci

  8. #8
    Join Date
    Oct 2005
    Location
    Davao, Philippines
    Beans
    4,831

    Re: How to start creating webpage using python?

    bah.. apache is bloated and overkill

    here's a get-started in 10 seconds.

    1. install cherrypy

    Code:
    sudo apt-get install cherrypy3
    2. save this as helloworld.py

    Code:
    import cherrypy
    
    class HelloWorld(object):
        def index(self):
            return "Hello World!"
        index.exposed = True
    
    cherrypy.quickstart(HelloWorld())
    3. then run helloworld.py!

    4. oops forgot, then go to http://localhost:8080
    Last edited by loell; June 22nd, 2009 at 09:56 PM. Reason: http://localhost:8080

  9. #9
    Join Date
    Aug 2007
    Beans
    31

    Re: How to start creating webpage using python?

    Quote Originally Posted by era86 View Post
    Look into Django. It is a development framework based in Python. I've used it, works well. You can find plenty of tutorials online. If you run into anything you can't find, let me know and I'll help.
    +1 for Django though if you want something simpler and more straight to the point then maybe Flask would be up your ally but, for a quality site which takes a little more effort, then I think Django is the way to go and it's still easy. It will prevent errors you didn't know existed and implement efficiency in wonderful ways you weren't expecting.

    P.S. It comes with a development server to run on demand whenever you want to test your site. It's not the server you want to use for the whole world when you publish but it makes dev and debugging a lot simpler.
    Last edited by jetole; September 13th, 2012 at 01:02 AM. Reason: Added "P.S."

  10. #10
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: How to start creating webpage using python?

    Old thread.
    Closed.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •