question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unknown field(s) (first_name, last_name) specified for User in admin

See original GitHub issue

What happened?

I created a new cookiecutter-django project and went through the steps here to get started. Then I created a superuser and logged in, but when I click on the edit user link from the admin view I get the following error:

django.core.exceptions.FieldError: Unknown field(s) (first_name, last_name) specified for User. Check fields/fieldsets/exclude attributes of class UserAdmin.
image

What should’ve happened instead?

Instead I should have gotten to the edit user admin page.

Additional details

  • Host system configuration:
    • Version of cookiecutter CLI (get it with cookiecutter --version): Cookiecutter 1.7.2 from /Users/leo/.virtualenvs/cryptoswap/lib/python3.9/site-packages (Python 3.9)
    • OS: OSX
    • Python version: Python 3.9.1
    • Docker versions (if using Docker): not using docker
  • Options selected and/or replay file:
    	{
    "cookiecutter": {
    "project_name": "CryptoSwap",
    "project_slug": "cryptoswap",
    "description": "Bitcoin ATMs",
    "author_name": "Leo Policastro",
    "domain_name": "access.cryptoswap.com",
    "email": "leo-policastro@example.com",
    "version": "0.1.0",
    "open_source_license": "MIT",
    "timezone": "UTC",
    "windows": "n",
    "use_pycharm": "n",
    "use_docker": "n",
    "postgresql_version": "12.3",
    "js_task_runner": "Gulp",
    "cloud_provider": "AWS",
    "mail_service": "Mailgun",
    "use_async": "n",
    "use_drf": "y",
    "custom_bootstrap_compilation": "n",
    "use_compressor": "n",
    "use_celery": "n",
    "use_mailhog": "n",
    "use_sentry": "n",
    "use_whitenoise": "n",
    "use_heroku": "y",
    "ci_tool": "Github",
    "keep_local_envs_in_vcs": "n",
    "debug": "n",
    "_template": "gh:pydanny/cookiecutter-django"
    }
    

} ``` Am I doing something wrong? I used cookiecutter for a different project last week and I did not have the same issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
Eraldocommented, Jul 16, 2021

There was indeed some patching magic going on. You hinted me in the right direction. I simply removed that code and now recreating does not create these columns anymore. I can thus safely drop the columns from the existing database. Thank you @Andrew-Chen-Wang 🙏

1reaction
browniebrokecommented, Jan 26, 2021

I’ve updated the PR with a few tests, seems to be working. Could one of you have a quick look? Feedback would be appreciated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unknown field(s) (first_name, last_name) specified for User in ...
Then I created a superuser and logged in, but when I click on the edit user link from the admin view I get...
Read more >
Unknown field(s) (model) specified for User - Stack Overflow
Double check this is correct: fields = ( 'email', 'password', 'first_name', 'gender', 'last_name', 'is_active', 'is_staff'.
Read more >
Django.Core.Exceptions.Fielderror: Unknown Field(S) (Email ...
It specifies how the user's full name is built out of the information entered into the First Name and Last Name fields. Field...
Read more >
Post | Coding For Entrepreneurs - codingforentrepreneurs.com
Unknown field (s) (userpermissions, isstaff, issuperuser, lastname, username, firstname, groups, isactive, date_joined) specified for User.
Read more >
Problem with register the User in admin - ORM - Django Forum
I tried to register the user, and I want to configure the admin site to have a permission field, groups field, etc. (Like...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found