Error 500 with subapps

52 views
Skip to first unread message

Tomás Acauan Schertel

unread,
Nov 1, 2011, 2:02:42 AM11/1/11
to we...@googlegroups.com
Hi there.
I did separate my application on a few files. But now I get an annoying "Internal server error" when pointing my browser to it.
Terminal shows this messages:

$ ./synergy.py
index.py
synergy.py
http://0.0.0.0:8080/
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/web/application.py", line 237, in process
    return self.handle()
  File "/usr/lib/python2.7/site-packages/web/application.py", line 227, in handle
    fn, args = self._match(self.mapping, web.ctx.path)
  File "/usr/lib/python2.7/site-packages/web/application.py", line 424, in _match
    what, result = utils.re_subm('^' + pat + '$', what, value)
TypeError: cannot concatenate 'str' and 'instance' objects

127.0.0.1:43018 - - [01/Nov/2011 03:57:36] "HTTP/1.1 GET /" - 500 Internal Server Error


Instead of putting code here, I rather show my repository: https://bitbucket.org/tschertel/synergy/src

I'll be very glad if someone could help me.
Thanks.


--
Tomás Schertel
----------------------------------------------
Linux Registered User #304838
Arch Linux User
http://www.archlinux.org/
----------------------------------------------

Tomás Acauan Schertel

unread,
Nov 2, 2011, 12:56:58 PM11/2/11
to we...@googlegroups.com
Problem solved.



--
Tomás Schertel
----------------------------------------------
Linux Registered User #304838
Arch Linux User
http://www.archlinux.org/
----------------------------------------------


9exbizy

unread,
Aug 1, 2012, 8:08:34 AM8/1/12
to we...@googlegroups.com
Hi Tomas,

How did you solve this problem?

I have a challenge too, I am building a web server to retrieve data from a database and post them on the web using web.py but I get this error below:


Traceback (most recent call last):
  File "c:\python26\lib\site-packages\web.py-0.36-py2.6.egg\web\application.py", line 237, in process
    return self.handle()
  File "c:\python26\lib\site-packages\web.py-0.36-py2.6.egg\web\application.py", line 227, in handle
    fn, args = self._match(self.mapping, web.ctx.path)
  File "c:\python26\lib\site-packages\web.py-0.36-py2.6.egg\web\application.py", line 424, in _match
    what, result = utils.re_subm('^' + pat + '$', what, value)
TypeError: cannot concatenate 'str' and 'type' objects

127.0.0.1:60959 - - [01/Aug/2012 12:52:54] "HTTP/1.1 GET /" - 500 Internal Server Error
Traceback (most recent call last):
  File "c:\python26\lib\site-packages\web.py-0.36-py2.6.egg\web\application.py", line 237, in process
    return self.handle()
  File "c:\python26\lib\site-packages\web.py-0.36-py2.6.egg\web\application.py", line 227, in handle
    fn, args = self._match(self.mapping, web.ctx.path)
  File "c:\python26\lib\site-packages\web.py-0.36-py2.6.egg\web\application.py", line 424, in _match
    what, result = utils.re_subm('^' + pat + '$', what, value)
TypeError: cannot concatenate 'str' and 'type' objects

127.0.0.1:60959 - - [01/Aug/2012 12:52:55] "HTTP/1.1 GET /favicon.ico" - 500 Internal Server Error

Kindly assist

Anand Chitipothu

unread,
Aug 1, 2012, 8:33:24 AM8/1/12
to we...@googlegroups.com
On Wed, Aug 1, 2012 at 5:38 PM, 9exbizy
<a.m.akin...@student.lboro.ac.uk> wrote:
> Hi Tomas,
>
> How did you solve this problem?
>
> I have a challenge too, I am building a web server to retrieve data from a
> database and post them on the web using web.py but I get this error below:
>
>
> http://0.0.0.0:8080/
> Traceback (most recent call last):
...
> TypeError: cannot concatenate 'str' and 'type' objects

Looks like there is an error in your urls (url mapping).

Can you show what your urls are like?

Anand

Ayodele Akingbulu

unread,
Aug 1, 2012, 8:47:22 AM8/1/12
to we...@googlegroups.com
Mu urls are defined this way:

# Link classes to url on the server
urls = ('/homesensor.com/(.*)', 'Sensor'
        '/sensor/', Sensor, #Links Sensor class to /sensor
        '/location', HS_Location # Links HS_Location class to /location
        )

#Main Method, calls appropriate classes
if __name__ == "__main__":
    
# To run the web server to start serving the web pages with data    
    app = web.application(urls, globals())
    app.run()
    
  


--
You received this message because you are subscribed to the Google Groups "web.py" group.
To post to this group, send email to we...@googlegroups.com.
To unsubscribe from this group, send email to webpy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webpy?hl=en.


Anand Chitipothu

unread,
Aug 1, 2012, 9:07:21 AM8/1/12
to we...@googlegroups.com
On Wed, Aug 1, 2012 at 6:17 PM, Ayodele Akingbulu
<a.m.akin...@student.lboro.ac.uk> wrote:
> Mu urls are defined this way:
>
> # Link classes to url on the server
> urls = ('/homesensor.com/(.*)', 'Sensor'
> '/sensor/', Sensor, #Links Sensor class to /sensor
> '/location', HS_Location # Links HS_Location class to /location
> )

The second part should be a string like "HS_Location", not a class
like HS_Location. If it is defined in a different module, then you can
specify it as "modulename.classname".

Anand

Ayodele Akingbulu

unread,
Aug 1, 2012, 9:20:06 AM8/1/12
to we...@googlegroups.com
Anand thank you, It resolved the error.




Anand

Reply all
Reply to author
Forward
0 new messages