Django Application Deploy with Apache

Asked

Viewed 127 times

1

I made a Django application and am doing some deployment tests on a virtual machine with Ubuntu Server 18.04, before deploying it in a VPS. I made the settings correctly, but I’m having a problem Django is not recognizing the templates that are in the templates folder. Someone’s had that problem before?

inserir a descrição da imagem aqui

  • And the template blog/home exists?

  • exists, it is in the templates folder

  • He seems to be trying to press on django/contrib/auth/templates/blog/home.html inside the installed Django. Could [Edit] the question and add a [mcve] that reproduces the problem?

1 answer

0


In your Settings.py, in the "TEMPLATES" variable, do the following:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')],
        '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',
            ],
        },
    },
]

I had the same problem using apache on a dedicated server on Hostdime and vps on Kinghost, so I solved it.

  • worked out here, thank you very much ^-^

Browser other questions tagged

You are not signed in. Login or sign up in order to post.