Resource webservice built on web2py for web2py comunity [BETA]

298 views
Skip to first unread message

Ivica Kralj

unread,
Jun 4, 2015, 5:40:14 PM6/4/15
to web...@googlegroups.com
Hi All,

This is my little personal project I have worked on for the last few months. 


Project is in beta and I'm still adding and fixing features, functionalities and content, whenever I get a chance. Please, feel free to express your opinions or constructive suggestions.

Service is open to all. You can register and contribute by adding more examples.

Idea behind the service is to link particular web2py reference to a multiple web2py examples. This will enable web2py users to learn or remind them-self how to use certain web2py functionality by examining multiple examples. System should automatically link every reference to web2py examples' records. 

When I started playing with web2py, I always wanted to have this type of resource, so I believe new web2py users will find the project beneficial.

If you will add new examples, please keep in mind following criteria: examples should be relevant and functional. Accepted example types are snippets, apps, plugins or modules. Also, if you copy and paste example's code, example should be fully operational in your web2py environment.

Functionalities so far:
  • Add/edit web2py references and examples.
  • Save/follow records
  • Rate records
  • Comment
  • Private user page where you can access your own, commented, rated and saved references and examples records.
  • Search
  • Tags
  • 3.5 step wizard form
Regards,
Ivica

p.s.
If you are planing to test the app, please do not publish irrelevant or uncompleted records...(google remembers everything) :)

JorgeH

unread,
Jun 4, 2015, 6:28:57 PM6/4/15
to web...@googlegroups.com
Looks good ;)

Ron Chatterjee

unread,
Jun 4, 2015, 8:24:26 PM6/4/15
to web...@googlegroups.com
This is really nice! What did you use to create the layout like that? Or it came with the bootstrap? Just curious. Good job!

Ron Chatterjee

unread,
Jun 4, 2015, 10:11:23 PM6/4/15
to web...@googlegroups.com
On that note, may be that will be a good example to capture on the site. How do we use different kind of layout for the look and feel of it. Create active state etc... Even though, its not web2py specific but more of design feature but still, we use them. Just some thoughts...: -)

On Thursday, June 4, 2015 at 8:24:26 PM UTC-4, Ron Chatterjee wrote:
What did you use to create the layout like that? Or it came with the bootstrap? Just curious. Looks nice: -)

Massimo Di Pierro

unread,
Jun 5, 2015, 12:30:31 AM6/5/15
to web...@googlegroups.com, ivica...@gmail.com
This is fantastic! Now if you could somehow include the examples from web2pyslices.com I'd be happy to redirect web2pyslices.com to your site.

Massimo

Ron Chatterjee

unread,
Jun 5, 2015, 1:05:53 AM6/5/15
to web...@googlegroups.com, ivica...@gmail.com
Adding some examples of design features will be nice. e.g., how to add social networking share button, facebook log in, votes, rating , likes (they are in the book also)..etc...so they are all in one place. Just some thoughts.

Ivica Kralj

unread,
Jun 5, 2015, 6:16:33 AM6/5/15
to web...@googlegroups.com
Thanks Jorge

Ivica Kralj

unread,
Jun 5, 2015, 6:19:30 AM6/5/15
to web...@googlegroups.com
Thanks Ron.

I'm just using customised bootstrap 3 with customized welcome app layout.html file. When I started working on this project web2py didn't support boostrap 3 out-of-box and I really wanted to use some bootstrap 3 features. Couple of months later bootstrap 3 was implemented with web2py. I didn't have time to change test/use official bootstrap implementation yet.

Ivica Kralj

unread,
Jun 5, 2015, 6:23:00 AM6/5/15
to web...@googlegroups.com
I agree, any example that might be beneficial should be here. When I started with web2py I remember tinkering alot about some simple stuff, for example {{block}}. Such a useful and powerful feature when it comes to design :)
What do you mean by active state?

Ivica Kralj

unread,
Jun 5, 2015, 6:31:00 AM6/5/15
to web...@googlegroups.com, ivica...@gmail.com
Thanks Massimo. I'm glad you like it.

I didn't expect that! I see this site as a supplement to web2py book, slices and other resources. What is happening with web2pyslices.com? I hope slices is not being abandoned. 

This is maybe a topic for another thread, what is the future for web2pyslices? 

At the moment I can only think of two ways how to transfer examples to w2pREF, manual entry or CSV import. Manual entry will be a project by itself. 

Thanks
Ivica

Ron Chatterjee

unread,
Jun 5, 2015, 10:10:03 AM6/5/15
to web...@googlegroups.com
 The element of design you have their, the color choice and everything...stands out really well. What I mean by active state is when you hoover your mouse over to a topic it highlights. Again, design feature. Not development. Hopefully someone will put some design examples in the site.

villas

unread,
Jun 5, 2015, 11:39:49 AM6/5/15
to web...@googlegroups.com
Really good +1 !

If you are planing to test the app, please do not publish irrelevant or uncompleted records...(google remembers everything) :)


Whilst testing,  maybe you should consider a robots.txt file with something like this:

User-agent: *
Disallow: / 

Derek

unread,
Jun 5, 2015, 11:45:47 AM6/5/15
to web...@googlegroups.com
The slider thing on the top moves the content up and down. And it repeats, so it's like trying to use your website on a mexican jeep on it's way to Costa Maya. 

jimbo

unread,
Jun 5, 2015, 1:17:08 PM6/5/15
to web...@googlegroups.com
Great work!  We need some well documented starter apps.  Flask seems to gets loads on the likes of Python Weekly.
Would be very helpful to get some recent ones online for newbies.

Ron Chatterjee

unread,
Jun 5, 2015, 1:30:04 PM6/5/15
to web...@googlegroups.com
Can you post the example of div element about recent examples, top rated examples...etc and show how you create the box element? I believe that's what you meant by custom layout.

Niphlod

unread,
Jun 5, 2015, 3:35:08 PM6/5/15
to web...@googlegroups.com
not to be the buzzkiller but I won't post any example there that exists on web2pyslices.com that ATM has at least 2 killer features: social login and packages uploads. 

BTW: until all snippets are continously tested, this is going to become the 4th incarnation of a "web2py snippet blog/container/etc" with outdated pieces of code within the next year, when the buzz wears off.

Rufus

unread,
Jun 5, 2015, 4:17:36 PM6/5/15
to web...@googlegroups.com
On Friday, June 5, 2015 at 3:35:08 PM UTC-4, Niphlod wrote:
BTW: until all snippets are continously tested, this is going to become the 4th incarnation of a "web2py snippet blog/container/etc" with outdated pieces of code within the next year, when the buzz wears off.

Nothing worse than getting broken code samples off the web, is there?   (Well, there are worse things...)
Maybe we can add some fields to each snippet to indicate: which versions it was tested on, when it was
submitted, when last verified, etc.

As people use the snippets, at least a few will provide feedback in the form of: "I just used this one and it works
great" to provide a "last tested" timestamp.

Niphlod

unread,
Jun 5, 2015, 4:31:00 PM6/5/15
to web...@googlegroups.com


On Friday, June 5, 2015 at 10:17:36 PM UTC+2, Rufus wrote:
On Friday, June 5, 2015 at 3:35:08 PM UTC-4, Niphlod wrote:
BTW: until all snippets are continously tested, this is going to become the 4th incarnation of a "web2py snippet blog/container/etc" with outdated pieces of code within the next year, when the buzz wears off.

Nothing worse than getting broken code samples off the web, is there?   (Well, there are worse things...)
Maybe we can add some fields to each snippet to indicate: which versions it was tested on, when it was
submitted, when last verified, etc.

 
I fell off the wagon too many times to trust again a "repository" of sorts of untested thingies. It's the real truth that bites: there's no manpower available and so if something else (a CI) does the job, it pretty much stays viable until the developer that creates it uses it.
Then we get angry users here asking for "why is that not working anymore, wasn't web2py supposed to be backward-compatible..." instead of asking the original developer.
Once you put it in a plugin, people won't ever be interested in seeing the code, the damn thing needs to work as intended.
They get crazier and crazier about it because web2py userbase is not - that - skilled in python: it attracts lots of newbies for that reason and we (the main developers) need to live with that: no feedback in testing, not interested in poking a bit to maintain it/refresh it, huge interest in being just disappointed.

Ron Chatterjee

unread,
Jun 5, 2015, 5:04:09 PM6/5/15
to web...@googlegroups.com
I agree with Niphlod for the most part. Just one note, the whole purpose of web2py was  just that. As a learning tool for people who are not an expert. If you hear Massimo talk. Several times he mentioned, "web development doesn't need to be difficult". Thats the reason you run into lot of unskilled newbie as you put it. That said. It can be tested once and with a disclosure statement like "Use with your own risk. No support is provided if the code breaks"....something along that line. My two cents.

Ivica Kralj

unread,
Jun 6, 2015, 5:46:46 AM6/6/15
to web...@googlegroups.com
Ah OK. That would be nice design feature to have. I didn't go this far with design considerations, as I was just eager to release it. There is always something we can add or improve existing features and functionalities. Right? :)

Ivica Kralj

unread,
Jun 6, 2015, 5:48:11 AM6/6/15
to web...@googlegroups.com
Thanks Villas.
I have read somewhere, even with user-agent set to disallow, search crawlers will still crawl your site. Considering site is live now, I rather just avoid future headache.

Ivica Kralj

unread,
Jun 6, 2015, 5:49:23 AM6/6/15
to web...@googlegroups.com
Ha ha, goodone! Thanks for that. 

When you look at something for too long, your learn how to ignore it :)

I have removed 2nd carousel, as it was not needed. Problem was 2nd image's height. Image was bigger than 1st image.

Ivica Kralj

unread,
Jun 6, 2015, 5:50:11 AM6/6/15
to web...@googlegroups.com
Ok, I will create this example in the next few days...read Monday :)

Ivica Kralj

unread,
Jun 6, 2015, 5:52:56 AM6/6/15
to web...@googlegroups.com
That is fine Niphlod. I created this project, primary for personal reason to have quick resource to examples when I 'm working on my small projects,. I think people, specially newbies, might find it useful. Comparing myself to allot of members here, I do consider myself a newbie, although I have joined this group over 4-5 years ago or so.

Any feature can be added if its needed or requested. 

I agree, over the years there were number of resources,  most of them got abandoned, but their resources are still out here (alter ego for example), and I still regularly visit them. Even if they might not work with current web2py version, we can still learn from them, well I do.

Ivica Kralj

unread,
Jun 6, 2015, 5:53:19 AM6/6/15
to web...@googlegroups.com
At the moment users can mark examples as depreciated  since which web2py version. I will just need to enable tested_on field. This will all be shown on example page.

Ron Chatterjee

unread,
Jun 6, 2015, 6:07:47 AM6/6/15
to web...@googlegroups.com
I figured out what you did with the layout. You basically copied the {{block right_sidebar}} content few times in index.html and on the top before the {{ entend layout.html}} you defined them for example:

{{left_sidebar_enabled=False,right_sidebar_enabled=False,middle_sidebar_enable=False,('message' in globals())}}

That creates the tile layout broken up in three division. Cool!:-)

Ron Chatterjee

unread,
Jun 6, 2015, 6:11:19 AM6/6/15
to web...@googlegroups.com
I consider myself newbie too. I been on it for few months. I am okay with it, but still learning...

villas

unread,
Jun 7, 2015, 8:27:59 AM6/7/15
to web...@googlegroups.com
I agree with Niphlod about the danger of creating another 'repository of untested thingies'.  The existing web2pyslices is already pretty good and maybe this one could be better.  But what we are missing is the dedicated effort required to keep things up to date.  I guess we are all hoping that Ivica will volunteer to do it for us,  but that's an unrealistic expectation,  especially when that buzz dies down.

I can see two possibilities for success:  
  • we have a team of at least three volunteers to take charge of this (to ease the burden and provide continuity)
  • we make a paid site to make it commercially interesting.

In the second point,  before anyone feels upset about the principle of paying something,  I would say this,  one of the repositories of thingies is the 'Cookbook'.  I thought that idea was great. Many of the lead developers contributed to getting a bunch of cool ideas together.  I went and bought that book straightaway!  I figured that even if one thing proved useful,  I would get my money back.  But even more than that,  I thought that by encouraging this financially it would encourage the effort.  The principle and precedent are still sound.  Why not make a membership site which contains cool stuff and someone can make a little money to keep it going?  Surely that could solve the problem.  Maybe we could have two classes of membership,  commercial users contribute something,  others do not?  IMO a 'cookbook' type site could work well.



Ron Chatterjee

unread,
Jun 7, 2015, 10:50:07 AM6/7/15
to web...@googlegroups.com
paid or not, I like the idea of having "one" site than two. Its confusing enough just to log in sometimes. lol., let alone looking for which site to go.

Massimo Di Pierro

unread,
Jun 7, 2015, 8:49:21 PM6/7/15
to web...@googlegroups.com, ivica...@gmail.com
The maintainers of web2pyslices do not want to do it any more. The domain has been donated to me (although we are in the process of transferring it) so if Ivica want to put the effort of maintaining an alternate site, that is better for me than maintaining web2pyslices, as long as info is not lost.

Carlos Cesar Caballero Díaz

unread,
Jun 8, 2015, 9:16:43 AM6/8/15
to web...@googlegroups.com
Some months ago, because I can´t post anything to web2pyslices (others have the same problem and no one knows why) I post that I could motivate some of my team (including a designer) for building (and maintain) a new web2pyslices, and the proposal remains on the table. Right now I have two ideas, first, open source the site, and motivate the comunity to contribute, the other thing is, taking advantage of the web2pyslices maintenance problems, mix everything in a improved new web2py site, and web2pyslices could continue alive, for consulting, in some kind of read only mode.


El 07/06/15 a las 20:49, Massimo Di Pierro escribió:
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carlos A. Armenta Castro

unread,
Jun 8, 2015, 8:19:32 PM6/8/15
to web...@googlegroups.com, desar...@spicm.cfg.sld.cu
I don't know if web2pyslices is better than web2pyref and it doesn't care for me. My personal opinion is: We need a decent, powerful and usable website to collect all ours code snippets, examples, recipes, plugins, demo sites, templates (bs2, bs3, etc.) and for to be honest that is our Achilles' heel. We have a really great community, but a no optimal system to show our work to the world (and to motivate the newbies). 

Finally, I appreciate the work of the web2pyref.com and web2pyslices.com, and I think we need to be part of that kind of projects contributing to the source code, promotion and with donations.

Sorry for my bad english.

Ron Chatterjee

unread,
Oct 23, 2015, 9:58:59 AM10/23/15
to web...@googlegroups.com, desar...@spicm.cfg.sld.cu
Wondering if we can have more examples, source code and snippets gets put into web2pyref. I don't know who is maintaining the page but few things I wish I could use example of sending email using gmail SMTP and contact form, voting, likes, paypal ecommerce, rating, bootstrap3 and social media integration etc. Just some thoughts...

Richard Vézina

unread,
Oct 23, 2015, 11:30:15 AM10/23/15
to web2py-users
What about snippet validation of code infrastructure??

It sound crazy, but I am sure we can find a way to do it...

Just a working Demo environnement that implement the proposed snippet could do it, if the demo run that mean the snippet is still working is not snippet may be put in a queue to be revised and update...

Richard

On Fri, Oct 23, 2015 at 9:58 AM, Ron Chatterjee <achatte...@gmail.com> wrote:
Wondering if we can have more examples, source code and snippets gets put into web2pyref. I don't know who is maintaining the page but few things I wish I could use example of sending email using gmail SMTP and contact form, voting, likes, rating, bootstrap3 and social media integration etc. Just some thoughts...

Ron Chatterjee

unread,
Oct 23, 2015, 11:58:00 AM10/23/15
to web2py-users
I agree with Richard. An online demo to make sure the code works will be great. 

Richard Vézina

unread,
Oct 23, 2015, 1:42:12 PM10/23/15
to web2py-users
Just by providing a way to the user to create model/controller/view file to the web2py ref app securely (which is the difficult path, maybe having a review of posted code can do the trick) can at least let us know if the code can work under the current version of web2py that is in use by the web2py ref site.

Richard

Ron Chatterjee

unread,
Oct 23, 2015, 2:20:51 PM10/23/15
to web2py-users
Right, or have a link where we can upload .w2p file and install, and have another link to that app to see if its working. 

Richard Vézina

unread,
Oct 23, 2015, 2:31:49 PM10/23/15
to web2py-users
It will make it more difficult to review IMHO and you kind of need to install the app before you can even look at the code... Since there can have nasty piece of code in an uploaded app, I would really avoid this path.

Richard

Ron Chatterjee

unread,
Oct 23, 2015, 2:40:14 PM10/23/15
to web2py-users
I see. Its not my site or maintaining. It will be upto Ivica I am assuming. But good discussion! 

Richard Vézina

unread,
Oct 23, 2015, 2:52:57 PM10/23/15
to web2py-users
The easiess way I can see, is having a form with code/textarea for each important web2py code container (models/controllers/views, maybe modules), before any bit of code submit get executed it needs a review from site administrator or web2py core dev (which is a bottle neck and a time investment)... Once validated the code is injected somehow at runtime and resulting demo app available embeded in web2py ref site page... It can limit the possibility of a demo for some kind of examples... We can also make use of the web2py plugins mechanism that could fit perfectly for this task...

Richard

Ivica Kralj

unread,
Oct 25, 2015, 11:31:18 AM10/25/15
to web2py-users, desar...@spicm.cfg.sld.cu
Hi,

The site is maintained but not actively as I would like.

I've just added new example for the contact form. 

My intention is to still continue adding new references and new examples but unfortunately I have other priorities going on at the moment.

Ron Chatterjee

unread,
Oct 26, 2015, 10:35:43 AM10/26/15
to web2py-users, desar...@spicm.cfg.sld.cu
So, I took a stab at Ivica's post. Created the db in my model file as:

db.define_table("contact_form",
                Field("your_name", "string"),
                Field("your_email", requires=IS_EMPTY_OR(IS_EMAIL(error_message='invalid email'))),
                Field("your_phone_number", "string"),
                Field("subject", "string", default=None),
                Field("your_message", "text", requires=IS_NOT_EMPTY()),
                auth.signature)


Somehow I kept getting the error "unable to send email". I get an error on my web2py terminal as " failure 534..."..  I believe this may has to do something with setting on my gmail account than a web2py issue. Does anyone has any luck to get Ivica's example to work with a gmail account? If so, I will be interested to know what setting in gmail made the email to go through.

Ron Chatterjee

unread,
Oct 26, 2015, 2:39:36 PM10/26/15
to web2py-users, desar...@spicm.cfg.sld.cu
It turns out I needed to make my gmail account less secured in order for the email to pass through. And as expected, this wasn't a web2py issue.


This was leonel's solution. Thank you Leonel!

Ivica Kralj

unread,
Oct 26, 2015, 5:30:16 PM10/26/15
to web2py-users
I've used gmail app password on one of my website (gmail two step auth is enabled) and I haven't experienced any issues. I guess... it could be insecure if somebody can access your web2py admin page (admin should be disabled in anyway) or somebody cracks your hosting account login (e.g. pythonanywhere) and obtain your gmail password this way. For everything else, I trust web2py can keep intruders out.

On most of my websites, I've set up my web2py app with my domain register's mail server (SMTP) settings. My domain regsiter (eurodns) provides one free email account. This email account is set up to auto-forward any emails to my main gmail address (web form over to register's mail and finaly to gmail). Also, from gmail account I have IMAP set up, it works like a charm.

Reply all
Reply to author
Forward
0 new messages