Comments (4)
this is not a solution, but i was able to create the user following these steps:
- create a CustomUserManager to take over the creation of superusers:
class CustomUserManager(BaseUserManager):
def create_superuser(self, email, password=None, **extra_fields):
if not email:
raise ValueError("User must have an email")
if not password:
raise ValueError("User must have a password")
user = self.model(
email=self.normalize_email(email)
)
user.set_password(password)
user.is_superuser = True
user.staff = True
user.active = True
user.save(using=self._db)
return user
- replace the legacy user manager in the User class in common.models.User
from
class User(AbstractBaseUser, PermissionsMixin):
id = models.UUIDField(
default=uuid.uuid4, unique=True, editable=False, db_index=True, primary_key=True
)
email = models.EmailField(_("email address"), blank=True, unique=True)
profile_pic = models.CharField(
max_length=1000, null=True, blank=True
)
activation_key = models.CharField(max_length=150, null=True, blank=True)
key_expires = models.DateTimeField(null=True, blank=True)
is_active = models.BooleanField(default=True)
USERNAME_FIELD = "email"
# REQUIRED_FIELDS = ["username"]
objects = UserManager()
class Meta:
verbose_name = "User"
verbose_name_plural = "Users"
db_table = "users"
ordering = ("-is_active",)
def __str__(self):
return self.email
to:
class User(AbstractBaseUser, PermissionsMixin):
id = models.UUIDField(
default=uuid.uuid4, unique=True, editable=False, db_index=True, primary_key=True
)
email = models.EmailField(_("email address"), blank=True, unique=True)
profile_pic = models.CharField(
max_length=1000, null=True, blank=True
)
activation_key = models.CharField(max_length=150, null=True, blank=True)
key_expires = models.DateTimeField(null=True, blank=True)
is_active = models.BooleanField(default=True)
USERNAME_FIELD = "email"
# REQUIRED_FIELDS = ["username"]
objects = CustomUserManager()
class Meta:
verbose_name = "User"
verbose_name_plural = "Users"
db_table = "users"
ordering = ("-is_active",)
def __str__(self):
return self.email
this way you can create the superuser.
@ashwin31:
if the above counts as a solution i'll be happy to provide a clean pull request
from django-crm.
I noticed that django.contrib.admin
is not listed in INSTALLED_APPS
. @ashwin31, don't we need a superuser?
from django-crm.
I tried this. But I am still not able to login to the wagitail admin panel.
from django-crm.
thank you, it helped, it’s strange that they didn’t make these changes as a fix
from django-crm.
Related Issues (20)
- Not Found: /api/v4/templates/menu_main/ HOT 1
- No static folder HOT 1
- use weasyprint instead of pdfkit
- Not able to find page to login HOT 5
- Registration
- Error: [Errno 13] Permission denied: '/home/venv'
- ValueError: Field 'id' expected a number but got 'null'. HOT 1
- Key Error : 'Secret Key' HOT 3
- Micropyramid CRM HOT 1
- Unable to start celery tasks HOT 1
- Still Active HOT 4
- not able to start the react CRM HOT 1
- AttributeError: 'Request' object has no attribute 'profile' HOT 1
- Cannot Register new user HOT 2
- leads cant get data
- Not able to create or modify Leads
- how i start HOT 2
- Run the Djrango-CRM on windows using virtual environment HOT 3
- Dockerize services for local dev work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-crm.