First time here? Check out the FAQ!
0

CommandError: Please create a superuser to continue
 

Hi,

I followed along the documentation, and when i tried to do db migrations, it throws error "CommandError: Please create a superuser to continue". I am using django 1.5.7 and postgresql. I do have a superuser created when i run syncdb. Any idea?

Running migrations for askbot:

- Migrating forwards to 0179_sanitize_user_info_html.

askbot:0133_apply_global_group_to_posts_and_users Error in migration: askbot:0133_apply_global_group_to_posts_and_users CommandError: Please create a superuser to continue

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
anonymous user
asked 10 years ago

Comments

see more comments

1 Answer

0

Looks like there is a bug in this migration, for the time being it should be ok to skip it by:

python manage.py migrate askbot 0133 --fake
python manage.py migrate askbot

P.S. To init the database one can use python manage.py syncdb --migrate --noinput this command runs syncdb and migrate, without creating superuser and avoids some issues (Which are in the there and need to be fixed). I've not noticed them until recently because of the habit of using the command above.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 10 years ago, updated 10 years ago
link

Comments

Hi Evgeny, Thanks for your help. I actually used "python manage.py add_admin 1" to fix the issue per your documentation. Now, I have another issue. It seems that I cant get into settings page. it throws "DoesNotExist at /settings/MIN_REP/ Site matching query does not exist." I do have site_id = 1 and django sites app included in installed app. Any idea?

johnli's avatar johnli (10 years ago)

for some reason, syncdb doesnt create site object in database, so i manually create one from shell, and solve the site matching query issue.

johnli's avatar johnli (10 years ago)
see more comments