Skip to content
Snippets Groups Projects
Commit b4ef9b22 authored by pjdufour's avatar pjdufour
Browse files

Fixed migrations, settings.py, and pavement for development

parent 8d5a83a7
Branches
Tags
No related merge requests found
# -*- coding: utf-8 -*-
# flake8: noqa
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0003_auto_20160821_1919'),
]
operations = [
migrations.AlterField(
model_name='contactrole',
name='role',
field=models.CharField(
help_text='function performed by the responsible party',
max_length=255,
choices=[
(b'author', 'party who authored the resource'),
(b'processor', 'party who has processed the data in a manner such that the resource has been modified'),
(b'publisher', 'party who published the resource'),
(b'custodian', 'party that accepts accountability and responsibility for the data and ensures appropriate care and maintenance of the resource'),
(b'pointOfContact', 'party who can be contacted for acquiring knowledge about or acquisition of the resource'),
(b'distributor', 'party who distributes the resource'),
(b'user', 'party who uses the resource'),
(b'resourceProvider', 'party that supplies the resource'),
(b'originator', 'party who created the resource'),
(b'owner', 'party that owns the resource'),
(b'principalInvestigator', 'key party responsible for gathering information and conducting research')]),
),
migrations.AlterField(
model_name='resourcebase',
name='category',
field=models.ForeignKey(
blank=True,
to='base.TopicCategory',
help_text='high-level geographic data thematic classification to assist in the grouping and search of available geographic data sets.',
null=True),
),
]
# -*- coding: utf-8 -*-
# flake8: noqa
from __future__ import unicode_literals
from django.db import migrations, models
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('people', '0002_auto_20160821_1919'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='keywords',
field= taggit.managers.TaggableManager(
to='taggit.Tag',
through='taggit.TaggedItem',
blank=True,
help_text='commonly used word(s) or formalised word(s) or phrase(s) used to describe the subject (space or comma-separated',
verbose_name='keywords'),
),
]
# -*- coding: utf-8 -*-
# flake8: noqa
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('services', '0002_auto_20160821_1919'),
]
operations = [
migrations.AlterField(
model_name='serviceprofilerole',
name='role',
field=models.CharField(
help_text='function performed by the responsible party',
max_length=255,
choices=[
(b'author', 'party who authored the resource'),
(b'processor', 'party who has processed the data in a manner such that the resource has been modified'),
(b'publisher', 'party who published the resource'),
(b'custodian', 'party that accepts accountability and responsibility for the data and ensures appropriate care and maintenance of the resource'),
(b'pointOfContact', 'party who can be contacted for acquiring knowledge about or acquisition of the resource'),
(b'distributor', 'party who distributes the resource'),
(b'user', 'party who uses the resource'),
(b'resourceProvider', 'party that supplies the resource'),
(b'originator', 'party who created the resource'),
(b'owner', 'party that owns the resource'),
(b'principalInvestigator', 'key party responsible for gathering information and conducting research')]),
),
]
......@@ -42,8 +42,8 @@ PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
# Setting debug to true makes Django serve static media and
# present pretty error pages.
DEBUG = strtobool(os.getenv('DEBUG', 'False'))
TEMPLATE_DEBUG = strtobool(os.getenv('TEMPLATE_DEBUG', 'False'))
DEBUG = strtobool(os.getenv('DEBUG', 'True'))
TEMPLATE_DEBUG = strtobool(os.getenv('TEMPLATE_DEBUG', 'True'))
# Set to True to load non-minified versions of (static) client dependencies
# Requires to set-up Node and tools that are required for static development
......@@ -61,12 +61,14 @@ ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS', ['localhost', 'django'])
_DEFAULT_SECRET_KEY = 'myv-y4#7j-d*p-__@j#*3z@!y24fz8%^z2v6atuy4bo9vqr1_a'
SECRET_KEY = os.getenv('SECRET_KEY', _DEFAULT_SECRET_KEY)
DATABASE_URL = os.getenv('DATABASE_URL', 'sqlite:/// development.db')
DATABASE_URL = os.getenv(
'DATABASE_URL',
'sqlite:///{path}'.format(path=os.path.join(PROJECT_ROOT, 'development.db')))
# Defines settings for development
DATABASES = {'default':
dj_database_url.parse(DATABASE_URL, conn_max_age=600),
}
DATABASES = {
'default': dj_database_url.parse(DATABASE_URL, conn_max_age=600)
}
MANAGERS = ADMINS = os.getenv('ADMINS', [])
......@@ -926,7 +928,7 @@ except ImportError:
pass
# Load additonal basemaps, see geonode/contrib/api_basemap/README.md
# Load additonal basemaps, see geonode/contrib/api_basemap/README.md
try:
from geonode.contrib.api_basemaps import *
except ImportError:
......
......@@ -55,6 +55,7 @@ dev_config = None
with open("dev_config.yml", 'r') as f:
dev_config = yaml.load(f)
def grab(src, dest, name):
download = True
if not dest.exists():
......@@ -74,6 +75,7 @@ def grab(src, dest, name):
else:
urllib.urlretrieve(str(src), str(dest))
@task
@cmdopts([
('geoserver=', 'g', 'The location of the geoserver build (.war file).'),
......@@ -210,18 +212,12 @@ def sync(options):
"""
Run the syncdb and migrate management commands to create and migrate a DB
"""
try:
sh("python manage.py migrate auth --noinput")
except:
pass
try:
sh("python manage.py migrate sites --noinput")
except:
pass
try:
sh("python manage.py migrate people --noinput")
except:
pass
migrate_apps = ['account', 'contenttypes', 'sites', 'auth', 'people', 'base', 'services'] # Order is very important
for app in migrate_apps:
try:
sh("python manage.py migrate {app} --noinput".format(app=app))
except:
pass
try:
sh("python manage.py migrate --noinput")
except:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment