Good method to require EULA acceptance

161 views
Skip to first unread message

BGMaster

unread,
May 2, 2012, 5:34:16 PM5/2/12
to Django users
Hi,

I'm trying to implement acceptance of a EULA into my site registration
form. The EULA acceptance is on a separate page from the rest of the
registration form. I'm trying to figure out a way to prevent the user
from accessing the rest of the site without accepting the EULA. Every
path I go down seems to end up being very hackish. Has anyone done a
EULA in a separate view/page from the rest of the site registration?
What method did you use?

Thanks

Jonathan D. Baker

unread,
May 2, 2012, 5:41:20 PM5/2/12
to django...@googlegroups.com, Django users
You could store the Eula as a boolean field on a user profile model and manage it that way.

Sent from my iPhone
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>

BGMaster

unread,
May 2, 2012, 6:00:54 PM5/2/12
to Django users
That's what I have. The problem is that you then have to restrict
access on every page of your site to those who've accepted the EULA.
What I would rather do is create a profile and only allow access to
the EULA acceptance page once the person is registered and until they
accept the EULA. I'm just having a hard time conceptualizing a way to
do this code-wise.

On May 2, 5:41 pm, "Jonathan D. Baker" <jonathandavidba...@gmail.com>
wrote:
> You could store the Eula as a boolean field on a user profile model and manage it that way.
>
> Sent from my iPhone
>

Nikolas Stevenson-Molnar

unread,
May 2, 2012, 6:58:36 PM5/2/12
to django...@googlegroups.com
Expanding on Jonathan's suggestion, you could create a simple middleware
function to redirect a user to the EULA page if they haven't accepted it
yet. And you don't need to put the restriction into every view: it's
automatic.

https://docs.djangoproject.com/en/dev/topics/http/middleware/?from=olddocs

_Nik
Message has been deleted

Murph Murphy

unread,
May 14, 2012, 3:16:32 PM5/14/12
to django...@googlegroups.com
BGMaster, did you ever get this working? I'm encountering the same problem, and can't seem to get the middleware redirects to work properly (doesn't properly submit/constantly redirects).
Reply all
Reply to author
Forward
0 new messages