vendredi 3 août 2018

Using apostrophes in Django settings.py when telling the location of the templates directory

I need to say where the templates file is for my Django app and my user file has an apostrophe in it. Can someone help me out with this one?

TEMPLATES = [
{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': ["/Users/Harry's PC/Desktop/django_tutorials/mySite/personal"],
    'APP_DIRS': True,
    'OPTIONS': {
        'context_processors': [
            'django.template.context_processors.debug',
            'django.template.context_processors.request',
            'django.contrib.auth.context_processors.auth',
            'django.contrib.messages.context_processors.messages',
        ],
    },
},

]

Then the exception type is: TemplateDoesNotExist when running the server.

Aucun commentaire:

Enregistrer un commentaire