I have my index.html in /static/ folder. My django app is running ok when i try:
http://127.0.0.1:8000/index.html
But i want to acces index
you can create templates directory, put the html there and then render it from views.py
def index(request):
return render(request, 'my_app/index.html', context={})
dont forget to set the templates_dir in the settings.py
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATES_DIR = os.path.join(BASE_DIR, "templates")
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [TEMPLATES_DIR,],
'APP_DIRS': True,
...