Re: 'Toolbox' object has no attribute 'CORS'

morecowbell <[email protected]>
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
assuming cherrypy-cors is installed, you're seemingly missing the module 
import and setup.


On Tuesday, March 22, 2016 at 8:38:37 PM UTC-7, Kearney Taaffe wrote:
>
> I've created an AngularJS web app, being served by a CherryPy server. It's 
> calling an API which returns a JSON response
>
> The server.py (of my web application, not the API server) file looks like 
> this
>
> import os
> import cherrypy
>
> from cherrypy.lib.static import serve_file
>
> class Root(object):
>    pass
>   
> if __name__ == '__main__':
>     root = os.path.dirname(os.path.abspath(__file__))  # this file's 
> directory
>
>     cherrypy.config.update( {
>         'server.socket_host': '0.0.0.0',
>         'server.socket_port': 8010,
>     } )
>
>     conf = {
>         '/': {
>             'tools.staticdir.on': True,
>             'tools.staticdir.root' : root,
>             'tools.staticdir.dir': root + '/public/',
>             'tools.staticdir.index': root + '/public/app/views/index.html',
>             'tools.CORS.on': True
>         }
>     }
>
>  
>
>     cherrypy.quickstart(Root(), '/', conf)
>
>
> However, when my angular app tries to hit the URI I get the following error
>
> [22/Mar/2016:15:28:28] ENGINE Bus STARTING
> CherryPy Checker:
> The config entry 'tools.CORS.on' may be invalid, because the 'CORS' tool 
> was not found.
> section: [/]
>
>  
>
> AttributeError: 'Toolbox' object has no attribute 'CORS'
>
>
> Any clue as to what I'm doing wrong? 
>

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.