Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add web2py #14

Open
mdipierro opened this issue Feb 20, 2012 · 7 comments
Open

add web2py #14

mdipierro opened this issue Feb 20, 2012 · 7 comments

Comments

@mdipierro
Copy link

wget http://web2py.com/examples/static/web2py_src.zip
unzip web2py_src.zip
cd web2py
mkdir applications/benchmark
cp -r applications/welcome/* applications/benchmark
rm applications/benchmark/models/*
echo """
import sqlite3
def index():
    return 'Hello World!'
def hellos():
    return dict()
def hellodb(): # NO DAL
    db = sqlite3.connect(os.path.join(request.folder,'databases','hello.db'))
    rows = db.execute('select id, data from hello order by id asc')
    lipsum = [dict(id=row[0], data=row[1]) for row in rows.fetchall()]
    return dict(rows=lipsum)
def hellodb2(): # DAL
    response.view = 'tests/hellodb.html' # recycle view
    db = DAL('sqlite://hello.db')
    db.define_table('hello',Field('data')) # creates table and db if not exists
    rows = db(db.hello).select()
    return dict(rows=rows)
""" > applications/benchmark/controllers/tests.py
mkdir  applications/benchmark/views/tests
echo """
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>Hello World</title>
</head>
<body>
    {{ include }}
</body>
</html>
""" > applications/benchmark/views/base.html
echo """
{{ extend "base.html" }}
    <p>Lorem ipsum dolor sit amet, consecteteur adipiscing elit nisi ultricies. Condimentum vel, at augue nibh sed.     Diam praesent metus ut eros, sem penatibus. Pellentesque. Fusce odio posuere litora non integer habitant proin. Metus accumsan nibh facilisis nostra lobortis cum diam tellus. Malesuada nostra a volutpat pede primis congue nisl feugiat in fermentum. Orci in hymenaeos. Eni tempus mi mollis lacinia orci interdum lacus. Sollicitudin aliquet, etiam. Ac. Mi, nullam ligula, tristique penatibus nisi eros nisl pede pharetra congue, aptent nulla, rhoncus tellus morbi, ornare. Magna condimentum erat turpis. Fusce arcu ve suscipit nisi phasellus rutrum a dictumst leo, laoreet dui, ultricies platea. Porta venenatis fringilla vestibulum arcu etiam condimentum non.</p>
""" > applications/benchmark/views/tests/hellos.html
echo """
{{ extend "base.html" }}
<p>Lorem ipsum dolor sit amet, consecteteur adipiscing elit nisi ultricies. Condimentum vel, at augue nibh sed. Diam praesent metus ut eros, sem penatibus. Pellentesque. Fusce odio posuere litora non integer habitant proin. Metus accumsan nibh facilisis nostra lobortis cum diam tellus. Malesuada nostra a volutpat pede primis congue nisl feugiat in fermentum. Orci in hymenaeos. Eni tempus mi mollis lacinia orci interdum lacus. Sollicitudin aliquet, etiam. Ac. Mi, nullam ligula, tristique penatibus nisi eros nisl pede pharetra congue, aptent nulla, rhoncus tellus morbi, ornare. Magna condimentum erat turpis. Fusce arcu ve suscipit nisi phasellus rutrum a dictumst leo, laoreet dui, ultricies platea. Porta venenatis fringilla vestibulum arcu etiam condimentum non.</p>
<table border="1">
    {{ for row in rows }}
        <tr><td>{{=row['id']}}</td><td>{{=row['data']}}</td></tr>
    {{ endfor }}
</table>
""" >  applications/benchmark/views/tests/hellodb.html
python web2py.py -a chooseapassword &
open http://127.0.0.1:8000/benchmark/tests/hello
open http://127.0.0.1:8000/benchmark/tests/hellos
open http://127.0.0.1:8000/benchmark/tests/hellodb
open http://127.0.0.1:8000/benchmark/tests/hellodb2
@seedifferently
Copy link
Owner

@mdipierro thanks for the code. Could you please comment on web2py's popularity and if there are any high-profile sites build on top of it? The github and google code pages seem to have very few starred/watchers.

@mdipierro
Copy link
Author

Hello Seth,

Thanks for your interest.

The github repository is only 3 months old. The main repository is still on googlecode.

You can find some sites built on web2py here:

http://web2py.com/poweredby

web2py is mostly used on intranets. I know some large companies are using it internally but I am not at liberty to say. The google group has 3700 members. You can check the number of messages exchanged on the discussion groups. In 2011 there were more messages exchanged on the web2py googlegroup than on the django googlegroup or the ruby on rails googlegroup.

http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-of-the-year-award-winners-183313#slide23

massimo

On Feb 23, 2012, at 2:18 AM, Seth Davis wrote:

@mdipierro thanks for the code. Could you please comment on web2py's popularity and if there are any high-profile sites build on top of it? The github and google code pages seem to have very few starred/watchers.

@olpe
Copy link

olpe commented Feb 25, 2013

Hi Seth,

Do you have plans to include web2py?

Br,
olpe

@seedifferently
Copy link
Owner

The next update will attempt to move to a more "modular" system allowing you to "plug-in" any test you want into the testing framework. This will hopefully allow me to not have to spend as much time on the project as my schedule has been too busy lately for me to be able to dedicate much time to my F/OSS projects.

@olpe
Copy link

olpe commented Feb 25, 2013

Sounds great! When we can expect this to happen?

@seedifferently
Copy link
Owner

Unfortunately due to my schedule I'm not really sure...sometime this year :-)

@olpe
Copy link

olpe commented Feb 25, 2013

Better late than never :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants