S
S
Stanislav Shabalin2020-09-06 12:17:38
Django
Stanislav Shabalin, 2020-09-06 12:17:38

404 error in production?

Help me solve the problem of following url
Render works on local, but in production - error File not found 404

errors in the console:
GEThttps://annaisupova.com/apologise/
[HTTP/2 404 Not Found 992ms]

HTML document does not contain declaration character encodings. If the document contains characters that are not in the US-ASCII range, some browser configurations will display garbled text in the document. The character encoding of the page must be declared in the document or in the transfer protocol.

#urls.py
from design import views
urlpatterns = [
    ...
    url(r'apologise/$', views.under_reconstruction, name='apologise-url'),
]

#design.views.py
def under_reconstruction(request):
  return render(request, 'reconstruction.html')

#index.html
<a href="{% url 'apologise-url' %}"> [content] </>


what's wrong?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Stanislav Shabalin, 2020-09-06
@Starck43

The problem was solved by sprinthost technical support.
The .htaccess file in public_html was empty. Didn't make sure I saved the settings:

DirectoryIndex site.wsgi index.html
Options +ExecCGI
AddHandler wsgi-script .wsgi
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /site.wsgi/$1 [QSA,PT,L]

Now everything is all right. The problem is not with Django

D
Dmitry, 2020-09-06
@pyHammer

Stanislav Shabalin what kind of hosting do you have? Is the proxy configured correctly?
It seems to me that the request does not even reach Django

D
Dimonchik, 2020-09-06
@dimonchik2013

logs and debugging

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question