Giter Club home page Giter Club logo

Comments (7)

mgonzalezm-dev avatar mgonzalezm-dev commented on August 23, 2024 2

Hi guys I fixed this issue, please follow the instructions for a succesfully create super user without "delete" the username functionality:

  1. open models.py of base app.
  2. add to the REQUIRED_FIELDS the parameter 'username', line 13..

it should look like this:

REQUIRED_FIELDS = ['username',]

from studybud.

chrispydev avatar chrispydev commented on August 23, 2024 1

Comment line 12 in models.py

from studybud.

Gr3Kidd3r avatar Gr3Kidd3r commented on August 23, 2024

@chrispydev What does it do? Isn't overriding create_user a better approach?

from studybud.

Amisha-here avatar Amisha-here commented on August 23, 2024

Hi guys I fixed this issue, please follow the instructions for a succesfully create super user without "delete" the username functionality:

  1. open models.py of base app.
  2. add to the REQUIRED_FIELDS the parameter 'username', line 13..

it should look like this:

REQUIRED_FIELDS = ['username',]

I did the same, it helped with creating supersuper but now i am not able to register from the frontend side.

from studybud.

dev-sheikh-ali avatar dev-sheikh-ali commented on August 23, 2024

type this in the cmd/terminal
(env) $ python manage.py shell
This should bring up the shell command prompt as follows:

                  Python 3.7.2 (default, Mar 27 2019, 08:44:46) 
                  [GCC 6.3.0 20170516] on linux
                  Type "help", "copyright", "credits" or "license" for more information.
                  (InteractiveConsole)
                  >>>

Then execute the following:

                  >>> from django.contrib.auth import get_user_model
                  >>> User = get_user_model()
                  >>> user = User.objects.get(username='dennis')
                  >>> user.set_password('new password')
                  >>> user.save()
                  >>> exit()

after this login as admin: admin url - http://127.0.0.1:8000/admin/login/?next=/admin/
login details for login in :
[email protected]
new password
then you can change the other details later on

from studybud.

belhaddadmohamed avatar belhaddadmohamed commented on August 23, 2024

Hi guys I fixed this issue, please follow the instructions for a succesfully create super user without "delete" the username functionality:

  1. open models.py of base app.
  2. add to the REQUIRED_FIELDS the parameter 'username', line 13..

it should look like this:

REQUIRED_FIELDS = ['username',]

Yes it's worked for me

from studybud.

belhaddadmohamed avatar belhaddadmohamed commented on August 23, 2024

Hi guys I fixed this issue, please follow the instructions for a succesfully create super user without "delete" the username functionality:

  1. open models.py of base app.
  2. add to the REQUIRED_FIELDS the parameter 'username', line 13..

it should look like this:
REQUIRED_FIELDS = ['username',]

I did the same, it helped with creating supersuper but now i am not able to register from the frontend side.

Now after you create a super user you can turn the as an empty list ---> REQUIRED_FIELDS = []

from studybud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.