lumenwrites / django-react-blog

Simple blog built with Django and React/Redux, deployed with Docker, and served with nginx/uwsgi.
http://digitalmind.io
MIT License
563 stars 95 forks source link

Getting error when running migrations for the first time #1

Closed denny64 closed 7 years ago

denny64 commented 7 years ago
Running migrations:
  Rendering model states... DONE
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying authtoken.0001_initial... OK
  Applying authtoken.0002_auto_20160226_1747... OK
  Applying categories.0001_initial... OK
  Applying categories.0002_auto_20170215_2244... OK
  Applying categories.0003_category_description... OK
  Applying posts.0001_initial... OK
  Applying posts.0002_auto_20170301_1328... OK
  Applying posts.0003_auto_20170303_2103... OK
  Applying posts.0004_auto_20170307_0252...Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 305, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 356, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.5/dist-packages/django/core/management/commands/migrate.py", line 202, in handle
    targets, plan, fake=fake, fake_initial=fake_initial
  File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/executor.py", line 97, in migrate
    state = self._migrate_all_forwards(plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/executor.py", line 132, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/executor.py", line 237, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/migration.py", line 129, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/operations/fields.py", line 204, in database_forwards
    schema_editor.alter_field(from_model, from_field, to_field)
  File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/schema.py", line 480, in alter_field
    return self._alter_many_to_many(model, old_field, new_field, strict)
  File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/schema.py", line 798, in _alter_many_to_many
    new_field.remote_field.through._meta.get_field(new_field.m2m_reverse_field_name()),
AttributeError: 'ManyToManyField' object has no attribute 'm2m_reverse_field_name'
root@8aa34cbd794a:/home/blog/backend# python3.5 manage.py createsuperuser
System check identified some issues:

WARNINGS:
posts.Post.tags: (fields.W340) null has no effect on ManyToManyField.
lumenwrites commented 7 years ago

Thank you for letting me know! I have recreated migrations, now this should be fixed!

Edit: if this doesn't work - remove the pgdata directory, that will drop the db, and then you can recreate it.

denny64 commented 7 years ago

@raymestalez Thanks for the quick fix! Whats the future direction of this project, if any?

lumenwrites commented 7 years ago

I will to keep improving the project, adding features, cleaning up and speeding up the code. I want to keep it simple, but awesome and functional.

Some of the features on my todo list are:

Possibly in the future:

I'm open to other ideas and suggestions as well =)