Skip to content

Instantly share code, notes, and snippets.

@okjodom
Created December 28, 2016 17:02
Show Gist options
  • Save okjodom/bb99ceac641d4a791fa5aa1fb846bc8b to your computer and use it in GitHub Desktop.
Save okjodom/bb99ceac641d4a791fa5aa1fb846bc8b to your computer and use it in GitHub Desktop.
this bug when installing geonode 2.4.x, both in dev mode and in admin/deploy mode
(geonode) jdev@linux /home/geonode/dev/geonode $ python manage.py migrate
Not enabling BingMaps base layer as a BING_API_KEY is not defined in local_settings.py file.
Traceback (most recent call last):
File "manage.py", line 28, in <module>
execute_from_command_line(sys.argv)
File "/home/geonode/dev/.venvs/geonode/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/home/geonode/dev/.venvs/geonode/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/geonode/dev/.venvs/geonode/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/geonode/dev/.venvs/geonode/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/home/geonode/dev/.venvs/geonode/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
ignore_ghosts = ignore_ghosts,
File "/home/geonode/dev/.venvs/geonode/local/lib/python2.7/site-packages/south/migration/__init__.py", line 173, in migrate_app
Migrations.calculate_dependencies()
File "/home/geonode/dev/.venvs/geonode/local/lib/python2.7/site-packages/south/migration/base.py", line 240, in calculate_dependencies
migration.calculate_dependencies()
File "/home/geonode/dev/.venvs/geonode/local/lib/python2.7/site-packages/south/migration/base.py", line 374, in calculate_dependencies
for migration in self._get_dependency_objects("depends_on"):
File "/home/geonode/dev/.venvs/geonode/local/lib/python2.7/site-packages/south/migration/base.py", line 354, in _get_dependency_objects
for app, name in getattr(self.migration_class(), attrname, []):
File "/home/geonode/dev/.venvs/geonode/local/lib/python2.7/site-packages/south/migration/base.py", line 326, in migration_class
return self.migration().Migration
File "/home/geonode/dev/.venvs/geonode/local/lib/python2.7/site-packages/south/utils/__init__.py", line 62, in method
value = function(self)
File "/home/geonode/dev/.venvs/geonode/local/lib/python2.7/site-packages/south/migration/base.py", line 315, in migration
raise exceptions.UnknownMigration(self, sys.exc_info())
south.exceptions.UnknownMigration: Migration 'agon_ratings:0001_initial' probably doesn't exist.
Traceback (most recent call last):
File "/home/geonode/dev/.venvs/geonode/local/lib/python2.7/site-packages/south/migration/base.py", line 313, in migration
migration = __import__(full_name, {}, {}, ['Migration'])
File "/home/geonode/dev/.venvs/geonode/local/lib/python2.7/site-packages/agon_ratings/migrations/0001_initial.py", line 23, in <module>
from django.db import migrations, models
ImportError: cannot import name migrations
amqp==1.4.9
anyjson==0.3.3
awesome-slugify==1.6.2
beautifulsoup4==4.2.1
billiard==3.3.0.23
celery==3.1.17
Django==1.6.11
django-activity-stream==0.4.5b1
django-appconf==0.5
django-autocomplete-light==2.2.10
django-bootstrap3-datetimepicker==2.2.3
django-celery==3.1.16
django-downloadview==1.2
django-extensions==1.2.5
django-forms-bootstrap==3.0.1
django-friendly-tag-loader==1.1
django-geoexplorer==4.0.5
django-guardian==1.2.0
django-haystack==2.1.0
django-jsonfield==0.9.12
django-leaflet==0.13.7
django-modeltranslation==0.8
django-mptt==0.6.1
django-nose==1.2
django-pagination==1.0.7
django-polymorphic==0.5.6
django-taggit==0.12
django-tastypie==0.11.0
flake8==2.3.0
GDAL==2.1.0
geolinks==0.2.0
-e git+https://github.com/GeoNode/geonode.git@b7664f0a2451b3a841fe1f12e6fcdb01ed717a52#egg=GeoNode
geonode-agon-ratings==0.3.5
geonode-announcements==1.0.5
geonode-arcrest==10.2
geonode-avatar==2.1.4
geonode-dialogos==0.4
geonode-notification==1.1.1
geonode-user-accounts==1.0.10
geonode-user-messages==0.1.2
gisdata==0.5.4
gsconfig==1.0.3
gsimporter==1.0.0
httplib2==0.8
kombu==3.0.37
lxml==3.7.1
mccabe==0.5.3
MultipartPostHandler==0.1.0
nose==1.0.0
OWSLib==0.10.0
Paver==1.2.1
pep8==1.6.2
Pillow==3.4.2
pinax-theme-bootstrap==3.0a11
pinax-theme-bootstrap-account==1.0b2
psycopg2==2.6.2
pycsw==1.10.5
pyelasticsearch==0.6.1
pyflakes==1.3.0
pyproj==1.9.5.1
python-dateutil==2.6.0
python-mimeparse==1.6.0
pytz==2016.10
regex==2016.12.27
requests==2.12.4
Shapely==1.3.1
simplejson==3.10.0
six==1.10.0
South==1.0.2
transifex-client==0.10
Unidecode==0.4.19
@jkariscodes
Copy link

Before we make our first migrations and generate our database, we also have to
create the schema migration. Command below

manage.py schemamigration appname --initial

Then perform an initial migration

manage.py syncdb --migrate

After running syncdb --migrate for the first time, never run it again. Use migrate afterwards

Each time we finish editing our models, we must execute the following two
commands in the correct order:

manage.py schemamigration appname –auto
manage.py migrate appname

For more check this book's chapter 5 on "Working with Models". At https://www.geekbooks.me/book/view/django-essentials

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment