#22129 closed Cleanup/optimization (fixed)

super user creation prompts after executing migrate, not in tutorial

Reported by: kirby_agudelo Owned by: gchp
Component: Documentation Version: master
Severity: Normal Keywords: documentation
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

creating django app for the first time from source I followed steps in documentaion. after executing "migrate" command, i was prompted with

You have installed Django's auth system, and don't have any superusers defined.
Would you like to create one now? (yes/no):

it was not in documentation that such prompt will appear

here are the details

django version 1.7a2

used pdf document page 20 "Getting started"

created app1 with command

python manage.py startapp app1

edited settings.py to add app1

created models to models.py from documentation

class Question( models.Model ):

question_test = models.CharField(max_length=200)
pub_date = models.DateTimeField('date_published')


class Choice(models.Model):

question = models.ForeignKey(Question)
choice_text = models.CharField(max_length=200)

execute makemigrations

python manage.py manage.py makemigrations app1

execute migrate

python manage.py migrate

displayed:

Operations to perform:

Synchronize unmigrated apps: admin, contenttypes, auth, sessions
Apply all migrations: app1

Synchronizing apps without migrations:

Creating tables...
Installing custom SQL...
Installing indexes...

Running migrations:

No migrations needed.

You have installed Django's auth system, and don't have any superusers defined.
Would you like to create one now? (yes/no):


automates user creation but i dont want to create user yet. maybe some kind of switch will be nice to bypass this when executing "migrate"

upon executing migrate for simple models, i was prompted to create user (not in docs)

Change History (5)

comment:1 Changed 17 months ago by bmispelon

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to worksforme
  • Status changed from new to closed

Hi,

Are you sure you're following the version of the documentation that corresponds to the Django version you're using?

The page at https://docs.djangoproject.com/en/dev/intro/tutorial01/#database-setup states that (emphasis mine):

The migrate command looks at the INSTALLED_APPS setting and creates any necessary database tables according to the database settings in your mysite/settings.py file and the database migrations shipped with the app (we’ll cover those later). You’ll see a message for each migration it applies, and you’ll get a prompt asking you if you’d like to create a superuser account for the authentication system. Go ahead and do that.

Thanks.

comment:2 Changed 17 months ago by russellm

  • Resolution worksforme deleted
  • Status changed from closed to new
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Bug to Cleanup/optimization

This issue was discovered during the sprints at PyCon.PH. On closer inspection, I agree that there is an existing reference to the fact that you'll be asked to create a super user; however, it's subtle. We had a couple of newcomers (including Kirby) running the tutorial for the first time, and they all got stuck on the same point. I think it's worth making this step crystal clear, possibly with an example snippet of what you'd expect to see from the console.

comment:3 Changed 17 months ago by gchp

  • Owner changed from nobody to gchp
  • Status changed from new to assigned

comment:4 Changed 17 months ago by gchp

  • Has patch set

Created pull request for this ticket: https://github.com/django/django/pull/2370

comment:5 Changed 17 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In 2f25cdc18a3c15dd9feb9daa522f41aac39e232b:

Fixed #22129 -- Added steps for creating superusers to tutorial.

Note: See TracTickets for help on using tickets.
Back to Top