[web2py] Re: Hosting my web2py application

2020-11-03 Thread Rufus
The technique we used with PHP was the php would call the python program 
(or any other program callable from the linux shell) and take the output 
from it or the files generated by it using PHP.
This is not the same as generating web pages using python, or modifying the 
HTML to include python code (like web2py, or, I imagine, django and such)
Have you looked at www.pythonanywhere.com?


On Thursday, October 29, 2020 at 1:21:17 AM UTC-4 mostwanted wrote:

> I've come across alot of information on setting up a domestic webserver I 
> just wasnt sure if the same setup of hosting a PHP application would apply 
> to hosting a Python application, I just thought it could be different but 
> if its all the same thing I'll pick one & try it out.
>
> Regards
>
> On Tuesday, October 27, 2020 at 11:51:36 PM UTC+2 jonatha...@whatho.net 
> wrote:
>
>> Do you want instructions on how to set up and run a server (Linux, 
>> Windows?) on your home premises?
>> Instructions on how to install web2py on such a server?
>> Instructions on how to provide access to web browsers out on the internet 
>> (e.g. setting up IP addresses on which the server can be contacted?)
>>
>> These are big topics which (I would suggest) are outside the scope of 
>> this group, and might require a fair bit of research. Also there are lots 
>> of options depending on your requirements. None of it's specially difficult 
>> but most of it is not specific to web2py.
>>
>>
>> On Tuesday, 27 October 2020 at 15:44:30 UTC mostwanted wrote:
>>
>>> How do I setup a private home server to host my web2py application? What 
>>> do i need & how do i put it together? If anyone has done it before please 
>>> share the process or direct me to where I can find the information.
>>>
>>> Regards;
>>>
>>> Mostwanted
>>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/5d505e53-9528-40c7-a750-92aa5575d25an%40googlegroups.com.


[web2py] Re: Hosting my web2py application

2020-10-28 Thread Rufus
There is at least one good tutorial on YouTube about setting up a private 
home webserver on a Raspberry Pi, including
how to create a Dynamic DNS entry with Google. Here's One:  
 https://www.youtube.com/watch?v=vzojwG7OB7c=1415s

On Tuesday, October 27, 2020 at 11:44:30 AM UTC-4 mostwanted wrote:

> How do I setup a private home server to host my web2py application? What 
> do i need & how do i put it together? If anyone has done it before please 
> share the process or direct me to where I can find the information.
>
> Regards;
>
> Mostwanted
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2176a575-acb5-4eb2-b260-36758964d732n%40googlegroups.com.


[web2py] Re: error : socket.gethostbyname(http_host)] : gaierror: [Errno -2] Name or service not known

2016-02-28 Thread Rufus
I installed web2py on a remote ubuntu server 14.04 with Webmin package from 
APT function and the same error is happening for me.
I'll print the contents of http_host to check the value.

 Never mind, I just saw the APT function installed web2py 1.99.7 
(2012-03-04).   I imagine a couple things have changed since then.

reinstalling web2py


On Monday, July 16, 2012 at 5:25:01 PM UTC-4, Carlos wrote:
>
> Hi,
>
> Every now and then, I see the following error in my server logs:
>  
>  ERROR:web2py:Traceback (most recent call last):
>  File "/home/www-data/web2py/gluon/main.py", line 401, in wsgibase
>socket.gethostbyname(http_host)]
>gaierror: [Errno -2] Name or service not known
>
> So far today I'm getting 10+ of these errors (although not from any of my 
> requests, but other users').
>
> How can this error be fixed?.
>
> I'm using latest web2py, ubuntu 10.04, postgresql, nginx, uwsgi-python.
>
> Thanks,
>
>Carlos
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]

2015-06-05 Thread Rufus
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.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Need help displaying value from the controller to view

2015-04-11 Thread Rufus
Just return it as a dictionary value:

def index():
return dict(message='LED Test - Main Menu',pinstatus=GPIO.input(22))

You should be able to figure out how to display it in the view on your own.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Can we disable moderation in the group?

2015-03-10 Thread Rufus
(Must be those Django fanboys trying to disrupt the site!)  

On Tuesday, March 10, 2015 at 10:39:46 AM UTC-4, Massimo Di Pierro wrote:

 We only moderate the first post. We get lots of spam.

 On Friday, 6 March 2015 20:12:30 UTC-6, Jack Kuan wrote:

 I don't see the need and think it can be off putting for new comers. 



-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py and security

2015-02-11 Thread Rufus Smith


I am not too active or up to date on security, I assume you already 
looked at:


http://www.web2py.com/book/default/chapter/01#Security

and at the end of the section it referenced generic python security here:

http://www.pythonsecurity.org/

Rufus


On 2/11/2015 8:23 AM, James O' Driscoll wrote:

Rufus,

I am asking how to configure web2py for maximum security.

I am not an expert either but you cannot be too careful.

I am just looking for general good sources of info.

Regards,

James

On Sunday, November 23, 2014 at 6:55:52 AM UTC+10, Rufus wrote:

What aspect of security are you concerned about?
Are you asking how to configure web2py for maximum security?
Are there aspects of the security model you feel need boosting?
Have you read the manual about web2py and security?
I'm not an expert, but as I understand it, security was one of the
prime design goals of web2py.


On Wednesday, November 19, 2014 8:42:12 PM UTC-5, James O'
Driscoll wrote:

Are there any good resources on how to boost the security of
web2py.

Regards,

James

--
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 a topic in the 
Google Groups web2py-users group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/web2py/0sHTAb54xqM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
web2py+unsubscr...@googlegroups.com 
mailto:web2py+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Any way for placing many views in one html file?

2015-01-05 Thread Rufus
It has been a while since I did anything with web2py, but I seem to recall 
that if you didn't have a view for a function it would
open up a default view, which is also in a file.   (Was it generic.html?)   
Anyway, the point being you might want to use that
for your catch all file instead of creating your own specific file.

On Sunday, January 4, 2015 4:59:40 AM UTC-5, Przemysław wrote:

 Solved. Just to give a tip to another newbie:
 1. In mycontroler.py place the code response.view = 'myview.html'  to 
 force executing myview.html regardless of a function name.
 2. In myview.html use {{if request.function==anyviewname:}} to execute 
 just a block of code designed for a certain view.
 Or just look inside appadmin.py and appadmin.html of your application 
 to get the idea.
 Przemek


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py and security

2014-11-22 Thread Rufus
What aspect of security are you concerned about?
Are you asking how to configure web2py for maximum security?
Are there aspects of the security model you feel need boosting?
Have you read the manual about web2py and security?
I'm not an expert, but as I understand it, security was one of the 
prime design goals of web2py.


On Wednesday, November 19, 2014 8:42:12 PM UTC-5, James O' Driscoll wrote:

 Are there any good resources on how to boost the security of web2py.

 Regards,

 James


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How do I configure my domain to hosting PythonAnywhere

2014-09-16 Thread Rufus
PythonAnywhere is a friend of web2py and gives you all the information to 
host a web2py
server on the website. 
Or explain your question better.  You don't host PythonAnywhere - 
PythonAnywhere hosts you.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Login restricted based on subscription

2014-08-13 Thread Rufus
On Tuesday, August 12, 2014 4:28:11 PM UTC-4, Kenneth wrote:

 Hello everyone,

 I'm building a site that clients subscribes to so I need to limit their 
 login based on the subscription. Is there a built in feature to limit login 
 to a date range?


 Kenneth


Can't your successful login action check the date and redirect to an 
account expired page and log the user off?
Or better, to a To continue/reinstate your subscription... page.

 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Alternative IDEs?

2014-07-19 Thread Rufus
You might want to check out PyAlaMode, the multifile editor that comes with 
wxPython.  I think it has
autocomplete, and could be made web2py friendly.  The sources are all 
there, of course.
The original developer's website www.orbtech.com has gone away, apparently, 
but the code remains
in the wxpython package.

I've not gotten personal experience with it, but it's worth a look.



On Monday, July 14, 2014 8:35:43 AM UTC-4, sasogeek wrote:

 Are there any alternative IDEs for web2py?
 I'm in search of an IDE for web2py that can help me find methods and 
 variables easily. for example autocomplete options to choose from after 
 using a dot operator? the default browser ide lacks quite a number of 
 things in making programming easy. Web2py in itself I believe makes 
 developing applications really really easy, but I believe writing the code 
 should be just as easy the development process itself... if you get what I 
 mean.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How do I iterate over imported methods in a list?

2014-07-10 Thread Rufus


On Thursday, July 10, 2014 12:17:25 PM UTC-4, Maurice Waka wrote:

 in my web2py app, i created this code that works well in python shell.

 python modules:
 #The methods work in such a way that a user inputs an equation query to 
 get an answer. If it is an addition, method1 works it out, the same to 
 other methods being invoked to performing different codes

 def method1():# to do additions
 name = input('Please Enter equation here: ').lower()
 if '1 + 1':
 answer = code
 return answer

 def method2():# to do subtractions
 name = input('Please Enter equation here: ').lower()
 if '1 - 1':
 answer = code
 return answer


 in the controller, I imported the methods as follows. There are many more 
 methods than these shown

 from applications .. import method1
 from applications .. import method2
 from applications .. import method3
 from applications .. import method4

 method1 = method1
 method1 = method2
 method1 = method3
 method1 = method4

 G0 = [method1, method2, method3, m3thod4]

 def Foo():
 code..
 for (func) in G0:
 return func()

 The problem is that only method1 which is at position[0] in the list is 
 invoked and not other methods. I want to randomly call any method when a 
 user inputs any query.


It is very difficult to see what you are trying to accomplish in those 
functions.  But if your intent is to run through multiple functions, 
returning
results, one way is with yield:

def runfuncs():
for func in g0:
yield(func())

for result in runfuncs():
print result: ,result


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to organize the model for a chat application?

2014-06-03 Thread Rufus
If you don't want to create group authentication,  and playing with a 
single registration view different types of users. I wonder if you could 
have the users log into to a completely different app, if all it was for 
was for the chat.  It is possible to share databases between web2py 
applications AFAIK,  and if all chat traffic went through the common 
database, you might be good to go.  (or you could have some kind of chat 
traffic daemon in your system at a dedicated socket port that they pass 
chat messages through)

Or do the users and employees use other functions in the app as well?


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Setting up wiki is not as simple as stated in default.py

2014-05-17 Thread Rufus
I wanted to create a wiki on PythonAnywhere, so I did the most 
straightforward thing.
I went to my site manager, said create simple app.   MyWiki.
  
edited default.py and changed the index controller to:
return auth_wiki()

save and view

got:

401 UNAUTHORIZED

any clues?


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Setting up wiki is not as simple as stated in default.py

2014-05-17 Thread Rufus
Thanks for the tips Anthony!

After  I added the groups wiki_editor and wiki_author and put my
signon into those groups, the wiki started working (it appears I have
a bit more to learn about how the wiki works now that it's working),  but
I thought I was administrator at the time and it didn't automatically
set up those groups.

I think a one-sentence additional comment in default.py should mention
these additonal requirements.  (or refer to the documentation in the
manual).

(And yeah, the underscore in auth_wiki() was just a posting typo, of 
course)

Rufus



On Saturday, May 17, 2014 9:58:27 AM UTC-4, Anthony wrote:

 From the book:

 At this point no page has been created and in order to create pages you 
 must be logged-in and you must be member of a group called wiki_editor or 
 wiki_author. If you are logged-in as administrator the wiki_editor 
 group is created automatically and you are made a member.


 Also, it's auth.wiki() rather than auth_wiki().

 Anthony

 On Saturday, May 17, 2014 2:27:49 AM UTC-4, Rufus wrote:

 I wanted to create a wiki on PythonAnywhere, so I did the most 
 straightforward thing.
 I went to my site manager, said create simple app.   MyWiki.
   
 edited default.py and changed the index controller to:
 return auth_wiki()

 save and view

 got:

 401 UNAUTHORIZED

 any clues?




-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Can I simulate multiple user logins to web2py from a single computer?

2014-05-05 Thread Rufus Smith

Hi Robert,

I noticed that!  I fired up Chrome, and it started a different 
session.   Haven't tried with IE, and until now haven't worked with 
Safari on my desktop. (but on my iphone, yeah).  As the project gets 
closer to a beta stage,  I'll look at compatibility...


Rufus

On 5/5/2014 2:19 AM, Robert Kooij wrote:
Or if you want to keep it even simpler, just use multiple (different) 
browsers, each browser keep track of their own session.


I assume, as a web developer you have Chrome, Firefox and Safari 
installed anyway? Should be able to simulate 3 different user to start 
with. :)



On Monday, May 5, 2014 1:35:56 AM UTC+2, Rufus wrote:

Web2py'ers:

I am trying to create a back end for a multiple user game,
including, for instance, a chat room function.
However, when I try to do this locally, all windows change over to
the most recent login.

That is to say, I open up another window to the app, sign in with
a different user id, and type.into
the chat app, and get the new message.  But if I go to one of the
other formerly signed in windows
and try to chat, it submits as most recently logged in user.

Can I have multiple sessions/log ins from a single computer?

This may be a security issue, but would be useful for testing if
it could be overridden, even temporarily.

Rufus

--
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 a topic in the 
Google Groups web2py-users group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/web2py/kT6TxT3XSzo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
web2py+unsubscr...@googlegroups.com 
mailto:web2py+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Can I simulate multiple user logins to web2py from a single computer?

2014-05-04 Thread Rufus
Web2py'ers:

I am trying to create a back end for a multiple user game, including, for 
instance, a chat room function.
However, when I try to do this locally, all windows change over to the 
most recent login.

That is to say, I open up another window to the app, sign in with a 
different user id, and type.into
the chat app, and get the new message.  But if I go to one of the other 
formerly signed in windows
and try to chat, it submits as most recently logged in user.

Can I have multiple sessions/log ins from a single computer?

This may be a security issue, but would be useful for testing if it could 
be overridden, even temporarily.

Rufus

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Adding fields to auth_user (and creating alternate username validation)

2014-04-21 Thread Rufus
Still a noob, but starting to actually use web2py, and getting hands dirty:

I am working on  an actual web2py project (low-bandwidth word game 
back-end logic), and I'm finding as I make
incremental changes I hit potholes on the way.   I have some users who are 
going to the website to download alpha
versions of the program.   I recently enabled auth, to get registration 
capability.  Some enthusiastic users registered
before I noticed the separate username was not enabled.  When I enabled 
it, the database records has username of
None upon  migration, so people couldn't log on by username.   What I did 
is just plug in some  user names which
they can now change in their profile (once they find they can't log in, 
they can ask for their user name)

   In examining username, there is a limited format for user name, allowing 
only hyphens and decimal points. I wanted
more liberal character set, but there's not simple way to extend that 
capability.  To do that, I have to modify gluon.tools.
(Starting to get messy...)

   So my question is:  What procedure is recommended for expanding the 
auth_user data table, adding more fields and
changing validation.  Do I rewrite all of it?  Can I actually subclass it 
and extend it?  Do I edit gluon.tools in my own
system?




-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: develop iphone apps with web2py with this plugin

2014-04-10 Thread Rufus
The domain name in the link here expired a month ago  (March 8, 2014). 
Figures.


On Sunday, July 1, 2012 7:27:32 AM UTC-4, samrat kafle wrote:

  I tried this but not worked well I am searching a complete guide for 
 developing iphone apps and i have found one cool articles which i recommend 
 ofr dummies  here's a link developing iphone 
 appshttp://www.speakymagazine.com/iphone-app-development-guide-for-dummies/
  
 if you are really searching for developing iPhone apps with zero coding 
 skills.


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] unable to install application KPAX

2014-04-10 Thread Rufus
I tried to load the KPAX2 example app from:

https://github.com/mdipierro/web2py-appliances/blob/master/KPax2/web2py.app.KPax2.w2p

and I it kept telling me:

unable to install application KPAX

I don't know where to look for further details about WHY?

Rufus

(I tried loading it to PythonAnywhere as well as a local running web2py.)

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: unable to install application KPAX

2014-04-10 Thread Rufus
Progress...

Remembering a w2p is just a zipped archive, I opened it with 7zip and I 
found out this wasn't an archive.

apparently I downloaded a html page meant to be clicked-through.

Then a view raw let me download the actual repository.

Let's see how that goes...


On Thursday, April 10, 2014 2:30:05 PM UTC-4, Rufus wrote:

 I tried to load the KPAX2 example app from:


 https://github.com/mdipierro/web2py-appliances/blob/master/KPax2/web2py.app.KPax2.w2p

 and I it kept telling me:

 unable to install application KPAX

 I don't know where to look for further details about WHY?

 Rufus

 (I tried loading it to PythonAnywhere as well as a local running web2py.)



-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: unable to install application KPAX

2014-04-10 Thread Rufus
Well,

Couldn't even open default/index: there was a problem with foreign keys 
right off the bat.   Modified the model to ignore the foreign key 
constraint, for better or worse.

   Then I found out the layout.html does not handle the nested menu created 
in menu.py.

   (All this because I was looking for a chat example in web2py...)




-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Need more than one value to unpack

2014-01-10 Thread Rufus
so, the string object,  val is not composed of two substrings separated by 
a space.  There are
no spaces in the val string, based on that error.

The way the statement looks, I would say it is expecting a time string of 
the format:

dd/mm/yy hh:mm

or similar

On Tuesday, January 7, 2014 1:10:45 PM UTC-5, Akash Agrawall wrote:

  Traceback (most recent call last):
   File 
 /home/hornet632/webapps/joyofreading/web2py/applications/AK_M14/controllers/appadmin.py,
  line 243, in select
 limitby=(start, stop))
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 
 10335, in select
 return adapter.select(self.query,fields,attributes)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 2388, 
 in select
 return super(SQLiteAdapter, self).select(query, fields, attributes)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1831, 
 in select
 return self._select_aux(sql,fields,attributes)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1796, 
 in _select_aux
 self.execute(sql)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1916, 
 in execute
 return self.log_execute(*a, **b)
   File /home/hornet632/webapps/joyofreading/web2py/gluon/dal.py, line 1910, 
 in log_execute
 ret = self.cursor.execute(command, *a[1:], **b)
   File /usr/local/lib/python2.7/sqlite3/dbapi2.py, line 66, in 
 convert_timestamp
 datepart, timepart = val.split( )
 ValueError: need more than 1 value to unpack




-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: windows script to run locally

2013-10-15 Thread Rufus
This looks great!  

I'm not using web2py at this time, due to other projects, but I can see 
this script in my future, so I'm saving it!

Thanks Niphlod!


On Saturday, October 12, 2013 8:08:47 AM UTC-4, Niphlod wrote:

 no need... there's taskkill...

 @echo off
 set QCURDIR=%~dp0
 set QWEB2PY_PORT=2024
 set QWEB2PY_PID_FILE=%CURDIR%httpserver.pid
 set QWEB2PY_PASSWORD=password
 set QWEB2PY_APP=welcome
 set QWEB2PY_PATH=%~dp0web2py.py

 start web2py_server python.exe %QWEB2PY_PATH% -a %QWEB2PY_PASSWORD% -p %
 QWEB2PY_PORT% -d %QWEB2PY_PID_FILE%

 ping -n 5 127.0.0.1  nul

 START  /wait iexplore http://localhost:%QWEB2PY_PORT%/%QWEB2PY_APP%;

 set /p WEB2PY_PID=%QWEB2PY_PID_FILE%
 taskkill /PID %WEB2PY_PID%





-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Jessica McKellar talking about windows and the future of Python

2013-09-16 Thread Rufus
Good presentation.  But I misread Bruno's post originally and thought that 
Jessica mentioned web2py, and watched the whole presentation and didn't see 
any web2py specific comments.  (because it was actually Bruno's comment)  I 
came back here to ask for the comment timestamp in the video, and reread 
the post. There is a post on the video page mentioning web2py however.
.

On Thursday, September 12, 2013 3:00:39 AM UTC-4, rochacbruno wrote:

 Hi,

 I found this talk interesting 
 http://www.youtube.com/watch?v=d1a4Jbjc-vUfeature=share

 Jessica McKeller talks about how windows OS is important to the future 
 of Python, and how it is complicated to use Python on windows nowadays.

 And I think that *web2py is the only framework that does a good job 
 working on windows*, any other framework has too many problems to run on 
 windows.

 So web2py is helping to build the future of Python!


 -- 

 *Bruno Rocha - @rochacbruno*
 http://github.com/rochacbruno
 http://rochacbruno.com.br
 http://pythonhub.com
  

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Python Module, USB device, web2py

2013-09-10 Thread Rufus
Where did the thread go?

A general comment:  If you can do it in Python, you can do it in web2py.
(in my limited experience.)


On Tuesday, September 10, 2013 7:58:41 PM UTC-4, viniciusban wrote:

 It depends. 

 Is you multimeter in the same computer your web2py instance is running? 

 On Tue, Sep 10, 2013 at 5:33 PM, Zachary Burrows 
 zbur...@gmail.comjavascript: 
 wrote: 
  Hello all! 
  
  My boss wants me to use web2py to call a script that reads a value from 
 a 
  multimeter. He wants that value put onto a web2py page. I have written 
 the 
  script, but am not getting anywhere in trying to call it and display its 
  result on my web2py page. I just keep breaking stuff (getting errors). 
  
  I'm not a web developer, but I've been reading about MVC design and 
 going 
  through Python the Hard Way. I'm learning, but am far from the 
 promised 
  land. 
  
  Can anyone give me a quick and dirty way to do this? Or am I in WAY over 
 my 
  head? Cuz that's how I feel right now. 
  
  thanks! 
  
  -- 
  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 javascript:. 
  For more options, visit https://groups.google.com/groups/opt_out. 


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: GoogleGroup - how do you keep track of useful code?

2013-08-28 Thread Rufus
If you use windows, you can open a folder on your desktop and drag-and-drop 
the links into it.
(if you trust that the snippet will always be available in the 'net)
I have several folders-of-shortcuts on my desktop by categories, e.g.:  
Current Projects, Diversions, Past Projects, Python Sites, etc.  
(the shortcuts don't have to be just local directories and applications).

I'm using Firefox, and I just drag the little icon to the left of the web 
URL and drag that to the folder.

On Tuesday, August 27, 2013 6:03:54 PM UTC-4, greenpoise wrote:

 I cant seem to find a way to track useful code. I can only Star really 
 helpful posts but finding a specific starred item is a pain in the nuts 
 specially when I am switching tasks between web2py and other projects here 
 at work. How do you guys keep track of that snippet of code you find on 
 Web2py google group??? 


-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Excellent Video about web2py but no sound or subtitles

2013-04-17 Thread Rufus
I'm only 5 minutes into it, and I had to reply!

It is great to be watching over the shoulder of a person who knows what 
he (or she) is doing!

I can't wait to watch the rest

-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: pySerial - how to open port

2013-03-29 Thread Rufus
Perhaps it is already open by another process?

I'm not a major linux user (yet) but in windows only one process can open 
the serial port at a time.  Perhaps
Permission denied is the same as In use.

Also make sure you close it when, if your application doesn't terminate, as 
web2py doesn't, depending where
and how you opened it.



On Thursday, March 28, 2013 4:54:29 AM UTC-4, theoffi...@gmail.com wrote:

 Hello everyone. 
 I would like to use web2py as my Raspberry Pi webserver. i need to send 
 some serial data from the web application to Raspberry Pi and send to a 
 device. However, i encountered the error of  class 
 ‘serial.serialutil.SerialException’ could not open port /dev/ttyAMA0: 
 [Errno 13] Permission denied: ‘/dev/ttyAMA0′ 

 I have been stuck at this for weeks and i can't seem to find any solution 
 except moving on to using cherrypy and jquery. :( but i really wish to use 
 web2py!

 So, i have this code below that could work fine using normal python script 
 as well as cherrypy. in web2py, i put this under default.py and create a 
 new def for it. 

 import serial
 import time

 serialport= serial.Serial (/dev/ttyAMA0, 9600, timeout=0.5)
 serialport.write(\x03LI1234\x0D)
 response=serialport.readlines(1)
 print response
 time.sleep(1)

 what could have been done wrongly? :(

 Read more details here: 
 http://yvonnezoe.wordpress.com/2013/03/14/web2py-web-app-progress/ 


-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: web2py is moving

2013-03-01 Thread Rufus

Disruption: The book link is broken.


-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] routes, removing appname and controller from all links

2013-03-01 Thread Rufus
# As simple as this?   (I'm new too)

routes_in = (
('/$anything', '/myapp/default/$anything'),
)

routes_out = (
('/myapp/default/$anything', '/$anything'),
)


-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: custumize error page

2013-03-01 Thread Rufus
routes.example.py  is very helpful for this (I was tempted to add another 
hint, butnah.)

On Friday, March 1, 2013 9:48:06 AM UTC-5, BlueShadow wrote:

 Hi,
 I like to make my errorpages a little nicer. adding a link to get back to 
 my main site... and displaying the error code 400 404 etc.
 How can I do that. can I have like a function like error_site() in my 
 controler?
 do I need to do something with the routes.py?

 thanks for your help.


-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] routes, removing appname and controller from all links

2013-03-01 Thread Rufus Smith

I anticipated that, because I tried it.

I added:

routes_onerror = [
   (r'*/*', r'error')
]

to call an error function. in this case, /myapp/default/error



On 3/1/2013 7:14 PM, jjg0 wrote:
Oh I wish it were that simple, but no I still see invalid requests 
when trying that:(


Can anyone help me with this?  I still have not resolved this issue.




On Friday, March 1, 2013 5:49:46 PM UTC-5, Rufus wrote:

# As simple as this?   (I'm new too)

routes_in = (
('/$anything', '/myapp/default/$anything'),
)

routes_out = (
('/myapp/default/$anything', '/$anything'),
)


--

---
You received this message because you are subscribed to a topic in the 
Google Groups web2py-users group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/web2py/IjE2kSJ9j68/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to 
web2py+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.




--

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How to use a text file instead of a db?

2013-02-11 Thread Rufus

And if you don't need the layout (by returning a dict), just return the 
file contents:

def showfile():
 return (open(filename.ext,r).read())



-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How do I use web2py to make a simple GUI?

2013-01-27 Thread Rufus
To quickly learn some html and css,  I recommend the exercises at 
www.codeacademy.com  
Not perfect, but useful.


-- 





[web2py] Re: looking for volunteers to help proof-read book 5th ed.

2013-01-26 Thread Rufus


On Sunday, January 20, 2013 6:52:02 PM UTC-5, Massimo Di Pierro wrote:

 I am looking for help proofreading the final version of the book. It is 
 almost done up to a final touch. 


Would have loved to help, but didn't see this until late last night (due to 
laptop software migrations...)

Just a couple minor suggestions in the part I had time to read, mostly just 
a matter of personal taste and how
the sentences scanned for me, as a native english speaker.

 from:
If you benefit from it, we hope you will feel a little more like 
contributing back to society in whatever form you choose.
to:
If you benefit from it, we hope you will feel encouraged to ''pay it 
forward'' by contributing back to society in whatever form you choose.

from:
+web2py leaves little choice to application developers in matters related 
to security.
to:
+web2py leaves little exposure for applications in matters related to 
security.

from:
+Experimentally we support more databases.
to:
+We support additional databases (experimentally), and additional ones are 
constantly being developed.

from:
+Once one or more database tables are defined, web2py also generates a 
fully functional web-based database
to:
+Once one or more database tables are defined, web2py automatically 
generates a fully functional web-based database

from:
+web2py provides a ticketing system. If an error occurs, a ticket is issued 
to the user,
to:
+web2py provides a ticketing system for error events. If an error occurs, a 
ticket is issued to the user,

from:
+Another feature of web2py is that we, its developers, commit to maintain 
backward compatibility in future versions.
to:
+Another important feature of web2py is that we, its developers, commit to 
maintain backward compatibility in future versions.

Mostly quite minor, but there it is.

Keep up the excellent work, and I'm ready to buy the next copy as soon as 
it's available!

Rufus

-- 





Re: [web2py] Re: looking for volunteers to help proof-read book 5th ed.

2013-01-26 Thread Rufus


On Saturday, January 26, 2013 12:25:41 PM UTC-5, rochacbruno wrote:

 I think both are bad! specially by the fact that the largest web2py 
 audience is not native English speaker, this kind of sentence should be 
 more explicit.

 web2py takes care of main security issues, so developers have little...


+1 Bruno.
 

-- 





Re: [web2py] Re: How do I use web2py to make a simple GUI?

2013-01-26 Thread Rufus


On Friday, January 25, 2013 10:39:52 AM UTC-5, Alec Taylor wrote:

 On Fri, Jan 25, 2013 at 1:59 AM, Alan Etkin spam...@gmail.comjavascript: 
 wrote: 
  Hi, the answer to this question may well be that I should leave web2py 
  alone and use something else, so I had better start 
  
  Note that there's a special mobile plugin for web2py. See the 
 instructions 
  at web2py dev server/admin/plugin_jqmobile/about 
  -- 

 Hi Alan, 
 That mobile thing is interesting, but have you noticed that 'edit' doesn't 
 work? 


I tried to edit with my iPhone and had that problem.  And now I can't get 
it away from mobile mode.

 

-- 





[web2py] Re: Remote access appadmin

2012-12-22 Thread Rufus
I started up a brand new install of the latest stable web2py on my laptop: 

Version 2.3.2 (2012-12-17 15:03:30) stable

Running on my home network @ 192.168.1.68:8000

I can open Safari on my iphone and enter:

http://192.168.1.68:8000

and get the welcome screen for Web2py.If I press the administrative 
interface I get the message:

Admin is disabled because insecure channel.

Which is fine, but when I try:

https://192.168.1.68:8000

I get a safari error message:

Cannot Open Page
Safari cannot open the page
because it could not establish a
secure connection to the server.

Okay, so how do I create the required certificates and install them
on web2py and the iphone?




-- 





[web2py] Re: IMPORTANT

2011-10-13 Thread Rufus
On Oct 13, 7:06 am, Johann Spies johann.sp...@gmail.com wrote:
 If somebody has a problem with my signature, please contact me directly.

 I will not be offended and I do not wish to offend anyone.


Johann,

I wanted to contribute to this thread before it was shut down.  I
noticed your signature many a time, and my annoyance was not in the
content
of it, but the size.  You are a frequent contributor to the threads,
but
often your signature is several times longer than your posting.  That
does
not help the signal/noise ratio of the forum.  I consider any
signature that
is larger than a tweet (140 chars), or even a half-tweet, to be
excessively
verbose.  If have a larger message, make your signature a hyperlink to
the full
text and save some bandwidth.

Rufus




[web2py] OpenLayers and Web2Py

2011-10-05 Thread Rufus
Has anyone created a Web2Py Python wrapper for OpenLayers?

I searched in the slices, and in the plugins, and in the discussions.

And the last activity was a couple years ago.

I'd like to not have to pay the Google Tax.\

Rufus


[web2py] Is there a way for the editor pages to prevent navigation away while the source changes are not saved?

2011-09-13 Thread Rufus
Several times a day I navigate away from an editor page, either with
forward or backward buttons, or a link, and sometimes I can lose a
considerable amount of changes (and disturb the thought process...)

Isn't there a way we can prevent the web page from being navigated
away while the edit window has changed data in it?   There are plenty
of websites that hold me captive until I dismiss their customer
satisfaction survey or indicate that I definitely don't want their
deal of a lifetime.

The editor must know when the data has changed, so can't it set a flag
so you have to save or revert back changes before you can leave the
edit page.   Any ideas?

I've tried to mitigate the problem by doing my editing in a separate
window or IDE and doing the testing in another, but that removes all
those great shortcuts that the online development environment has!
Also, with the source in another editor, there's still the problem of
forgetting to save it prior to running the next test.


Rufus



[web2py] Re: What if i want 2 views for the same controller function?

2011-09-13 Thread Rufus
As others have said, setting response.view='...' to any view will
change the view for the controller.

In fact, you could go crazy and put a view dictionary in session,
e.g.

if my_controller in session.views.remap:
response.view = session.views.remap[my_controller]

each multi-view controller checks this dictionary for alternate view
selection.


On Sep 13, 11:31 am, António Ramos ramstei...@gmail.com wrote:
 If i have 2 views with the same controller function i should not create the
 second function in the same controller.

 Also detecting for example ismobile in the view makes me mix diferent
 perspectives in the same view. This i find ugly coding. and ugly reading

 There should be some mecanism that could permit diferent views  to be
 attached to the same controller


[web2py] Re: What if i want 2 views for the same controller function?

2011-09-13 Thread Rufus
In fact, view reselect might be nicely handled in a decorator
function!

Just decorate those functions that require multiple views (like mobile
versus normal)
It could modify the view name for the correct view file.


[web2py] Saving Site or App specific data: Use a special db table with one huge record?

2011-09-07 Thread Rufus
For site persistant data, is it customary to put it
in a database table with one large record?

There are some statistical things I'd  like to keep track of on the
site.   Is it standard practice to define one data table that has
one large record containing the information?, for instance:

Number visitors since inception
emails sent
uploaded bytes stored
...

You don't want to pump through all your data base data for these
numbers, so it's probably more efficient to just keep them in a
file.

Is it normal to do this with a database table called something
like site_stats (or maybe app_stats, to stay in the application's
space), and simply do update_record with the changed field?
This is what I did:
 in models/sitedb.py -
db.define_table('app_stats',
Field('visitors', type='integer'),
Field('emails_sent', type='integer', default=0))
--

and in my controller I had (I left in the first misfire and comment
as a future warning to others):
--
#stat_rec = db().select(db.app_stats.visitors).last()
# the above line generates a KeyError for stat_rec.update_record
# the line below worked fine
stat_rec = db(db.app_stats).select().last()
if stat_rec:
   stat_rec.update_record(visitors = stat_rec.visitors + 1)
else:
   stat_rec = db.app_stats(db.app_stats.insert(visitors=1))
db.commit()
-

Are there other ways people save this kind of data?


[web2py] Re: form.accepts returning false

2011-09-07 Thread Rufus

Did you look at form.errors to find out why it returns false?

If form.errors doesn't exist, the accepts() method didn't see
it as having been submitted, and will return false.

See Example 28 in

http://web2py.com/examples/default/examples

for the three cases:  unsubmitted, submitted no error, submitted w/
error

Rufus


[web2py] Re: Useful validators IS_LETTERS, IS_DIGITS

2011-08-31 Thread Rufus
Since the two functions are subsets of IS_ALPHANUMERIC(), I'd suggest
that the sub-functions be named:

IS_ALPHA()
and
IS_NUMERIC()


On Aug 28, 2:56 pm, Jonathan Lundell jlund...@pobox.com wrote:
 On Aug 28, 2011, at 11:23 AM, Saurabh Sawant wrote:

  They seem fine. Although, having ready to use validators would save
  some time for those learning the framework. I personally expected
  those validators to be already there while I was learning.

 Trouble is, there's an endless list of pattern expressions that can be 
 useful. IS_MATCH is pretty powerful, and should be in your bag of tricks (in 
 fact, IS_ALPHANUMERIC just calls IS_MATCH).

 At the very least, consider that you might want a language-dependent 
 IS_LETTERS, or at least one that accepts the common alphabetic variants.

 However, if you do that, do it this way:

 IS_MATCH('[0-9]+', strict=True)
 IS_MATCH('[a-zA-Z]+', strict=True)

 strict=True forces a $ at the end of the regex. Or you can just include the 
 $. (IS_MATCH is already anchored at the beginning of the string.)









  On Aug 28, 11:05 pm, Massimo Di Pierro massimo.dipie...@gmail.com
  wrote:
  what's wrong with?

  IS_MATCH('[0-9]+')
  IS_MATCH('[a-zA-Z]+')

  On Aug 28, 12:59 pm, Saurabh  Sawant ris...@gmail.com wrote:

  But IS_ALPHANUMERIC by virtue of its name suggests both letters and
  numbers. Having separate validators for each of the cases would make
  the code more readable.

  db.auth_user.first_name.requires=IS_LETTERS()
  db.auth_user.age.requires=IS_DIGITS()


[web2py] Re: How to return a gif image onto the webpage?

2011-08-22 Thread Rufus
What have you tried?

Have you ever gotten *any* graphic image onto a web page with web2py?
I'd start with a known image at a known location.

and for debugging purposes, I'd add to your default/index.html a line
that said
h2Image from url: {{=image}} /h2
Just to make sure I passed the right URL to the view.

That would be a start.


One thing I see, but I may be wrong.  If your file is a gif file,
shouldn't the controller line
 image=URL(r=request,f='cavityflow_plot')
be
 image=URL(r=request,f='cavityflow_plot.gif')
?

On Aug 22, 6:10 am, Henri Heinonen henri.heino...@gmail.com wrote:
 default/index.html:
 {{extend 'layout.html'}}
 h1cavityflow/h1
 {{=form}}
 {{if image:}}
 hr /
 h2Figure/h2
 img src={{=image}} alt=loading.../
 {{pass}}

 default.py:
 def index():
     form=FORM('nx:', INPUT(_name='nx', _value=20.0), BR(), 'ny:',
 INPUT(_name='ny', _value=20.0), BR(), 'nt:', INPUT(_name='nt',
 _value=100.0), BR(), 'nit:', INPUT(_name='nit', _value=100.0), BR(),
 'dt:', INPUT(_name='dt', _value=0.01), BR(), 'vis:',
 INPUT(_name='vis', _value=0.1), BR(), 'rho:', INPUT(_name='rho',
 _value=1.0), BR(), INPUT(_type='submit',_value='Make figure'))

     image=None
     if form.accepts(request.vars, session, keepvalues=True):
         session.flash = 'Form accepted.'
         session.nx=float(request.vars.nx)
         session.ny=float(request.vars.ny)
         session.nt=float(request.vars.nt)
         session.nit=float(request.vars.nit)
         session.dt=float(request.vars.dt)
         session.vis=float(request.vars.vis)
         session.rho=float(request.vars.rho)
         image=URL(r=request,f='cavityflow_plot')
     return dict(form=form, image=image)

 def cavityflow_plot():
     return cavityflow(session.nx, session.ny, session.nt, session.nit,
 session.dt, session.vis, session.rho)

 def cavityflow(nx, ny, nt, nit, dt, vis, rho):
 ...*clip* *clip* ... # Here the application will make one hundred png
 images.
            os.system(convert *.png cavityflow.gif)
 # What do I need to add in here in order to return the cavityflow.gif
 onto the webpage of my application?

 The question is in the source code as a comment line.

 Yours sincerely, Henri Heinonen.


[web2py] Creating local standalone program importing web2py models files?

2011-08-19 Thread Rufus
I'm sure this is a very fundamental Win2py or Python thing.   I'm such
a Noob.

I am writing a database populator program that I would like to run
outside the framework
to fill the database with test data.
I have been struggling with importing the models from the
application.  Here's what I've tried:

I put my standalone app in web2py\alone subdirectory

to point to web2py directory, I use:
---
more_path = ..+os.sep
if more_path in sys.path:
pass
else:
sys.path.append(more_path)
--
then I find the model directory
model_path = os.path.abspath(..\\applications\\myapp\\models)
 and add it to sys.path in a similar way
--
I try to import the database connection with:
--
import db
-
which complains there is no 'request'variable
so I decided to open it directly with
---
from gluon.dal import DAL, Field
db = DAL('sqlite://storage.sqlite')
-
Then when I try to import the data table statements
with
--
import pdpb # define the data tables
--
which complains there is no 'db'

I guess I need a form of import which is more like #include statements
in C or assembly programming.

Is this a scoping and/or namespace issue?

How does the web2py framework seem to load the different .py files
of a model prior to running the controller code yet have request,
session,
response variables available prior to executing the model code?

while waiting for replies, I'll just have to put the database initter
into a controller
function inside the framework. (I really don't want to have multiple
copies of duplicate table definition code.)

In summary, I'd like to create a python program outside the web2py
framework, using the same model files as used by the framework, so the
program looks somewhat like:

### some kind of path setups
import db # get database connection
import pbdb   # get table definitions
db.employee.insert(last_name=Smith, first_name=Rufus)
db.commit()
--
Thanks


[web2py] Re: routes.py and rewriting URLs

2011-08-15 Thread Rufus
I'm a newbie too, but I see myself also prettying up my
URL's with routes.py.

Is your routes.py in the correct directory?  If it is in
an application directory, it won't work.  it should be in
the web2py directory.

A hint: You can always put print statements in any of your .py files
to verify they are being executed.

For your example, I would guess routes.py would look like:

---
routes_in = ( ('admin/courses','init/admin_courses/index'),)
routes_out = ( ('init/admin_courses/index', 'admin/courses'),)
print routing lists initialized...
---

and it would be in your web2py directory.

(...time passes, trying it out)

I discovered one other thing!  If you edit routes.py, SHUTDOWN AND
RESTART WEB2PY!

The routing lists are initted at web2py startup, not on every http
request!

Rufus




On Aug 14, 6:26 am, fishwebby pastelva...@gmail.com wrote:
 Hi,

 I'm struggling with the routing in web2py and I'm hoping someone can
 point me in the right direction (I'm a web2py newbie).

 I want to change this (which works):

 http://127.0.0.1:8000/init/admin_courses/index

 to this:

 http://127.0.0.1:8000/admin/courses

 but I can't get it to work with the various routes.py files. I've
 followed the suggestions here:http://wiki.web2py.com/URL_Re_writing
 and here:http://www.web2py.com/book/default/chapter/04#URL-Rewrite

 and various others from this forum but I can't get anything other than
 invalid request.

 I want to do this for various controllers, for example:

 http://127.0.0.1:8000/admin/usershttp://127.0.0.1:8000/admin/users/3/assignments

 (I'm coming from Rails / Symfony / Kohana so perhaps I'm trying to do
 something that isn't the web2py way?)

 If anyone can point me in the right direction it would be greatly
 appreciated!

 Many thanks
 Dave


[web2py] Re: proper way to define a user table

2011-08-03 Thread Rufus


On Aug 1, 9:10 am, Anthony abasta...@gmail.com wrote:
 On Monday, August 1, 2011 6:23:03 AM UTC-4, Ramos wrote:

  this way works

  auth.settings.extra_fields['auth_user'] = [Field('Skype')]

 Yes, this will create auth.settings.extra_fields['auth_user']. Once created,
 you should be able to add additional fields via append().

 Anthony

If you are trying to append to a list, or create it if it's not
present, don't
you want to do it this way?

try:
   auth.settings.extra_fields['auth_user'].append(Field('Skype'))
except:
   auth.settings.extra_fields['auth_user'] = [Field('Skype')]

Rufus


[web2py] Re: Do we need a Web2py micro-framework , or split web2py into multiple components ?

2011-08-03 Thread Rufus
I just recently started with web2py, and found that it
is a pretty big elephant that is hard to eat a bite (byte?)
at a time, precisely because everything's included.

Even a simple app gets and incredible amount of scaffolding.

I routinely delete the languages directory, as I don't need
the clutter during development.

I am starting to appreciate all the help the scaffolding supplies,
like the development links the layout provides during development,
but I found it confusing during learning.

Perhaps there should be a minimalist app, with an empty
model, one default controller, and one default/index.html view.

or if someone is ambitious, a new project start page with
checkboxes of the components to include or remove from the
scaffolding.
Such as:
. appadmin
. jQuery
. ajax
. SQL database
. default views
. crud
. mail
. layout.html
. css pages
. languages
. cache
. cron

Obviously, the inclusion of some require the inclusion of others.

After all, you can have a minimum hello world (as in the tutorial)
with only one file:

someapp/controllers/default.py

containing only

def index():
return Hello World!

Or perhaps a more usable minimum (with helpers) would be:

def index():
return HTML(H1('Site currently under construction.  Come back
soon!'))


The Web2Py Framework is Extreme Awesomeness

But my brain hurts if I have to deal with too much of its beauty at
once.


(What started as just a +1 for reduced scaffoldings has gone on too
long already)



[web2py] I keep getting Invalid Circular Reference using Project Wizard!

2011-07-28 Thread Rufus
I am trying to create a very straightforward database of about 5
tables (for now)
but when I try to use the wizard, I always get errors.  A trimmed down
version
follows:

table employee
   first_name
   last_name
   picture upload


table driver
   employee_id employee
   scan_tag

table vehicle
name
picture upload

table transaction_type
 description

table transaction
 driver_id  driver
 type  transaction_type
 modified_by  employee
 source_timestamp  datetime


I can never successfully enter this data through the wizard without a
flash up of
Invalid Circular Reference or  if I skip to generate, I get a
runtime error.

Any clues?

Rufus


[web2py] Re: I keep getting Invalid Circular Reference using Project Wizard!

2011-07-28 Thread Rufus
I'll prefix all my field names in the wizard to avoid that
keyword problem and see what happens.

On Jul 28, 12:25 pm, Anthony abasta...@gmail.com wrote:
 On Thursday, July 28, 2011 11:53:47 AM UTC-4, pbreit wrote:

  I think field name type could be a problem.

 I'm not sure -- I think the wizard will end up changing that to 'f_type' (it
 adds 'f_' to field names and 't_' to table names).

 Anthony


[web2py] Re: I keep getting Invalid Circular Reference using Project Wizard!

2011-07-28 Thread Rufus
Yeah, I know the fields would be prefixed twice.  It was just an
experiment to ensure any field names I chose didn't correspond to
keywords.  It worked fine when I did that, so I may have used type
as was suggested here.  I went through so many iterations I wasn't
exactly sure which I had tried.

It just wasn't very clear what the Circular Reference was referring
to in the flash-up.


Rufus

P.S.  I was trying to edit out those prefixes out of the generated
files and found out what a nightmare it is trying to change a field
name manually.



On Jul 28, 2:20 pm, Kenneth Lundström kenneth.t.lundst...@gmail.com
wrote:
 It should definitly not help that you Rufus prefix all fields by hand as
 web2pys wizard already does that automatically. But it could be that the
 wizard does not understand to prefix a reserved word. Maybe it helps to
 prefix by hand. But then your fields are problaly prefixed twice.

 Kenneth







  I'll prefix all my field names in the wizard to avoid that
  keyword problem and see what happens.

  On Jul 28, 12:25 pm, Anthonyabasta...@gmail.com  wrote:
  On Thursday, July 28, 2011 11:53:47 AM UTC-4, pbreit wrote:

  I think field name type could be a problem.
  I'm not sure -- I think the wizard will end up changing that to 'f_type' 
  (it
  adds 'f_' to field names and 't_' to table names).

  Anthony


[web2py] wiki.web2py.com seems pretty broken

2011-07-27 Thread Rufus
Is the wiki still actively supported in any way?

I found a problem in a tutorial and wanted to make a correction, but I
couldn't edit
it (not being registered)

I tried to register as a new user, and I kept getting invalid when
entering a new user
password.

Also none of the links work on the front page.

Incidentally the FAQ link on the main page here doesn't seem to work
either.

I get:

Forbidden

You don't have permission to access /admin/default/ticket/AlterEgo/
66.212.195.213.2011-07-27.21-30-04.996e2ca0-0918-4f37-8026-78e7dc5cb343
on this server.
Apache/2.2.8 (Ubuntu) mod_wsgi/3.2-BRANCH Python/2.5.2 mod_ssl/2.2.8
OpenSSL/0.9.8g Server at www.web2py.com Port 80

as it tries to get to http://www.web2py.com/AlterEgo


[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-26 Thread Rufus
I'm new to web2py but since I have an iphone I've been interested in
the mobile
view/standard view capability of web2py so I've been watching this
thread.

Could you possibly generalize display devices even more, to even
provide per-user
or per-session skinning of the web page, storing the display mode/
theme/skin
value in the session storage.  Then controllers and views could adjust
according
to their own abilities.


(to tell the truth, the mobile-enabled websites really tick me off
when there is no way for
me to force it back to the standard page.)