1

I would like to have a fake login page, a.k.a honeypot, in Django. The real admin login page would have a different than standard URL, of course. I know that there is a django-admin-honeypot app, but it doesn't seem to work with Django 2+. Is there a quick way to create such a fake admin page which doesn't even have to have the IP logging capability? Alternatively, do you have a configuration of django-admin-honeypot that works with Django 2+? If yes, would you be able to share your URL file(s), please?

Your help would be much appreciated.

Best wishes,

Marcin

keybald
  • 17
  • 4
  • :D They fixed issues for Django 2 version 8 hours ago, here is the commit https://github.com/dmpayton/django-admin-honeypot/commit/cec1156c42adbe989e16f4813c4abf82769e73d7 Now you can use it with Django 2 also. It worked for me. – Davit Tovmasyan May 15 '18 at 06:41
  • Thank you for letting me know. It works for me without any modifications after installing the newest version of django-admin-honeypot. Hurrah :) – keybald May 20 '18 at 14:30

1 Answers1

1

Funny enough, I just ran into the same issue with the django-admin-honeypot app and managed to get it to work with Django 2+ with a few modifications! :)

Because I was lazy, I simply edited the local django-admin-honeypot app files. This will break when the package is updated (but I guess it would be fixed by then).

  1. Edit the following 2 files:

    • admin_honeypot/listeners.py line 7
    • admin_honeypot/views.py line 4

Those go from being

from django.core.urlresolvers import reverse

to

from django.urls import reverse
  1. Instead of what is stated in the admin_honeypot docs, use the following for the urlpattern.

This is similar to 'Specifying a namespace in include() without providing an app_name'

Instead of

url(r'^admin/', include('admin_honeypot.urls', namespace='admin_honeypot')),

use

url(r'^admin/', include(('admin_honeypot.urls', 'admin_honeypot'), namespace='admin_honeypot')),

Then run migrate.py and restart server etc etc.

That fixed it for me. Good luck!

ar3io
  • 26
  • 1
  • Thank you for those instructions. I'm sure that if I followed them, I would be able to resolve my issue. However, a newer version of django-admin-honeypot module has been released, a few days after asking my question here, and everything works as expected. – keybald May 20 '18 at 14:32