Error at login page of Django Admin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Error at login page of Django Admin

Stephen Farry
Hi All,

I have a peculiar issue with the admin on Django. Using the Django development server, I can use the admin without any issues at all. However, when I deploy it on the server, I still get the admin page, but when I try to log in I get a 404 error. I reduced this back to the tutorial, but I still get this with any username/password (with DEBUG is True)

Page not found (404)

Request Method:POST
Request URL:https://themovieroom.co.uk/mysite/admin/login/?next=/mysite/admin/

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

  1. ^admin/
  2. polls/

The current path, login/, didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.



This seems to be the same whatever sql database I get, and I suspect is a server side problem, but I'm not sure where to look. Let me know any further information would help. Thanks for any help you can provide.

Cheers,
Stephen

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a5170810-329f-440b-bc30-64a89d15a8aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Error at login page of Django Admin

James Farris-2
Did you run python manage.py migrate on your dev server? And create a super user (python manage.py createsuperuser)

On Wed, May 16, 2018 at 8:06 AM Stephen Farry <[hidden email]> wrote:
Hi All,

I have a peculiar issue with the admin on Django. Using the Django development server, I can use the admin without any issues at all. However, when I deploy it on the server, I still get the admin page, but when I try to log in I get a 404 error. I reduced this back to the tutorial, but I still get this with any username/password (with DEBUG is True)

Page not found (404)

Request Method:POST
Request URL:https://themovieroom.co.uk/mysite/admin/login/?next=/mysite/admin/

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

  1. ^admin/
  2. polls/

The current path, login/, didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.



This seems to be the same whatever sql database I get, and I suspect is a server side problem, but I'm not sure where to look. Let me know any further information would help. Thanks for any help you can provide.

Cheers,
Stephen

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a5170810-329f-440b-bc30-64a89d15a8aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAE-E-_3NyLJ2zy1cFMR7rM3DRnjoZ%2BkAcyPC9PL33xToPjXE3A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Error at login page of Django Admin

Stephen Farry
Hi James,

Thanks for the reply. Yes, I did both of these (a few times to be sure!), but unfortunately it still doesn't seem to work. Actually the database itself seems to be working fine, it's just the admin that's the problem.

Cheers,
Stephen

On Wednesday, 16 May 2018 17:00:01 UTC+1, James Farris wrote:
Did you run python manage.py migrate on your dev server? And create a super user (python manage.py createsuperuser)

On Wed, May 16, 2018 at 8:06 AM Stephen Farry <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="-cS0lon0CAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">stephe...@...> wrote:
Hi All,

I have a peculiar issue with the admin on Django. Using the Django development server, I can use the admin without any issues at all. However, when I deploy it on the server, I still get the admin page, but when I try to log in I get a 404 error. I reduced this back to the tutorial, but I still get this with any username/password (with DEBUG is True)

Page not found (404)

Request Method:POST
Request URL:<a href="https://themovieroom.co.uk/mysite/admin/login/?next=/mysite/admin/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fthemovieroom.co.uk%2Fmysite%2Fadmin%2Flogin%2F%3Fnext%3D%2Fmysite%2Fadmin%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH09easfNv6EsIRo8s9Uz5UnI8dHA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fthemovieroom.co.uk%2Fmysite%2Fadmin%2Flogin%2F%3Fnext%3D%2Fmysite%2Fadmin%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH09easfNv6EsIRo8s9Uz5UnI8dHA&#39;;return true;">https://themovieroom.co.uk/mysite/admin/login/?next=/mysite/admin/

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

  1. ^admin/
  2. polls/

The current path, login/, didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.



This seems to be the same whatever sql database I get, and I suspect is a server side problem, but I'm not sure where to look. Let me know any further information would help. Thanks for any help you can provide.

Cheers,
Stephen

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="-cS0lon0CAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="-cS0lon0CAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django...@....
Visit this group at <a href="https://groups.google.com/group/django-users" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/a5170810-329f-440b-bc30-64a89d15a8aa%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/a5170810-329f-440b-bc30-64a89d15a8aa%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/a5170810-329f-440b-bc30-64a89d15a8aa%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/a5170810-329f-440b-bc30-64a89d15a8aa%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1b79cb7f-4e88-4984-b9ad-55c66258bc2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Error at login page of Django Admin

Julio Biason-3
In reply to this post by Stephen Farry
Hi Stephen,

How are you deploying? Are you using uwsgi and nginx? 'Cause there is an option on the nginx document configuration that you an point to drop a prefix -- in this case, the "mysite/" prefix. If you don't use it, Django will receive the whole path, "/mysite/admin/login" and won't find it in its routes.

I'm 60% sure it is something like this :p

On Wed, May 16, 2018 at 12:02 PM, Stephen Farry <[hidden email]> wrote:
Hi All,

I have a peculiar issue with the admin on Django. Using the Django development server, I can use the admin without any issues at all. However, when I deploy it on the server, I still get the admin page, but when I try to log in I get a 404 error. I reduced this back to the tutorial, but I still get this with any username/password (with DEBUG is True)

Page not found (404)

Request Method:POST
Request URL:https://themovieroom.co.uk/mysite/admin/login/?next=/mysite/admin/

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

  1. ^admin/
  2. polls/

The current path, login/, didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.



This seems to be the same whatever sql database I get, and I suspect is a server side problem, but I'm not sure where to look. Let me know any further information would help. Thanks for any help you can provide.

Cheers,
Stephen

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a5170810-329f-440b-bc30-64a89d15a8aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Julio Biason, Sofware Engineer
AZION  |  Deliver. Accelerate. Protect.
Office: <a href="callto:+555130838101" value="+555130838101" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:12.8px" target="_blank">+55 51 3083 8101  |  Mobile: <a href="callto:+5551996209291" style="color:rgb(17,85,204)" target="_blank">+55 51 99907 0554

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEM7gE0NhEEr0YiWSi70%3D5_Vn_Gpq%2BXNmui_ap2mcTCJvdsBdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Error at login page of Django Admin

Stephen Farry
Hi Julio,

Thanks a lot for the response! Unfortunately no, the deployment is done with wsgi and apache using shared hosting :(. I actually also get the error if I don't use the prefix (the mysite part was just a test) so that possibly means that the prefix isn't causing the issue, but I could easily be wrong about that!

Cheers,
Stephen

On 16 May 2018 at 18:09, Julio Biason <[hidden email]> wrote:
Hi Stephen,

How are you deploying? Are you using uwsgi and nginx? 'Cause there is an option on the nginx document configuration that you an point to drop a prefix -- in this case, the "mysite/" prefix. If you don't use it, Django will receive the whole path, "/mysite/admin/login" and won't find it in its routes.

I'm 60% sure it is something like this :p

On Wed, May 16, 2018 at 12:02 PM, Stephen Farry <[hidden email]> wrote:
Hi All,

I have a peculiar issue with the admin on Django. Using the Django development server, I can use the admin without any issues at all. However, when I deploy it on the server, I still get the admin page, but when I try to log in I get a 404 error. I reduced this back to the tutorial, but I still get this with any username/password (with DEBUG is True)

Page not found (404)

Request Method:POST
Request URL:https://themovieroom.co.uk/mysite/admin/login/?next=/mysite/admin/

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

  1. ^admin/
  2. polls/

The current path, login/, didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.



This seems to be the same whatever sql database I get, and I suspect is a server side problem, but I'm not sure where to look. Let me know any further information would help. Thanks for any help you can provide.

Cheers,
Stephen

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a5170810-329f-440b-bc30-64a89d15a8aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Julio Biason, Sofware Engineer
AZION  |  Deliver. Accelerate. Protect.
Office: <a href="callto:+555130838101" value="+555130838101" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:12.8px" target="_blank">+55 51 3083 8101  |  Mobile: <a href="callto:+5551996209291" style="color:rgb(17,85,204)" target="_blank">+55 51 99907 0554

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEM7gE0NhEEr0YiWSi70%3D5_Vn_Gpq%2BXNmui_ap2mcTCJvdsBdQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAH5SVhm0e0z_12_mD8_eQhSCAxnBqBpH3Kw%2Bbd7XG4q583xuLA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.