I’m building an extension to a SASS product. This extension requires:
- The
/
directory to containindex.html
- The
/
directory to containconfig.json
- The
/
directory to containcustomActivity.js
- The
/
directory to containicon.png
I’d like to keep my config.json
and customActivity.js
files in my projects static
directory, and my icon.png
file in the media
directory. My index.html
file should be via a template.
So far, my urls.py
file looks like:
from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
]
and my views.py
looks like:
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def index(request):
return HttpResponse("some stuff") // just an example
How do write a url paths that will direct /
to the index view, but /somefile.someextension
to either the static
or media
directories?