Comments (14)
@davinderkumar Which version of Django is installed? Please post the whole traceback.
from django-review.
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.
django version is '1.6.5'
from django-review.
@davinderkumar Did you use another review
app before?
from django-review.
I used django-reviews app http://pythonhosted.org//django-reviews/ but uninstalled that before installing this one
from django-review.
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.
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.
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.
OK. We'll have to arrange the old migrations. Please stand by.
from django-review.
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.
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.
Please check my latest commit: c287a1a
from django-review.
It is working fine now, No problem with custom User Model. Thank you
from django-review.
@davinderkumar Glad to hear that. I pushed a new version (1.9.1) to PyPi.
from django-review.
Related Issues (20)
- render_category_averages breaks on reviews without ratings
- Outdated on Django Packages HOT 3
- Migration error HOT 1
- Approve reviews before they are shown in list of reviews HOT 1
- hvad.descriptors.NoTranslationError When creating a new review HOT 1
- NoReverseMatch error HOT 13
- 'str' object has no attribute '_meta' HOT 10
- ObjectID vs ID ? HOT 1
- Amount of reviews HOT 1
- Subject Field addition HOT 3
- Dot instead of comma HOT 1
- Content-type header is wrong? HOT 2
- TemplateDoesNotExist at ~ HOT 1
- Rest APi
- TypeError: 'class Meta' got invalid attribute(s): base_manager_name HOT 1
- 'Library' object has no attribute 'assignment_tag' error HOT 2
- review modles is missing an on_delete positional argument HOT 1
- Support for Django>=2.0 HOT 1
- Will there be a Django 3.0 support? HOT 3
- how to use it with react UI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-review.