All Apps and Add-ons

Splunk ImportError while installing Web Framework Tookit to create a bubble chart in app

koshyk
Super Champion

Hi
I was following instructions as per "Web Framework Tookit" instructions to create a bubble chart into one of my app. When I follow the instructions, I'm getting error as below when I open "Web Framework Tookit"

Traceback (most recent call last):
  File "/opt/splunk/lib/python2.7/site-packages/cherrypy/wsgiserver/__init__.py", line 1237, in communicate
    req.respond()
  File "/opt/splunk/lib/python2.7/site-packages/cherrypy/wsgiserver/__init__.py", line 554, in respond
    self._respond()
  File "/opt/splunk/lib/python2.7/site-packages/cherrypy/wsgiserver/__init__.py", line 566, in _respond
    response = self.wsgi_app(self.environ, self.start_response)
  File "/opt/splunk/lib/python2.7/site-packages/cherrypy/_cptree.py", line 239, in __call__
    return app(environ, start_response)
  File "/opt/splunk/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 255, in __call__
    response = self.get_response(request)
  File "/opt/splunk/lib/python2.7/site-packages/django/core/handlers/base.py", line 178, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  File "/opt/splunk/etc/apps/framework/server/splunkdj/management/commands/runwsgiserver.py", line 189, in handle_uncaught_exception
    return super(LoggingWSGIHandler, self).handle_uncaught_exception(request, resolver, exc_info, *args, **kwargs)
  File "/opt/splunk/lib/python2.7/site-packages/django/core/handlers/base.py", line 220, in handle_uncaught_exception
    if resolver.urlconf_module is None:
  File "/opt/splunk/lib/python2.7/site-packages/django/core/urlresolvers.py", line 342, in urlconf_module
    self._urlconf_module = import_module(self.urlconf_name)
  File "/opt/splunk/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/splunk/etc/apps/framework/server/urls.py", line 68, in <module>
    app_module = importlib.import_module(app)
  File "/opt/splunk/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
ImportError: No module named mySampleApp

The instructions were to:

When the toolkit is installed:
reference components in the toolkit

When the Web Framework Toolkit is
installed on the same Splunk instance
as your app, you can reference the
toolkit components from your app by
loading the component libraries
directly from the toolkit. Just
require the component library using a
relative path such as
"splunk_wftoolkit/components/component_name/component_name".
And, be sure to verify that the latest
version of the toolkit is deployed on
the server.

Any ideas how to fix the error?
Also how to access the newly generated views in mySampleApp?

0 Karma
1 Solution

guilmxm
Influencer

Hi,

First, you should try to create your own view following the instructions when the Web Framework Toolkit is installed in your Splunk instance, this is easier to start and will prevent you from running in this issue. (you probably forgot something when importing components, check step by step and compare with the Web framework toolkit)

Then, when your view will work, you'll follow these instructions to incorporate the components within your App.

Have you prepared your App for django ?

http://dev.splunk.com/view/web-framework/SP-CAAAER6

From the section "The Web Framework from zero to 60
"

In your App directory already exist (a standard App), what i do is moving temporarily the App to any temp location, creating the App following this guide, then moving the django directory in my original app, deleting the one created by these instructions and moving back the normal app to its original place with now django dir included

Django views you will created in your apps will be accessible like:

http://myserver:8000/dj/en-us/myapp/mydjview/

View solution in original post

guilmxm
Influencer

Hi,

First, you should try to create your own view following the instructions when the Web Framework Toolkit is installed in your Splunk instance, this is easier to start and will prevent you from running in this issue. (you probably forgot something when importing components, check step by step and compare with the Web framework toolkit)

Then, when your view will work, you'll follow these instructions to incorporate the components within your App.

Have you prepared your App for django ?

http://dev.splunk.com/view/web-framework/SP-CAAAER6

From the section "The Web Framework from zero to 60
"

In your App directory already exist (a standard App), what i do is moving temporarily the App to any temp location, creating the App following this guide, then moving the django directory in my original app, deleting the one created by these instructions and moving back the normal app to its original place with now django dir included

Django views you will created in your apps will be accessible like:

http://myserver:8000/dj/en-us/myapp/mydjview/

koshyk
Super Champion

I think I found the error. As you mentioned, the app needs to be created via framework. A normal app would cause error. Cheers

Get Updates on the Splunk Community!

Splunk Forwarders and Forced Time Based Load Balancing

Splunk customers use universal forwarders to collect and send data to Splunk. A universal forwarder can send ...

NEW! Log Views in Splunk Observability Dashboards Gives Context From a Single Page

Today, Splunk Observability releases log views, a new feature for users to add their logs data from Splunk Log ...

Last Chance to Submit Your Paper For BSides Splunk - Deadline is August 12th!

Hello everyone! Don't wait to submit - The deadline is August 12th! We have truly missed the community so ...