[web2py] Unable to download "not-small" SWF files from static folder

2011-08-18 Thread Jagmal
I am stuck with a weird problem. I have some SWF files to be served to users 
and unless I figure out how to build authorization over it, I have put SWFs 
in static folder. This all worked fine on my test server (on intranet). But, 
when I put it on production server, SWF file does not load (it shows "Movie 
Not Loaded").

FYI - both test and production servers have python 2.4 and I am using web2py 
1.95.1 version.

I tried with another SWF from internet 
(specifically http://www.mapsofwar.com/images/Religion.swf) and it stops 
after 9%.

I feel that I am missing something very basic here.

Any advice?

Thanks in advance,
Jagmal


[web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-08-18 Thread Jagmal
I guess I need more help. Please bear with me.

I assume that you are suggesting the following approach:

If I have a SWF at /APP/static/file.swf, then I should create following 
entry in routes_in in routes.py
  (r'.*/APP/static/file.swf', r'/APP/controller/file')

And in controller.py, we add a method file() but what should go inside that? 
Should it be something like this?:

def file():
  response.render('URL_to_static_path')




[web2py] Re: Web2Py with Python 2.4

2011-08-08 Thread Jagmal
Thanks Anthony! That was helpful.

Can we put this information on the download page?


[web2py] Re: Web2Py with Python 2.4

2011-08-08 Thread Jagmal
Thanks Ross!

Just a quick question - what is the easiest way to download v 1.95.1 ? Do I 
need to check this out from repository?

Regards,
Jagmal


Re: [web2py] Re: Web2Py with Python 2.4

2011-08-04 Thread Jagmal
Thanks John for responding.

I got the following error when I tried running web2py.py on a machine with 
python 2.4

ImportError: No module named hashlib


I did some googling and installed hashlib from 
http://code.krypto.org/python/hashlib

How should I have proceeded?

Regards,
Jagmal



[web2py] Re: Web2Py with Python 2.4

2011-08-04 Thread Jagmal
Massimo,

I got following error on server:

ImportError: No module named hashlib


So, I got hold of one local machine with python 2.4 and was able to 
reproduce the same error. Then, I installed latest hashlib package and 
retried. This time I got following error:

ImportError: No module named uuid


And I tried again after installing uuid. But, now I get the following error:

Traceback (most recent call last):
  File "web2py.py", line 16, in ?
import gluon.widget
  File "/public/shared/web2py/gluon/widget.py", line 24, in ?
import main
  File "/public/shared/web2py/gluon/main.py", line 37, in ?
from custom_import import custom_import_install
  File "/public/shared/web2py/gluon/custom_import.py", line 125
finally:
  ^
SyntaxError: invalid syntax

 
I have two questions now:
 - How do I resolve this? I feel that I am making some silly mistake or 
do not understand some basic thing.
 - If I need to install python pakages to make this work, can I get 
around that by putting these packages in site-packages in web2py or by any 
other method? I don't explicitly want to ask service provider to install 
modules. I would prefer them upgrading to latest python (but that may take 
some time).


Thanks & Regards,
Jagmal



[web2py] Web2Py with Python 2.4

2011-08-02 Thread Jagmal
Does web2py work with python 2.4?

Our servers have python 2.4 as of now and though i have requested for an 
upgrade, I am not sure if it will be available before I need.

Web2Py seem to ask for hashlib and uuid packages to run and I tried by 
installing those (on local machine with 2.4) but it didn't work. Also, is 
there anyway I could get around installing packages by tweaking PYTHONPATH?

Thanks & Regards,
Jagmal


[web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-07-29 Thread Jagmal
>>Not sure what ".swf is not a recognized extension" means in this 
>> context. Are you saying it is not setting up the content-type? 
Sorry - my ignorance and incorrect words. Actually, I should have asked 
another question - How do I render a view which is not HTML (again a very 
basic question)? 


[web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-07-29 Thread Jagmal
Thanks Massimo. I think it works (I tried by using response.render - is 
there any other way as .swf is not a recognized extension?).

But, I now have a more interesting problem. This FLASH file actually depends 
on multiple files/folders in the same folder (including some XMLs for data, 
audio files etc). I don't think it would be a good way to create controllers 
for every possible combination. Is there anyway around it?

P.S.: I am really thankful to the community. I have got great response on 
two (dumb) threads so far. I am liking it.


Re: [web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-07-27 Thread Jagmal
Does 'upload' field not just copy file over to a location and provide its 
link when asked? If so, I should be able to access the file directly anyhow 
by looking at the URL in the final HTML. Am I missing anything?



[web2py] Re: Enforcing access control on Flash file embedded inside a view

2011-07-27 Thread Jagmal
To be clear:

Let us say I have a view app/default/view.html, which has a flash file (say 
FLASH.swf) embedded inside it. One can access this view only if s/he has 
proper permission. The flash file is supposed to be accessible only on 
permission too. But, what if someone tries to directly access the flash file 
(http://server/location/FLASH.swf)?

FWIW, the flash file is a legacy file and I can not change/remove it (at 
least not in near future).



[web2py] Enforcing access control on Flash file embedded inside a view

2011-07-27 Thread Jagmal
Hi All,

I have a view which includes a flash .swf file. The view has proper 
permissions using Auth but how do I make sure that noone can access .swf 
file directly?

Thanks,
Jagmal


[web2py] Re: [Newbie] Best practice to set application wide settings

2011-07-26 Thread Jagmal
Thanks David for the link. I think I am not at a stage right now, where I 
need to store configurations in the database. I will definitely give this a 
try once I am at that stage.

Re: [web2py] [Newbie] Best practice to set application wide settings

2011-07-26 Thread Jagmal
Thanks Bruno for the suggestions. I will keep these in mind.

[web2py] [Newbie] Best practice to set application wide settings

2011-07-22 Thread Jagmal
Hi All,

I am new to web2py framework and have been working on a small project
to set up authentication. In here, I would like to configure default
options. For ex, I would like to disable registration. I am wondering
what is a good way to do it.

Should I create a model class and put these default settings there?
Also, should I be using the same model class to configure DB and other
application wide settings?

Regards,
Jagmal