<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How edit my code to display the results of a file in Splunk using Django bindings? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155828#M2135</link>
    <description>&lt;P&gt;so we are in the same boat (at least now:P ) ok ..&lt;BR /&gt;
(the comments are to short for me to post this ... hopefully helpful for someone )&lt;BR /&gt;
(for people coming in and reading)&lt;/P&gt;

&lt;P&gt;I have created a new page timedemo.html , which can contain any content, or without .&lt;BR /&gt;
I edited urls.py&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; rlpatterns = patterns('',
        url(r'^home/$', 'test.views.home', name='home'),
        url(r'^pythondemo/$', 'test.views.pythondemo_view', name='pythondemo'),
        url(r'^timedemo/$', 'test.views.timedemo_view', name='timedemo'),
    )
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With a simple yank and paste .&lt;/P&gt;

&lt;P&gt;Restarted splunk. Trying to access my new app "test" .. only to get this; &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;404 Not Found&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;PRE&gt;&lt;CODE&gt;Return to Splunk home page
The path '/en-US/test/' was not found.
View more information about your request (request ID = 54edb5d1b47f93cc64a3d0) in Search

This page was linked to from &lt;A href="http://10.0.1.21:8000/en-US/app/test/default" target="test_blank"&gt;http://10.0.1.21:8000/en-US/app/test/default&lt;/A&gt;.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Browsing / typing my old urls "home, pythondemo" from adressfield works fine.&lt;BR /&gt;
When trying to browse my newly created page; timedemo .. this is what i get back;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; This XML file does not appear to have any style information associated with it. The document tree is shown below.
      &amp;lt;response&amp;gt;&amp;lt;messages&amp;gt;&amp;lt;msg type="ERROR"&amp;gt;INTERNAL SERVER ERROR&amp;lt;/msg&amp;gt;&amp;lt;/messages&amp;gt;&amp;lt;/response&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in gjango_error.log i find;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Traceback (most recent call last): File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/core/handlers/base.py", line 103, in get_response resolver_match = resolver.resolve(request.path_info) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/core/urlresolvers.py", line 321, in resolve sub_match = pattern.resolve(new_path) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/core/urlresolvers.py", line 321, in resolve sub_match = pattern.resolve(new_path) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/core/urlresolvers.py", line 321, in resolve sub_match = pattern.resolve(new_path) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/core/urlresolvers.py", line 223, in resolve return ResolverMatch(self.callback, args, kwargs, self.name) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/core/urlresolvers.py", line 230, in callback self._callback = get_callable(self._callback_str) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/utils/functional.py", line 31, in wrapper result = func(*args) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/core/urlresolvers.py", line 118, in get_callable (lookup_view, mod_name)) ViewDoesNotExist: Could not import test.views.timedemo_view. View does not exist in module test.views.

Could not import test.views.timedemo_view. View does not exist in module test.views. 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So i set up some empty views in view.py and now i am not seing these messages anymore ... pain in the ass to have to this for all the pages / templats i setup.&lt;/P&gt;

&lt;P&gt;Which seems to be necessary even if i am not doing anything special in the template ...&lt;/P&gt;

&lt;P&gt;It seems to be some things i have not yet understoud regarding django.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Feb 2015 12:14:43 GMT</pubDate>
    <dc:creator>lmyrefelt</dc:creator>
    <dc:date>2015-02-25T12:14:43Z</dc:date>
    <item>
      <title>How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155812#M2119</link>
      <description>&lt;P&gt;Hi everyone, &lt;/P&gt;

&lt;P&gt;I'm trying to display the results of a file in Splunk using the django bindings, but something is wrong in my code. Could someone help me?&lt;/P&gt;

&lt;P&gt;URL.py&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;url(r'^mypage/$', 'mynewapp.views.mypage_view', name='mypage'),
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;views.py&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;@render_to('mynewapp:mypage.html')
@login_required
def mypage_view(request):
file_data = ''
service = request.service
with open(csvfile, "r+") as lines:      
for line in lines:
    file_data += line
     return file_data
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;mypage.html &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   {% for data in file_data %}
    &amp;lt;p&amp;gt;{{ data }}&amp;lt;/p&amp;gt;
    {% endfor %}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Feb 2015 13:48:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155812#M2119</guid>
      <dc:creator>Federica_92</dc:creator>
      <dc:date>2015-02-19T13:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155813#M2120</link>
      <description>&lt;P&gt;F* me, i am also struggling with this one ...&lt;/P&gt;

&lt;P&gt;I can see that in urls.py from the framework toolkit that you can download from apps.splunk.com their rendering looks a little bit different;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;urlpatterns = patterns('',
    url(r'^home/$', render('splunk_wftoolkit:home.html'), name='home'),
    url(r'^overview/$', render('splunk_wftoolkit:overview.html'), name='overview'),
    # Components
    url(r'^managers/$', render('splunk_wftoolkit:managers.html'), name='managers'),
    url(r'^charts/$', render('splunk_wftoolkit:charts.html'), name='charts'),
    url(r'^tables/$', render('splunk_wftoolkit:tables.html'), name='tables'),
    url(r'^forms/$', render('splunk_wftoolkit:forms.html'), name='forms'),
    url(r'^dataview/$', render('splunk_wftoolkit:dataview.html'), name='dataview'),
    url(r'^searchcontrols/$', render('splunk_wftoolkit:searchcontrols.html'), name='searchcontrols'),
    url(r'^map/$', render('splunk_wftoolkit:map.html'), name='map'),
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Lets see what i can make happen tomorrow&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 22:30:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155813#M2120</guid>
      <dc:creator>lmyrefelt</dc:creator>
      <dc:date>2015-02-24T22:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155814#M2121</link>
      <description>&lt;P&gt;I have use the demo, that I have found on the splunk page tutorial, it work to display the data, but If I change the name  at the view functions or at the url, like I have done over here, anything doesn't work : ( &lt;/P&gt;

&lt;P&gt;My first problem is take the results from {{data}} and elaborate them.&lt;BR /&gt;
And take results of the dropdown menu and the checkbox and output them in an external file. &lt;BR /&gt;
I have try to ask, but you are the first one that are replying to me.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 09:18:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155814#M2121</guid>
      <dc:creator>Federica_92</dc:creator>
      <dc:date>2015-02-25T09:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155815#M2122</link>
      <description>&lt;P&gt;It is the same problem i have ... my point underneath here is that web framework toolkit app that you can download from apps.splunk.com that i would assume would have used web framework / django bindings for its views and urls looks different from the examples (in the doc) and the produced code from generating an web framework app.&lt;/P&gt;

&lt;P&gt;Hopefully i have the energy to dig in deeper today&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 09:21:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155815#M2122</guid>
      <dc:creator>lmyrefelt</dc:creator>
      <dc:date>2015-02-25T09:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155816#M2123</link>
      <description>&lt;P&gt;Yeah, I'm using it, let me know if you found something, thank you : ) &lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 09:24:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155816#M2123</guid>
      <dc:creator>Federica_92</dc:creator>
      <dc:date>2015-02-25T09:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155817#M2124</link>
      <description>&lt;P&gt;Just wanted to update with some progress ..&lt;BR /&gt;
ok, so after changing my urls.py for my app from ;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;url(r'^mypage/$', 'mynewapp.views.mypage_view', name='mypage'),
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;url(r'^mypage/$', render('mynewapp:mypage.html'), name='mypage'),
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My urls.py and "views.py"  are now working.&lt;/P&gt;

&lt;P&gt;I am still not able to display some of the contents from my views.py in my "mypage", however i can see that it gets the list of apps from splunk at least and iterate over it, but still does not display the results on mypage.&lt;/P&gt;

&lt;P&gt;a small step for mankind but a huge leap forward for lmyrefelt &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 09:54:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155817#M2124</guid>
      <dc:creator>lmyrefelt</dc:creator>
      <dc:date>2015-02-25T09:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155818#M2125</link>
      <description>&lt;P&gt;cool : ) Can I ask you when you will finish,  how set a condition to execute the render? Because for now (that I have used:  url(r'^pythondemo/$', 'mynewapp.views.pythondemo_view', name='pythondemo'), like in the splunk demo ) work in the moment that I open my app, but I would like that this will work only after a choose in the dropdown menu. &lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 09:59:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155818#M2125</guid>
      <dc:creator>Federica_92</dc:creator>
      <dc:date>2015-02-25T09:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155819#M2126</link>
      <description>&lt;P&gt;So you got the example(s) to work? if i do use the example(s) code in dev.splunk.com for the django app i am only getting this message over and over again.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;This XML file does not appear to have any style information associated with it. The document tree is shown below.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also get these ones (if some devs are dropping by) :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2015-02-25 11:05:11,968 ERROR urls:68 - invalid syntax (urls.py, line 13) Traceback (most recent call last): File "/opt/splunk/dev/6.2.1/splunk/etc/apps/framework/server/urls.py", line 61, in load_urls_for_app module_with_urls = importlib.import_module("%s.urls" % app) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/opt/splunk/dev/6.2.1/splunk/etc/apps/filex/django/filex/urls.py", line 13 ^ SyntaxError: invalid syntax
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As soon as i change (urls.py) as above i get the urls to work and no more error message as above&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 10:11:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155819#M2126</guid>
      <dc:creator>lmyrefelt</dc:creator>
      <dc:date>2015-02-25T10:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155820#M2127</link>
      <description>&lt;P&gt;Yes, with the example works, but if I try to change the name of the variable, anything doesn't work.&lt;BR /&gt;
Try to look at this: &lt;A href="http://dev.splunk.com/view/SP-CAAAEMP"&gt;http://dev.splunk.com/view/SP-CAAAEMP&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 10:14:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155820#M2127</guid>
      <dc:creator>Federica_92</dc:creator>
      <dc:date>2015-02-25T10:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155821#M2128</link>
      <description>&lt;P&gt;Thanks, thats the page and examples i am trying to follow ... i am feeling so stupid not to even be able to get the examples to work &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 10:17:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155821#M2128</guid>
      <dc:creator>lmyrefelt</dc:creator>
      <dc:date>2015-02-25T10:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155822#M2129</link>
      <description>&lt;P&gt;Don't worry, I had the same problem XD &lt;BR /&gt;
Let me know if changing the variables it start to work, like use instead of "pythondemo" "mypage", something like this.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 10:19:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155822#M2129</guid>
      <dc:creator>Federica_92</dc:creator>
      <dc:date>2015-02-25T10:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155823#M2130</link>
      <description>&lt;P&gt;OK, so i have manage to start to get the views.py working ... as i am a newbie with python ... i have not yet hammered the "indention" into the back of my head !&lt;BR /&gt;
That seems to have been a big part of at least my problems!&lt;/P&gt;

&lt;P&gt;Maybe that is something you should verify as well ? You should be able to find the messages under; sourcetype=djange_service&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 11:25:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155823#M2130</guid>
      <dc:creator>lmyrefelt</dc:creator>
      <dc:date>2015-02-25T11:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155824#M2131</link>
      <description>&lt;P&gt;Yeah, I'm new in all this too : ) &lt;BR /&gt;
Sorry, I'm not sure of what you are asking, to me, could you said it again?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 11:29:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155824#M2131</guid>
      <dc:creator>Federica_92</dc:creator>
      <dc:date>2015-02-25T11:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155825#M2132</link>
      <description>&lt;P&gt;You might need to put your code more "inline" that is add a tab to the beginning of the code&lt;/P&gt;

&lt;P&gt;Example (compare to your pasted code above;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;@render_to('mynewapp:mypage.html')
 @login_required
 def mypage_view(request):
          file_data = ''
          service = request.service
          with open(csvfile, "r+") as lines:        
               for line in lines:
                     file_data += line
               return file_data
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;}&lt;/P&gt;

&lt;P&gt;or Similar.&lt;/P&gt;

&lt;P&gt;You should be able to find an (python) error message in index=_internal sourceype="django*"&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 11:32:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155825#M2132</guid>
      <dc:creator>lmyrefelt</dc:creator>
      <dc:date>2015-02-25T11:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155826#M2133</link>
      <description>&lt;P&gt;don't forget the } at the end&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 25 Feb 2015 11:33:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155826#M2133</guid>
      <dc:creator>lmyrefelt</dc:creator>
      <dc:date>2015-02-25T11:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155827#M2134</link>
      <description>&lt;P&gt;Sure, sorry, &lt;BR /&gt;
I'm using this indention now:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;@render_to('mynewapp:mypage.html')
@login_required
def mypage_view(request):
    file_data = ''
    service = request.service
    with open(csvfile, "r+") as lines:
        for line in lines:
            file_data += line
return file_data
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For each type of error that I do, I have ALWAYS this error:  Internal server error.&lt;BR /&gt;
However, my problem is not the inline of the code, like this works.&lt;BR /&gt;
 I found problem when I change the name of my file from pythondemo to mypage &lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 11:39:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155827#M2134</guid>
      <dc:creator>Federica_92</dc:creator>
      <dc:date>2015-02-25T11:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155828#M2135</link>
      <description>&lt;P&gt;so we are in the same boat (at least now:P ) ok ..&lt;BR /&gt;
(the comments are to short for me to post this ... hopefully helpful for someone )&lt;BR /&gt;
(for people coming in and reading)&lt;/P&gt;

&lt;P&gt;I have created a new page timedemo.html , which can contain any content, or without .&lt;BR /&gt;
I edited urls.py&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; rlpatterns = patterns('',
        url(r'^home/$', 'test.views.home', name='home'),
        url(r'^pythondemo/$', 'test.views.pythondemo_view', name='pythondemo'),
        url(r'^timedemo/$', 'test.views.timedemo_view', name='timedemo'),
    )
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With a simple yank and paste .&lt;/P&gt;

&lt;P&gt;Restarted splunk. Trying to access my new app "test" .. only to get this; &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;404 Not Found&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;PRE&gt;&lt;CODE&gt;Return to Splunk home page
The path '/en-US/test/' was not found.
View more information about your request (request ID = 54edb5d1b47f93cc64a3d0) in Search

This page was linked to from &lt;A href="http://10.0.1.21:8000/en-US/app/test/default" target="test_blank"&gt;http://10.0.1.21:8000/en-US/app/test/default&lt;/A&gt;.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Browsing / typing my old urls "home, pythondemo" from adressfield works fine.&lt;BR /&gt;
When trying to browse my newly created page; timedemo .. this is what i get back;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; This XML file does not appear to have any style information associated with it. The document tree is shown below.
      &amp;lt;response&amp;gt;&amp;lt;messages&amp;gt;&amp;lt;msg type="ERROR"&amp;gt;INTERNAL SERVER ERROR&amp;lt;/msg&amp;gt;&amp;lt;/messages&amp;gt;&amp;lt;/response&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in gjango_error.log i find;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Traceback (most recent call last): File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/core/handlers/base.py", line 103, in get_response resolver_match = resolver.resolve(request.path_info) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/core/urlresolvers.py", line 321, in resolve sub_match = pattern.resolve(new_path) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/core/urlresolvers.py", line 321, in resolve sub_match = pattern.resolve(new_path) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/core/urlresolvers.py", line 321, in resolve sub_match = pattern.resolve(new_path) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/core/urlresolvers.py", line 223, in resolve return ResolverMatch(self.callback, args, kwargs, self.name) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/core/urlresolvers.py", line 230, in callback self._callback = get_callable(self._callback_str) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/utils/functional.py", line 31, in wrapper result = func(*args) File "/opt/splunk/dev/6.2.1/splunk/lib/python2.7/site-packages/django/core/urlresolvers.py", line 118, in get_callable (lookup_view, mod_name)) ViewDoesNotExist: Could not import test.views.timedemo_view. View does not exist in module test.views.

Could not import test.views.timedemo_view. View does not exist in module test.views. 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So i set up some empty views in view.py and now i am not seing these messages anymore ... pain in the ass to have to this for all the pages / templats i setup.&lt;/P&gt;

&lt;P&gt;Which seems to be necessary even if i am not doing anything special in the template ...&lt;/P&gt;

&lt;P&gt;It seems to be some things i have not yet understoud regarding django.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 12:14:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155828#M2135</guid>
      <dc:creator>lmyrefelt</dc:creator>
      <dc:date>2015-02-25T12:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155829#M2136</link>
      <description>&lt;P&gt;Could you paste your render function too? Maybe help &lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 12:42:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155829#M2136</guid>
      <dc:creator>Federica_92</dc:creator>
      <dc:date>2015-02-25T12:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155830#M2137</link>
      <description>&lt;P&gt;Do you mean my views.py ? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;@render_to('test:timedemo.html')
@login_required
def timedemo_view(request):
        return {
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Feb 2015 13:07:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155830#M2137</guid>
      <dc:creator>lmyrefelt</dc:creator>
      <dc:date>2015-02-25T13:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: How edit my code to display the results of a file in Splunk using Django bindings?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155831#M2138</link>
      <description>&lt;P&gt;Any news? &lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 16:21:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-edit-my-code-to-display-the-results-of-a-file-in-Splunk/m-p/155831#M2138</guid>
      <dc:creator>Federica_92</dc:creator>
      <dc:date>2015-02-25T16:21:41Z</dc:date>
    </item>
  </channel>
</rss>

