Forums

Problem with the migrations

Hi,

I have a problem using pythonanywhere, I uploaded my project well, but when I try to migrate the db for create the tables, the bash console give me an error:

Operations to perform: Synchronize unmigrated apps: app_myMicroBlogging Apply all migrations: admin, contenttypes, auth, sessionsSynchronizing apps without migrations: Creating tables... Installing custom SQL... Installing indexes...Running migrations: Applying sessions.0001_initial...Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/home/p02diada/.virtualenvs/django17/local/lib/python2.7/site-packages/django/core/management/init.py", line 385, in execute_from_command_line utility.execute() File "/home/p02diada/.virtualenvs/django17/local/lib/python2.7/site-packages/django/core/management/init.py", line 377, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/p02diada/.virtualenvs/django17/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv self.execute(args, options.dict) File "/home/p02diada/.virtualenvs/django17/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute output = self.handle(args, **options) File "/home/p02diada/.virtualenvs/django17/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 161, in handle executor.migrate(targets, plan, fake=options.get("fake", False)) File "/home/p02diada/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 68, in migrate self.apply_migration(migration, fake=fake) File "/home/p02diada/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 96, in apply_migration if self.detect_soft_applied(migration): File "/home/p02diada/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 140, in detect_soft_applied apps = project_state.render() File "/home/p02diada/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/migrations/state.py", line 75, in render "for more" % new_unrendered_modelsdjango.db.migrations.state.InvalidBasesError: Cannot resolve bases for [ModelState: 'app_myMicroBlogging.my_user']This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth) in an app with no migrations; see https://docs.djangoproject.com/en/1.7/topics/migrations/#dependencies for more

my_user is a class in the model that inherited from de class User of django, i'm trying this from a virtual enviroment that used django 1.7 and python 2.7, could anyone help me please? It is my first time using pythonanywhere so I have no much idea. Thank you.

hello, I finally getted it, I had to create a empty file named "init.py" in the folowing path: /home/user/project/app/migrations

Glad you figured it out! :)

Hello,

I am new to Dajango and not an expert with Python and db. I have managed to get my fir test site Django to work well in my computer, but after pushing and pulling my site to Github and Pythoneverywhere, I am still unable to get the full site to display properly in Pythoneverywhere.com. I understand that this is a problem with the db; however, I am having a bit of difficulty synchronizing the db. My Dajango project is using the Django db, and Pythoneverywhere is using something different, so appears. How is this done? I do like to see my project display correctly in this cloud system.

Thank you for your support. I received a very helpful comment in my prior posting to this forum which help me understand the importance of understand the correct steps. I did follow the proper steps and the errors were gone; however, I am still unable to see my entire site.

SCV

P.S. I am still a bit old fashion; maybe much much older than most contributing to this forum. Thanks for your understanding.

Django lets you set your database from settings.py

First, setup a mysql db from the PythonAnywhere db tab. And then, change the settings file to point to it.