Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
energy
bmon
Commits
ce12d9bd
Commit
ce12d9bd
authored
Apr 10, 2021
by
Alan Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suppressed no Template error for Wildcard templates.
parent
9bfd63a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
bmsapp/views.py
bmsapp/views.py
+7
-1
No files found.
bmsapp/views.py
View file @
ce12d9bd
...
@@ -14,6 +14,7 @@ from django.views.decorators.csrf import csrf_exempt
...
@@ -14,6 +14,7 @@ from django.views.decorators.csrf import csrf_exempt
from
django.urls
import
reverse
from
django.urls
import
reverse
from
django.conf
import
settings
from
django.conf
import
settings
from
django.templatetags.static
import
static
from
django.templatetags.static
import
static
from
django.template
import
loader
from
.
import
models
from
.
import
models
from
.
import
logging_setup
from
.
import
logging_setup
...
@@ -835,7 +836,12 @@ def wildcard(request, template_name):
...
@@ -835,7 +836,12 @@ def wildcard(request, template_name):
Used if a URL component doesn't match any of the predefied URL patterns. Renders
Used if a URL component doesn't match any of the predefied URL patterns. Renders
the template indicated by template_name, adding an '.html' to the name.
the template indicated by template_name, adding an '.html' to the name.
'''
'''
return
render_to_response
(
'bmsapp/%s.html'
%
template_name
,
base_context
())
try
:
template
=
loader
.
get_template
(
'bmsapp/%s.html'
%
template_name
)
except
:
return
HttpResponse
(
'Template %s does not exist.'
%
template_name
)
return
HttpResponse
(
template
.
render
(
base_context
(),
request
))
@
login_required
(
login_url
=
'../admin/login/'
)
@
login_required
(
login_url
=
'../admin/login/'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment