[Fixed]-Django membership/dashboard plugin

1👍

Start with the basic User module that comes with Django. When adding more settings to a user, you must create another model UserProfile that is linked to the base User model.

class UserProfile(models.Model):
    user = models.OneToOneField(User) # The base User model takes username, password and email

    # For the "paid services" you could use a boolean field and evaluate in your template
    premium = models.BooleanField()

    # Alternatively, a field that links to the services, which you'll have to include in your models.py
    account_type = models.ManyToManyField(Service)

Make sure you have ‘django.contrib.auth’ and ‘registration’ in your INSTALLED_APPS in your project’s settings.py, and work using those apps if they suit you.

For security, check https://docs.djangoproject.com/en/1.10/topics/security/

Leave a comment