New App - hope you like it

12 views
Skip to first unread message

Speedbird

unread,
Apr 10, 2009, 5:25:46 PM4/10/09
to web2py Web Framework
Here's the last of my "pets", I present you with pyForum, the FIRST
message board written exclusively in web2py, basically a forum system
containing many of the goodies of other (php?) message boards out
there.

http://www.pyforum.org/

The "official" release is at:
http://www.pyforum.org/pyforum/default/view_forum/2

PS - The code is OPEN SOURCE but there are still a couple of things to
"iron out" before I put the downloadable source code in the site (see
if you can fin them).

There is an area so you can add test topics and feel free to creatye
your accounts there, to the webpy-thonistas out there I'll be more
than happy to give you admin so you can explore the other 50% of the
code.

Cheers and long live web2py

Álvaro Justen [Turicas]

unread,
Apr 10, 2009, 5:44:56 PM4/10/09
to web...@googlegroups.com

Congratulations.
A tip: create readable, simple and efficient URLs, like:

http://www.pyforum.org/name-of-forum/title-of-post
instead of:
http://www.pyforum.org/(...)/view_forum/2
http://www.pyforum.org/(...)/view_topic/234

This is a principle that I try to follow in all my apps.
In web2py you can do this by configuring routes.py or, if you use
Apache, .htaccess.

--
Álvaro Justen
Peta5 - Telecomunicações e Software Livre
21 3021-6001 / 9898-0141
http://www.peta5.com.br/

Speedbird

unread,
Apr 10, 2009, 6:04:52 PM4/10/09
to web2py Web Framework
This is a very interesting topic that I'll eventually try to address,
no doubt. Having web2py behind apache was a daunting task to say the
least, since I am now running more than one web2py app under apache in
the same web2py instance, I want to make sure all configuration
settings are correct.

For instance, the "ideal" post for a topic would be, as you point out
http://www.pyforum.org/forum-name/post-title, the problem is that,
even though apache can rewrite the urls, web2py still needs to know
the controllers and such to map in/out the right URLs, basically you
need to play a delicate "dance" between your vhosts.conf file and
routes.py.

The configuration that I have makes me run both my sites
(julioflores.com and pyforum.org) with a simple apache configuration
and absolutely no routes.py at all, yes, I lost ability to "admin"
web2py but I am not too concern in my "production" environment as long
as my "dev" is tuned in correctly, ideally, however, having the URLS
mapped as you mentioned would be awesome.

On Apr 10, 2:44 pm, Álvaro Justen [Turicas] <alvarojus...@gmail.com>
wrote:
> On Fri, Apr 10, 2009 at 6:25 PM, Speedbird <ju...@techfuel.net> wrote:
> > Here's the last of my "pets", I present you with pyForum, the FIRST
> > message board written exclusively in web2py, basically a forum system
> > containing many of the goodies of other (php?) message boards out
> > there.
>
> >http://www.pyforum.org/
>
> > The "official" release is at:
> >http://www.pyforum.org/pyforum/default/view_forum/2
>
> > PS - The code is OPEN SOURCE but there are still a couple of things to
> > "iron out" before I put the downloadable source code in the site (see
> > if you can fin them).
>
> > There is an area so you can add test topics and feel free to creatye
> > your accounts there, to the webpy-thonistas out there I'll be more
> > than happy to give you admin so you can explore the other 50% of the
> > code.
>
> > Cheers and long live web2py
>
> Congratulations.
> A tip: create readable, simple and efficient URLs, like:
>
> http://www.pyforum.org/name-of-forum/title-of-post
> instead of:http://www.pyforum.org/(...)/view_forum/2http://www.pyforum.org/(...)/view_topic/234

mdipierro

unread,
Apr 10, 2009, 6:15:05 PM4/10/09
to web2py Web Framework
Beautiful. I will use this.

Massimo

Álvaro Justen [Turicas]

unread,
Apr 10, 2009, 7:24:30 PM4/10/09
to web...@googlegroups.com
It's pretty easy to implement URLs like I talked about. In your controller:

def show_forum():
forum_name = request.get_vars['f']
# ... do something ...
return dict(f=forum_name, ...)

def show_thread():
forum_name = request.get_vars['f']
thread_name = request.get_vars['t']
# ... do something ...
return dict(f=forum_name, t=thread_name, ...)

And in routes.py:

routes_in = (
('/$', '/myapp/default/index'),
('/contact', '/myapp/default/contact'),
('/about', '/myapp/default/about'),
('/media/(?P<v>.+)', '/myapp/static/media/\g<v>'),
# ...put here other fixed URLs...
('/(?P<all>[^/]+)/?', '/myapp/default/show_forum?f=\g<all>'),
('/(?P<forum_name>[^/]+)/(?P<thread_name>[^/]+)/?$',
'/myapp/default/show_thread?f=\g<forum_name>&t=\g<thread_name>'),
)

That's it! ;-)

Álvaro Justen [Turicas]

unread,
Apr 10, 2009, 7:26:32 PM4/10/09
to web...@googlegroups.com
Ah, you can use hostname matching in routes.py if you're using web2py
>= 1.60. So you can rewrite only pyforum.org requests.

Speedbird

unread,
Apr 12, 2009, 4:16:50 PM4/12/09
to web2py Web Framework
OK, folks, beta 1 of pyforum downloadable now, please read the topics
here:

http://www.pyforum.org/pyforum/default/view_forum/2

To get started,

Cheers

Angel Cruz

unread,
Apr 12, 2009, 4:28:15 PM4/12/09
to web...@googlegroups.com
Wow.  The links are very quick as well.  Looks promising.

One thing I need clarification on the install instructions:

" Create your SQL database and add the appropriate users and permissions to it. pyForum currently uses MySQL 5.0"

This does not preclude me from using PostgreSQL, correct?

Álvaro Justen [Turicas]

unread,
Apr 12, 2009, 4:55:28 PM4/12/09
to web...@googlegroups.com
On Sun, Apr 12, 2009 at 5:16 PM, Speedbird <ju...@techfuel.net> wrote:
> OK, folks, beta 1 of pyforum downloadable now, please read the topics
> here:
>
> http://www.pyforum.org/pyforum/default/view_forum/2

If I click in link in your nick on a post, pyForum sends me to:
http://www.pyforum.org/pyforum/default/message_new/Speedbird
But I got an "invalid function" error.

Speedbird

unread,
Apr 12, 2009, 6:13:26 PM4/12/09
to web2py Web Framework
Right, please see "What will it take to take the forum out of beta
status" at http://www.pyforum.org/pyforum/default/view_topic/26

Thanks!

On Apr 12, 1:55 pm, Álvaro Justen [Turicas] <alvarojus...@gmail.com>
wrote:

Speedbird

unread,
Apr 12, 2009, 6:14:19 PM4/12/09
to web2py Web Framework
Correct, however I'd suggest read the topics in the "pyForum Help and
Announcements (Official)" forum at http://www.pyforum.org/pyforum/default/view_forum/2

Thanks,

Boris Manojlovic

unread,
Apr 12, 2009, 7:38:25 PM4/12/09
to web...@googlegroups.com
small suggestion about beta release (and other releases),

please remove pyforum/sessions/* and pyforum/errors/*
(or just before packing application from web interface press cleanup)
as it will put size from 2 mb to less than 150k (after gzipping it of course :) )
--
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former."-Albert Einstein

Speedbird

unread,
Apr 12, 2009, 10:01:06 PM4/12/09
to web2py Web Framework
That has been fixed since Beta 2 ;). Thanks.

http://www.pyforum.org/pyforum/default/view_topic/27


On Apr 12, 4:38 pm, Boris Manojlovic <boris.manojlo...@gmail.com>
wrote:

Iceberg

unread,
Apr 12, 2009, 10:33:03 PM4/12/09
to web2py Web Framework
By the way, I always hope the pack function in web2py admin can do an
automatical cleanup before packing.

Hopefully Massimo is reading this post. :-)

mdipierro

unread,
Apr 13, 2009, 12:17:49 AM4/13/09
to web2py Web Framework
What is wrong with pressing the cleanup button before the pack all
button?
I think any file delettion has to be explicit.

Massimo

Iceberg

unread,
Apr 13, 2009, 1:59:47 AM4/13/09
to web2py Web Framework
Nothing wrong, but it seems people tends to forget pressing the
cleanup button before packing, at least I've downloaded some apps in
the open repository (http://mdp.cti.depaul.edu/appliances) and find
some of them include unnecessary errors/* and sessions/*

Shall we look at this in a different angle of view? When we want to
pack our app, in most cases we don't need to pack errors/* and
sessions/*, so why not let the pack feature just leave those files
there, not deleting them nor packing them.

mdipierro

unread,
Apr 13, 2009, 2:12:41 AM4/13/09
to web2py Web Framework
Can you send me a patch?

Jason Brower

unread,
Apr 13, 2009, 3:11:22 AM4/13/09
to web...@googlegroups.com
+1 I like that idea. What would be the reason to leave that data in the
package? And if so, it would be good to have an option for it.
-BR
Jason

Anand Vaidya

unread,
Apr 13, 2009, 3:49:25 AM4/13/09
to web2py Web Framework
Hi Speedbird,

The forum really looks great. I hope it will become a good alternative
to the popular PHP based forum software ( such as phpBB.)

Regards
Anand

Iceberg

unread,
Apr 13, 2009, 11:16:36 AM4/13/09
to web2py Web Framework
Hi pals,

I've adjusted the admin app to pack things except errors/* and sessions/*

However I still choose to call __cleanup() before packing, because it is more simple, and no need to repeat special treatment for errors/* and sessions/* (the DRY rule). Besides, I fixed a bug occurs when trying to cleanup admin app.

Just use the attached default.py to replace web2py 1.61's applications/admin/controllers/default.py

Best regards,
Iceberg, 2009-Apr-13, 23:07(PM), Mon

----------------------- Original Message -----------------------
From: mdipierro <mdipie...@cs.depaul.edu>
To: web2py Web Framework <web...@googlegroups.com>
Date: Sun, 12 Apr 2009 23:12:41 -0700 (PDT)
Subject: Re: New App - hope you like it
-------------------

default.py

mdipierro

unread,
Apr 13, 2009, 11:27:25 AM4/13/09
to web2py Web Framework
thank you
>  default.py
> 40KViewDownload
Reply all
Reply to author
Forward
0 new messages