Splunk Dev

How to restart Django web framework?

bnorthway
Path Finder

I am developing a Splunk app. As with normal Django development (using runserver or your favorite application server), sometimes it is necessary to restart the Python process that is running Django. I don't need to restart the whole Splunk service. Does anyone know how I would restart the Python executable that loads the Django bindings/etc? Thank you.

0 Karma
1 Solution

bnorthway
Path Finder

I talked to Splunk support, and they suggested the following: $SPLUNK_HOME\bin\splunk.exe restartss You'll have to enter splunk admin credentials the first time, and it's not as fast as I'd like, but it does restart Django.

View solution in original post

andrewthyrd
New Member

I have the same problem - developing apps using the django bindings every time you make a change you need to restart the splunk service according the docs. Not sure how this will fly in production.

The restartss method mentioned works as an alternative, still not optimal though.

0 Karma

bnorthway
Path Finder

I talked to Splunk support, and they suggested the following: $SPLUNK_HOME\bin\splunk.exe restartss You'll have to enter splunk admin credentials the first time, and it's not as fast as I'd like, but it does restart Django.

KenWhitesell
Path Finder

According to what I'm seeing and reading, it appears to me that you can't do this with the default configuration. (And in fact, a netstat on the splunkd process shows that it's a single PID that owns both ports being opened - 8000 and 8089, so while they're separate logical entities, it's the same process running both.)

Reading further, I found that in order for this to work, you need to run Splunk in legacy mode- which according to the documentation is not the best way to run splunk. (See http://docs.splunk.com/Documentation/Splunk/6.2.3/Admin/StartSplunk)

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...