Splunk Dev

Error with creating Django app in 6.6.3 environment.

TLMK
New Member

Hello!

I'm trying to develop a Django app in a 6.6.3 environment. I had created the app with the splunkdj command, and after that I can access without a problem to the new app. In the view.py file I have initially this:

from django.contrib.auth.decorators import login_required
from splunkdj.decorators.render import render_to


@render_to('new_app:home.html')
@login_required
def home(request):
    return {
        "message": "Hello World from new_app!",
        "app_name": "new_app"
       }

Like I said, this works fine, but when I modify the file like this:

from django.contrib.auth.decorators import login_required
from splunkdj.decorators.render import render_to


@render_to('new_app:home.html')
@login_required
def home(request):

    variable = "Hello World from new_app!"

    return {
        "message": variable,
        "app_name": "new_app"
       }

I get an error "Invalid language specified" when I try to acces to the land page, and I see that in the URL the "dj/en-us/" and "/home/" didn't appeared. I mean, I expected this "localhost:8000/dj/en-us/new_app/home/" and I get this "localhost:8000/new_app/".

I didn't change any other file. I restart Splunk with every change in the files. What's happening?

Regards.

Labels (2)
0 Karma

TLMK
New Member

Anyone has a clue about this?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...