Log in

Register Form and E-mail activation

  • 14 Oct '16

Hello Sir,

I am a new Django user, I'd like to ask some questions. Is there anyone know could you please tell me.

  1. Is there any way to remove the user input form when registration, Because
    I have a project develop on Django-Oscar and there are just Email-Password in the registration's form.
    So, I would like to share login database between Oscar and Spirit.

  2. Can I turn off the activation user? because I'd like to do with the same process as Oscar by user doesn't have to activate to be a member.

Anyway, I think the Spirit is the best form one on django, Thank you for making it : )

nitelyEsteban Castro Borsani
  • 2
  • 14 Oct '16

You can register a post_save[0] signal for the User model and update the is_verified field on creation. Pretty much like this but you will want to update instead of create. You will have to create an app[1] for this (ie: spirit_extension) and register the signal there[2]. Make sure you register the app after the spirit app (so the signal handler runs after the profile is created, and so you can update it).

That said, Spirit requires a user name, it's the only way to mention a user, and the field is used in many places, so the model has to have it. You may kinda get away without one if you add a username property to the user model (in case it's a custom user model) and return something else. Also, you will have to set ST_MENTIONS_PER_COMMENT = 0 in your setting.py to disable mentions. But I dunno if that will even work, Spirit really requires a user name, and not having one is not a supported user case and it will never be.

[0] https://docs.djangoproject.com/en/1.8/ref/signals/#post-save
[1] https://docs.djangoproject.com/en/1.8/ref/applications/
[2] app example

Reply