EzDevInfo.com

web2py

Free and open source full-stack enterprise framework for agile development of secure database-driven web-based applications, written and programmable in Python. web2py Web Framework

@Rails users: have you tried web2py? Pros? Cons? [closed]

web2py to is a Python framework but shares the "convention over configuration" design that Ruby on Rails has. On the plus side it packages a lot more functionality with its s standard distribution and we claim it is faster and easier to use.

Has any Rails user tried it? What is your impression?

No rants please. Just technical comments.


Source: (StackOverflow)

is there a Heroku type hosting solution for python/web2py?

I am interested to know if there are any python/web2py hosting platforms similar to Heroku for Ruby on Ralils? Something that is easily configurable and scalable?


Source: (StackOverflow)

Advertisements

How can I use modules in web2py?

I have some functions in func.py that I would like to access from my web2py controller called default.py. I tried to import and use func.py in default.py with "import func" and "calculatesomething = func.calculatesomething", but it doesn't work. The file func.py is also added in the Modules section of my web2py program.

Why it is not working? How can I make it to work? Should the module be in func.py or default/func.py or something else?


Source: (StackOverflow)

Credit card payments and notifications on the Google App Engine

I ported gchecky to the google app engine. you can try it here

It implements both level 1 (cart submission) and level 2 (notifications from google checkout).

Is there any other payment option that works on the google app engine (paypal for example) and supports level 2 (notifications)?


Source: (StackOverflow)

Anyone out there using web2py?

Is anyone out there* using web2py?

Specifically:

  • In production?
  • With what database?
  • With Google Application Engine?

    • by "out there" I mean at stackoverflow.

Source: (StackOverflow)

Django vs web2py for a beginner developer [closed]

Which of these two frameworks is better suited to a developer with 11 months experience. I have decided to learn python for my server side coding and wanted to know which of these would be better suited for someone at my skill level. I have just spent a few days playing around with web2py and really like it and i am wondering if Django offers something more that i am missing out on?

PS. UPDATE: Thank you all for the wonderful input, after buying three django books and going through a few small projects/tutorials for both django and web2py, i have settled on web2py. This is a wonderful framework, which makes web development really fun for a newbe. I would recommend all newbies to learn this framework as it will be mainstream in the future. Django is also a wonderful framework but web2py is just better in my limited experience opinion.


Source: (StackOverflow)

A good development environment setup for Web2Py

Have been trying out Web2Py for a couple of days now and I decided it to be a keeper. But there is one thing that concerns me a lot and that might be a showstopper in the end. I need a nice development environment & setup I can trust and be productive with. Coming from the MS Visual Studio world I'm looking for something with good autocomplete / intellisense + functions for versioning and deployment.

I did some attempts to edit my code in Eclipse but it needs additional setup to run with autocomplete, and for debugging I dont know if it's possible. (Noticed there was a Django project template in Eclipse which is a bit tempting I must say.)

Wing Ide has a instruction on how to get web2py up and running and I am up to testing that one. Not free, but very cheap compared to much in the Windows world.

I also want a good versioning (hg) setup, and preferably a semi-automatic FTP-deployment-method.

What IDE do Web2Py developers use, and how do your setup look like?

A complete setup script for a project in a good IDE would be awesome! (Just like the installation is, one click to get it running 100%).

Pycharm looks good, perhaps that one can add web2py support http://youtrack.jetbrains.net/issue/PY-1648

Thanks a lot!


Source: (StackOverflow)

How to debug Web2py applications?

Is it possible? By debug I mean setting breakpoints, inspect values and advance step by step.


Source: (StackOverflow)

web2py in the future? [closed]

Given the size of web2py and the lack of resources and corporate support, do you think it would be advisable to learn web2py as the only web development framework I know. I'm considersing learning Ruby on Rails or web2py for a website I need to create for as a school project.

This is not the 'Ruby vs Python' question. I just want to know what disadvantages I would face if I selected a framework other that the main stream RoR or Django (if any).


Source: (StackOverflow)

Which Python web framework that novice web developer should learn? Flask? Django? or ...?

I'm a former sysadmin, an intermediate programmer with zero experience on web development(I only code system script with Bash/Perl before). I learned Python in 6 months & coded some system tools with it. Next month I'm going to become a web developer(job switching). I want to learn a Python web framework with a gentle learning curve, but not so limited, a framework that will help me easily approach web development concepts & processes.

I just had a glance at Flask, Jinja2, and think it quite nice. But i have to learn SQLAlchemy? (it seem quite complex) I heard alot about Django but it most fit for content-intensive webapp?

  1. Can you suggest me a Python web-framework? (repeat: i have no experience in web development, and need to learn fast)
  2. Can you suggest me some documentation/tutorials or books on that framework? (i not only need to learn framework, but also web development process)

Thanks in advance! :)


Source: (StackOverflow)

What are the benefits of building HTML markup with HTML helpers in web2py? [closed]

I would like to learn the benefits of using HTML helpers in web2py instead of plain HTML markup elements. As an example, I read the following HTML markup builder code in a web2py application (reddish):

{{=A(IMG(_src=URL(r=request,c='static',f='up.png')),_rel='nofollow' href=URL(r=request,f='vote',args=['up',item.id]))}}

Writing this code by plain HTML markup results in this:

<a rel='nofollow' href="/reddish/default/vote/up/{{=item.id}}"><img src="/reddish/static/up.png"/></a>

I find the plain HTML markup easier to read. But I would like to learn if there are any benefits of using HTML helpers?

By the way, one benefit that I can see right at the first sight is that HTML helper code doesn't require writing the name of the app, namely reddish, explicitly. Apart of this, are there any other benefits of using HTML helpers?


Source: (StackOverflow)

Which web development framework works best with Google App Engine? [closed]

Now that Google allows Java on App Engine, I'm wondering what effect this has on a choice of web framework for App Engine.

  1. I realize Google provides the webapp framework which is pretty barebones.
  2. And the .96 version of django that's available for App Engine is restrictive.
  3. web2py burns up resources, from what I've heard.
  4. Rails (now available) can't use ActiveRecord, ActiveResource, restclient, rmagick.

Is there something I'm missing - do any frameworks work well on App Engine?


Source: (StackOverflow)

Python Selenium 2.39 and Firefox 26

im trying to execute some selenium with unittest scripts but i get the following error

Starting at: "Sat Dec 07 14:43:17 2013"
E
======================================================================
ERROR: test_template (__main__.ManageTemplates)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "template.py", line 70, in tearDown
    self.driver.quit()
  File "C:\Program Files (x86)\Python27\lib\site-packages\selenium-2.38.1-py2.7.egg\selenium\webdriver\firefox\webdriver.py", line 66, in quit
    RemoteWebDriver.quit(self)
  File "C:\Program Files (x86)\Python27\lib\site-packages\selenium-2.38.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 454, in quit
    self.execute(Command.QUIT)
  File "C:\Program Files (x86)\Python27\lib\site-packages\selenium-2.38.1-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 162, in execute
    response = self.command_executor.execute(driver_command, params)
  File "C:\Program Files (x86)\Python27\lib\site-packages\selenium-2.38.1-py2.7.egg\selenium\webdriver\remote\remote_connection.py", line 350, in execute
    return self._request(url, method=command_info[0], data=data)
  File "C:\Program Files (x86)\Python27\lib\site-packages\selenium-2.38.1-py2.7.egg\selenium\webdriver\remote\remote_connection.py", line 381, in _request
    self._conn.request(method, parsed_url.path, data, headers)
  File "C:\Program Files (x86)\Python27\lib\httplib.py", line 973, in request
    self._send_request(method, url, body, headers)
  File "C:\Program Files (x86)\Python27\lib\httplib.py", line 1001, in _send_request
    self.putrequest(method, url, **skips)
  File "C:\Program Files (x86)\Python27\lib\httplib.py", line 871, in putrequest
    raise CannotSendRequest()
CannotSendRequest

----------------------------------------------------------------------
Ran 1 test in 766.686s

FAILED (errors=1)

the errors accure in template.py at line 70 in tearDown() function, which is a default unittest function autogenerated with Selenium-IDE

def tearDown(self):
    self.driver.quit()
    self.assertEqual([], self.verificationErrors)

EDIT:

This Problem happened when i updated Firefox to 26, even when i updated to selenium 2.39.0 the problem didnt go away


Source:

import unittest
from os import path
from config import config
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from PyWebBotClass import PyWebBot
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException
from os import listdir, environ
from os.path import isfile, join
import time

class ManageReceivers(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Firefox()
        self.driver.implicitly_wait(10)
        self.base_url = config['baseurl']
        self.verificationErrors = []
        self.accept_next_alert = True

    def setup_bot(self, f):
        self.bot = PyWebBot(self.driver, path.join(config['configs'],f))
        self.bot.set_LogPath(config['LogPath'])
        self.bot.set_ScreenshotPath(config['screenshots'])
        self.bot.set_ConfigBaseURL(config['baseurl'])

    def test_receiver_profile(self):
        self.imported = False
        for f in listdir(config['configs']):
            if isfile(join(config['configs'],f)):
                self.setup_bot(f)
                if not self.imported:
                    self.bot.gotourl('csv2db/import_db_1')
                    self.imported = True
                self.bot.goto('login')
                self.bot.JS__fillform('login')
                self.bot.goto('receiver_profile')
                self.bot.JS__fillform('receiver_profile')
                try:
                    self.bot._driver.execute_script("var e = $('.icon-zoom-in'); e[e.length-1].click()")
                except:
                    print "unable to access selector id = view"
                    pass
                try:
                    self.bot._driver.execute_script("var e = $('.icon-pencil'); e[e.length-1].click()")
                except:
                    print "unable to access selector id = edit"
                    pass

                self.bot.JS__fillform('receiver_profile')
                self.bot.goto('logout')

    def is_element_present(self, how, what):
        try: self.driver.find_element(by=how, value=what)
        except NoSuchElementException, e: return False
        return True

    def close_alert_and_get_its_text(self):
        try:
            alert = self.driver.switch_to_alert()
            if self.accept_next_alert:
                alert.accept()
            else:
                alert.dismiss()
            return alert.text
        finally: self.accept_next_alert = True

    @classmethod
    def setUpClass(cls):
        environ['NO_PROXY'] = '127.0.0.1'  # IP-address of Jenkins server

    def tearDown(self):
        self.driver.quit()
        self.assertEqual([], self.verificationErrors)


if __name__ == '__main__':
    print('Starting at: "%s"' % time.asctime())
    unittest.main()
    print('Finished at: "%s"' % time.asctime())

Source: (StackOverflow)

Web2py: How should I display an uploaded image that is stored in a database?

Is there a web2py way of displaying images from a database table?

Example:

The model:

db.define_table=('images',Field('picture', 'upload' ))

The controller:

def somefunction(): to get the image.

How exactly should I "read" a picture from the database?

The view:

<img src="{{somefunction}}" />

Source: (StackOverflow)

Django, Turbo Gears, Web2Py, which is better for what?

I got a project in mind that makes it worth to finally take the plunge into programming.

After reading a lot of stuff, here and elsewhere, I'm set on making Python the one I learn for now, over C# or java. What convinced me the most was actually Paul Graham's excursions on programming languages and Lisp, though Arc is in the experimental stage, which wouldn't help me do this web app right now.

As for web app fast, I've checked out Django, Turbo Gears and Py2Web. In spite of spending a lot of time reading, I still have no clue which one I should use.

1) Django certainly has the nicest online presence, and a nicely done onsite tutorial, they sure know how to show off their thing.

2) Web2Py attracted me with its no-install-needed and the claim of making Django look complicated. But when you dig around on their website, you quickly find content that hasn't been updated in years with broken external links... There's ghosts on that website that make someone not intimately familiar with the project worry if it might be flatlining.

3) Turbo Gears ...I guess its modular too. People who wrote about it loved it... I couldn't find anything specific that might make it special over Django.

I haven't decided on an IDE yet, though I read all the answers to the Intellisense code completion post here. Showing extra code snippets would be cool too for noobs like me, but I suppose I should choose my web frame work first and then pick an editor that will work well with it.

Since probably no framework is hands down the best at everything, I will give some specifics on the app I want to build:

It will use MySQL, it needs register/sign-in, and there will be a load of simple math operations on data from input and SQL queries. I've completed a functional prototype in Excel, so I know exactly what I want to build, which I hope will help me overcome my noobness. I'll be a small app, nothing big.

And I don't want to see any HTML while building it ;-)

PS: thanks to the people running Stackoverflow, found this place just at the right moment too!


Source: (StackOverflow)