Git Product home page Git Product logo

Comments (14)

Tyrdall avatar Tyrdall commented on July 17, 2024

@davinderkumar Which version of Django is installed? Please post the whole traceback.

from django-review.

davinderkumar avatar davinderkumar commented on July 17, 2024

Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/core/management/init.py", line 399, in execute_from_command_line
utility.execute()
File "/home/user/task/env//local/lib/python2.7/site-packages/django/core/management/init.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(_args, *_options.dict)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(_args, *_options)
File "/home/user/task/env/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
ignore_ghosts = ignore_ghosts,
File "/home/user/task/env/local/lib/python2.7/site-packages/south/migration/init.py", line 220, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/home/user/task/env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 254, in migrate_many
result = migrator.class.migrate_many(migrator, target, migrations, database)
File "/home/user/task/env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 329, in migrate_many
result = self.migrate(migration, database)
File "/home/user/task/env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 133, in migrate
result = self.run(migration, database)
File "/home/user/task/env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 114, in run
return self.run_migration(migration, database)
File "/home/user/task/env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 84, in run_migration
migration_function()
File "/home/user/task/env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 60, in
return (lambda: direction(orm))
File "/home/user/task/env/local/lib/python2.7/site-packages/review/migrations/0010_auto__chg_field_review_user.py", line 13, in forwards
db.alter_column(u'review_review', 'user_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['account.User'], null=True))
File "/home/user/task/env/local/lib/python2.7/site-packages/south/db/generic.py", line 47, in _cache_clear
return func(self, table, _args, *_opts)
File"/home/user/task/env/local/lib/python2.7/site-packages/south/db/generic.py", line 535, in alter_column
flatten(values),
File "/home/user/task/env/local/lib/python2.7/site-packages/south/db/generic.py", line 282, in execute
cursor.execute(sql, params)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/db/backends/util.py", line 69, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "review_review" does not exist

from django-review.

davinderkumar avatar davinderkumar commented on July 17, 2024

django version is '1.6.5'

from django-review.

Tyrdall avatar Tyrdall commented on July 17, 2024

@davinderkumar Did you use another review app before?

from django-review.

davinderkumar avatar davinderkumar commented on July 17, 2024

I used django-reviews app http://pythonhosted.org//django-reviews/ but uninstalled that before installing this one

from django-review.

Tyrdall avatar Tyrdall commented on July 17, 2024

Please take a look at this line:

File "/home/user/task/env/local/lib/python2.7/site-packages/review/migrations/0010_auto__chg_field_review_user.py", line 13, in forwards

We don't have such a migration file in this app. It seems that there's another app called review remaining in your env.

from django-review.

mbrochh avatar mbrochh commented on July 17, 2024

simply uninstalling won't help, you will probably need to manually deleted
the other apps tables and remove the entries from south_migrationhistory
On 7 Oct 2014 15:59, "Tobias Lorenz" [email protected] wrote:

Please take a look at this line:

File "/home/user/task/env/local/lib/python2.7/site-packages/review/migrations/0010_auto__chg_field_review_user.py", line 13, in forwards

We don't have such a migration file in this app. It seems that there's
another app called review remaining in your env.


Reply to this email directly or view it on GitHub
#14 (comment)
.

from django-review.

davinderkumar avatar davinderkumar commented on July 17, 2024

Yes, i manually deleted the records where app_name was review from 'south_migrationhistory'. but after that when i ran the command ./manage.py migrate review i got the error 'django.db.utils.ProgrammingError: relation "auth_user" does not exist'
I am using a custom user model for authentication and have declared this model in settings.py file as 'AUTH_USER_MODEL'='accounts.User'

and this is the traceback.

"/home/user/task/env/local/lib/python2.7/site-packages/sorl/thumbnail/helpers.py:5: DeprecationWarning: django.utils.simplejson is deprecated; use json instead.
from django.utils import simplejson

Running migrations for review:

  • Migrating forwards to 0009_auto__add_field_ratingcategorytranslation_question.

    review:0001_initial
    FATAL ERROR - The following SQL query failed: ALTER TABLE "review_review" ADD CONSTRAINT "user_id_refs_id_7515b805" FOREIGN KEY ("user_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED;
    The error was: relation "auth_user" does not exist

Error in migration: review:0001_initial
Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/core/management/init.py", line 399, in execute_from_command_line
utility.execute()
File "/home/user/task/env/local/lib/python2.7/site-packages/django/core/management/init.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(_args, *_options.dict)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(_args, *_options)
File "/home/user/task/env/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
ignore_ghosts = ignore_ghosts,
File "/home/user/task/env/local/lib/python2.7/site-packages/south/migration/init.py", line 220, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/home/user/task/env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 254, in migrate_many
result = migrator.class.migrate_many(migrator, target, migrations, database)
File "/home/user/task/env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 329, in migrate_many
result = self.migrate(migration, database)
File "/home/user/task/env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 133, in migrate
result = self.run(migration, database)
File "/home/user/task/env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 114, in run
return self.run_migration(migration, database)
File "/home/user/task/env/local/lib/python2.7/site-packages/south/migration/migrators.py", line 85, in run_migration
south.db.db.execute_deferred_sql()
File "/home/user/task/env/local/lib/python2.7/site-packages/south/db/generic.py", line 318, in execute_deferred_sql
self.execute(sql)
File "/home/user/task/env/local/lib/python2.7/site-packages/south/db/generic.py", line 282, in execute
cursor.execute(sql, params)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/db/backends/util.py", line 69, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in exit "/home/user/task/env/
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "auth_user" does not exist

from django-review.

Tyrdall avatar Tyrdall commented on July 17, 2024

OK. We'll have to arrange the old migrations. Please stand by.

from django-review.

davinderkumar avatar davinderkumar commented on July 17, 2024

db.create_table(u'review_review', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])),
('object_id', self.gf('django.db.models.fields.PositiveIntegerField')()),
('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)),
('content', self.gf('django.db.models.fields.TextField')(max_length=1024, blank=True)),
('language', self.gf('django.db.models.fields.CharField')(max_length=5, blank=True)),
('creation_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
))
db.send_create_signal(u'review', ['Review'])

In your code you have hard coded the 'user' to 'auth.User' which is creating the problem. and if it is hard coded at other places also further it can create problems.

from django-review.

Tyrdall avatar Tyrdall commented on July 17, 2024

I know. These migrations have been created long before the custom auth user model was developed. Will fix this soon. Please stand by.

from django-review.

Tyrdall avatar Tyrdall commented on July 17, 2024

Please check my latest commit: c287a1a

from django-review.

davinderkumar avatar davinderkumar commented on July 17, 2024

It is working fine now, No problem with custom User Model. Thank you

from django-review.

Tyrdall avatar Tyrdall commented on July 17, 2024

@davinderkumar Glad to hear that. I pushed a new version (1.9.1) to PyPi.

from django-review.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.