admin page is not working in web2py 2.7.4

599 views
Skip to first unread message

frasse

unread,
Oct 16, 2013, 5:21:50 AM10/16/13
to web...@googlegroups.com
HI
I upgrade web2py to 2.7.4 from 2.7.3. admin page is not working any more please see the attach file.
do you have any idea ?

Regards
Frasse
web2py.JPG

Niphlod

unread,
Oct 16, 2013, 5:28:17 AM10/16/13
to web...@googlegroups.com
did you configure your webserver to allow the static files to be served with folder versioning ?

as a quick way to restore things as they were is to remove this line


from the file.
But, you'll be missing quite an important feature.

frasse

unread,
Oct 16, 2013, 10:07:16 AM10/16/13
to web...@googlegroups.com
I am using apache-wsgi-web2py . Should I   config static  file in apache config files  for all app in web2py applications ? 

/frasse

frasse

unread,
Oct 16, 2013, 10:54:42 AM10/16/13
to web...@googlegroups.com

Hi 
here is how my config look lik. is it what you think it should be. it is not working . But it works for older version. 
Thanx
/F

  AliasMatch ^/([^/]+)/static/(.*) \
           /var/web2py/applications/$1/static/$2
  <Directory /var/web2py/applications/*/static/>
    Order Allow,Deny
    Allow from all
  </Directory>





Den onsdagen den 16:e oktober 2013 kl. 11:28:17 UTC+2 skrev Niphlod:

Niphlod

unread,
Oct 16, 2013, 3:07:53 PM10/16/13
to web...@googlegroups.com
you should use another syntax to have static files served with static_version enabled.

https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-ubuntu.sh#L110

For the ones not really accustomed with regexes, all we're trying to do is the following
We have a file ....
/appname/static/abc.css

we want to serve it as
/appname/static/abc.css
AND as
/appname/static/_1.2.3/abc.css
OR
/appname/static/_2.3.1/abc.css
etc etc

so....

AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) /home/www-data/web2py/applications/$1/static/$2

The bold red part is what has been "added" to web2py's scripts to make apache serve the same file if there is a _number.number.number "prefix" just right after "static".

Mark Abajian

unread,
Oct 17, 2013, 12:50:42 AM10/17/13
to web...@googlegroups.com
Thank you for the explanation, Niphlod.  I've updated my AliasMatch, and that is working for me.

Mark Abajian


On Wednesday, October 16, 2013 12:07:53 PM UTC-7, Niphlod wrote:

AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) /home/www-data/web2py/applications/$1/static/$2

The bold red part is what has been "added" to web2py's scripts to make apache serve the same file if there is a _number.number.number "prefix" just right after "static".
Frasse

frasse

unread,
Oct 17, 2013, 5:24:47 AM10/17/13
to web...@googlegroups.com
Hi Niphlop
It is not working for me.
I change AliasMatch to this
Ange   AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) \
           /var/web2py/applications/$1/static/$2

  <Directory /var/web2py/applications/*/static/>
    Order Allow,Deny
    Allow from all
  </Directory>


To make it work . do you see any error in my config example
Thanks
/F

Niphlod

unread,
Oct 17, 2013, 3:17:14 PM10/17/13
to web...@googlegroups.com
you have some other error elsewhere or you didn't restart apache after the change. It works flawlessly.

frasse

unread,
Oct 17, 2013, 8:01:50 PM10/17/13
to web...@googlegroups.com
I have restart my apache. The only change I have in my web2py configration is in routes.py and it is like this

routers = dict(

   
# base router
    BASE
= dict(
        default_application
= 'myapp',
     default_controller
= 'start',
   
),
)


can this be a problem ?

Thanks
/F

Leonardo Pires Felix

unread,
Oct 18, 2013, 9:14:36 PM10/18/13
to web...@googlegroups.com
Same thing here, even with the new alias and restarting apache the admin doesn't look as it should be.

Niphlod

unread,
Oct 19, 2013, 8:12:45 AM10/19/13
to web...@googlegroups.com
it shouldn't, but did you remove that to see if it's indeed the problem ?

Niphlod

unread,
Oct 19, 2013, 8:15:22 AM10/19/13
to web...@googlegroups.com
please, try to fetch i.e. the calendar.css from this pseudo-location with any browser

/welcome/static/css/calendar.css

and then from

/welcome/static/_1.2.3/css/calendar.css

if both work, then the new admin is not responsible. If only the former works, then your apache config has a problem.

Tim Richardson

unread,
Oct 19, 2013, 2:53:02 PM10/19/13
to web...@googlegroups.com
I have this problem as well on an apache ubuntu installation. The deployment was done a couple of months ago using the setup script, so I've not made any changes to apache configuration. admin just stopped working.

Tim Richardson

unread,
Oct 19, 2013, 2:54:47 PM10/19/13
to web...@googlegroups.com


On Saturday, October 19, 2013 11:15:22 PM UTC+11, Niphlod wrote:
please, try to fetch i.e. the calendar.css from this pseudo-location with any browser

/welcome/static/css/calendar.css

this retrieves the css displayed in the browser
 

and then from

/welcome/static/_1.2.3/css/calendar.css
this is a 404 error.

 


Tim Richardson

unread,
Oct 19, 2013, 3:09:10 PM10/19/13
to web...@googlegroups.com


O
AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) /home/www-data/web2py/applications/$1/static/$2


This fixes the problem. I looked at the latest contents of the apache script and modified /etc/apache2/sites-available/web2py accordingly.
I made changes to two lines: both in the *:80 section and the *.443 section 

Niphlod

unread,
Oct 19, 2013, 3:41:32 PM10/19/13
to web...@googlegroups.com
perfect.

@all: should web2py ship with the revised aliases for any scripts that involves statics to be served off a webserver ? I think it's the right time to do so...

Massimo Di Pierro

unread,
Oct 19, 2013, 6:29:03 PM10/19/13
to web...@googlegroups.com
Let's discuss this on web2py developers.
Reply all
Reply to author
Forward
0 new messages