Skip to content

Commit

Permalink
[Closes #3661] django 1.11 LTS support on master
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Apr 17, 2018
1 parent b17b40a commit c0b298f
Show file tree
Hide file tree
Showing 20 changed files with 252 additions and 52 deletions.
7 changes: 4 additions & 3 deletions geonode/client/templates/admin/themes/custom_theme_css.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,10 @@ body {

.home .jumbotron:after {
content: "";
background: url({{ theme.jumbotron_bg.url }}) no-repeat !important;
background-size: 100%;
background-position-y: center;
background-image: url({{ theme.jumbotron_bg.url }}) !important;
background-repeat: no-repeat !important;
background-position: center !important;
background-size: cover !important;
{% if not theme.jumbotron_welcome_hide %}
opacity: 0.5;
{% endif %}
Expand Down
23 changes: 23 additions & 0 deletions geonode/documents/migrations/0033_auto_20180414_2120.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-14 21:20
from __future__ import unicode_literals

from django.db import migrations
import django.db.models.manager


class Migration(migrations.Migration):

dependencies = [
('documents', '0032_auto_20180412_0822'),
]

operations = [
migrations.AlterModelManagers(
name='document',
managers=[
('objects', django.db.models.manager.Manager()),
('base_objects', django.db.models.manager.Manager()),
],
),
]
1 change: 1 addition & 0 deletions geonode/layers/templates/layers/layer_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ <h2 class="page-title">{% trans "Explore Layers" %}</h2>

{% block extra_script %}
{{ block.super }}

{% if GEONODE_SECURITY_ENABLED %}
{% include "_permissions_form_js.html" %}
{% endif %}
Expand Down
20 changes: 15 additions & 5 deletions geonode/local_settings.py.geoserver.sample
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#########################################################################

import os
from urlparse import urlparse, urlunparse
from geonode.settings import *

PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
Expand All @@ -31,7 +32,15 @@ STATIC_ROOT = os.getenv('STATIC_ROOT',

# SECRET_KEY = '************************'

SITEURL = "http://localhost:8000"
SITEURL = "http://localhost:8000/"

# we need hostname for deployed
_surl = urlparse(SITEURL)
HOSTNAME = _surl.hostname

# add trailing slash to site url. geoserver url will be relative to this
if not SITEURL.endswith('/'):
SITEURL = '{}/'.format(SITEURL)

ALLOWED_HOSTS = ['localhost', 'geonode.example.com']

Expand Down Expand Up @@ -65,8 +74,8 @@ GEOSERVER_LOCATION = os.getenv(
)

GEOSERVER_PUBLIC_LOCATION = os.getenv(
# 'GEOSERVER_PUBLIC_LOCATION', '{}/geoserver/'.format(SITEURL)
'GEOSERVER_LOCATION', 'http://localhost:8080/geoserver/'
# 'GEOSERVER_PUBLIC_LOCATION', '{}geoserver/'.format(SITEURL)
'GEOSERVER_PUBLIC_LOCATION', GEOSERVER_LOCATION
)

OGC_SERVER_DEFAULT_USER = os.getenv(
Expand Down Expand Up @@ -158,7 +167,7 @@ CATALOGUE = {
# 'ENGINE': 'geonode.catalogue.backends.generic',

# The FULLY QUALIFIED base url to the CSW instance for this GeoNode
'URL': '%s/catalogue/csw' % SITEURL,
'URL': '%scatalogue/csw' % SITEURL,
# 'URL': 'http://localhost:8080/geonetwork/srv/en/csw',
# 'URL': 'http://localhost:8080/deegree-csw-demo-3.0.4/services',

Expand Down Expand Up @@ -440,7 +449,8 @@ if MONITORING_ENABLED:
MIDDLEWARE_CLASSES += \
('geonode.contrib.monitoring.middleware.MonitoringMiddleware',)
MONITORING_CONFIG = None
MONITORING_SERVICE_NAME = 'local-geonode'
MONITORING_HOST_NAME = os.getenv("MONITORING_HOST_NAME", HOSTNAME)
MONITORING_SERVICE_NAME = 'geonode'

#Define email service on GeoNode
EMAIL_ENABLE = True
Expand Down
23 changes: 23 additions & 0 deletions geonode/maps/migrations/0030_auto_20180414_2120.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-14 21:20
from __future__ import unicode_literals

from django.db import migrations
import django.db.models.manager


class Migration(migrations.Migration):

dependencies = [
('maps', '0029_auto_20180412_0822'),
]

operations = [
migrations.AlterModelManagers(
name='map',
managers=[
('objects', django.db.models.manager.Manager()),
('base_objects', django.db.models.manager.Manager()),
],
),
]
3 changes: 3 additions & 0 deletions geonode/people/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ def response_add(self, request, obj, post_url_continue=None):
# * The user has pressed the 'Save and add another' button
# * We are adding a user in a popup
if '_addanother' not in request.POST and IS_POPUP_VAR not in request.POST:
mutable = request.POST._mutable
request.POST._mutable = True
request.POST['_continue'] = 1
request.POST._mutable = mutable
return super(ProfileAdmin, self).response_add(request, obj,
post_url_continue)

Expand Down
21 changes: 21 additions & 0 deletions geonode/people/migrations/0027_auto_20180414_2120.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-14 21:20
from __future__ import unicode_literals

import django.contrib.auth.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('people', '0026_auto_20171120_0730'),
]

operations = [
migrations.AlterField(
model_name='profile',
name='username',
field=models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.ASCIIUsernameValidator()], verbose_name='username'),
),
]
2 changes: 1 addition & 1 deletion geonode/people/templates/people/profile_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ <h3>{{ profile.first_name|default:profile.name_long }}</h3>
</ul>
<ul class="list-group">
{% if USE_NOTIFICATIONS %}
<li class="list-group-item"><a href="{% url "notice_settings" %}"><i class="fa fa-bell"></i> {% trans "Notifications" %}</a></li>
<li class="list-group-item"><a href="{% url "pinax_notifications:notice_settings" %}"><i class="fa fa-bell"></i> {% trans "Notifications" %}</a></li>
{% endif %}
{% if perms.announcements.can_manage %}
<li class="list-group-item"><a href="{% url "announcements_list" %}"><i class="fa fa-bullhorn"></i> {% trans "Announcements" %}</a></li>
Expand Down
23 changes: 23 additions & 0 deletions geonode/services/migrations/0039_auto_20180414_2120.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-14 21:20
from __future__ import unicode_literals

from django.db import migrations
import django.db.models.manager


class Migration(migrations.Migration):

dependencies = [
('services', '0038_auto_20180412_0822'),
]

operations = [
migrations.AlterModelManagers(
name='service',
managers=[
('objects', django.db.models.manager.Manager()),
('base_objects', django.db.models.manager.Manager()),
],
),
]
35 changes: 27 additions & 8 deletions geonode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import sys
from datetime import timedelta
from distutils.util import strtobool
from urlparse import urlparse, urlunparse

import django
import dj_database_url
Expand Down Expand Up @@ -636,13 +637,21 @@

# Setting a custom test runner to avoid running the tests for
# some problematic 3rd party apps
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
# Default Nose Test Suite
# TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'

# Django 1.11 ParallelTestSuite
TEST_RUNNER = 'geonode.tests.suite.runner.GeoNodeBaseSuiteDiscoverRunner'
TEST_RUNNER_KEEPDB = 0
TEST_RUNNER_PARALLEL = 4

# GeoNode test suite
# TEST_RUNNER = 'geonode.tests.suite.runner.DjangoParallelTestSuiteRunner'
TEST_RUNNER_WORKER_MAX = 3
TEST_RUNNER_WORKER_COUNT = 'auto'
TEST_RUNNER_NOT_THREAD_SAFE = None
TEST_RUNNER_PARENT_TIMEOUT = 10
TEST_RUNNER_WORKER_TIMEOUT = 10
# TEST_RUNNER_WORKER_MAX = 3
# TEST_RUNNER_WORKER_COUNT = 'auto'
# TEST_RUNNER_NOT_THREAD_SAFE = None
# TEST_RUNNER_PARENT_TIMEOUT = 10
# TEST_RUNNER_WORKER_TIMEOUT = 10

TEST = 'test' in sys.argv
INTEGRATION = 'geonode.tests.integration' in sys.argv
Expand All @@ -658,6 +667,15 @@
#
SITEURL = os.getenv('SITEURL', "http://localhost:8000/")

# we need hostname for deployed
_surl = urlparse(SITEURL)
HOSTNAME = _surl.hostname

# add trailing slash to site url. geoserver url will be relative to this
if not SITEURL.endswith('/'):
SITEURL = '{}/'.format(SITEURL)


DEFAULT_WORKSPACE = os.getenv('DEFAULT_WORKSPACE', 'geonode')
CASCADE_WORKSPACE = os.getenv('CASCADE_WORKSPACE', 'geonode')

Expand All @@ -679,7 +697,8 @@
)

GEOSERVER_PUBLIC_LOCATION = os.getenv(
'GEOSERVER_PUBLIC_LOCATION', 'http://localhost:8080/geoserver/'
# 'GEOSERVER_PUBLIC_LOCATION', '{}geoserver/'.format(SITEURL)
'GEOSERVER_PUBLIC_LOCATION', GEOSERVER_LOCATION
)

OGC_SERVER_DEFAULT_USER = os.getenv(
Expand Down Expand Up @@ -1420,7 +1439,7 @@

# add following lines to your local settings to enable monitoring
MONITORING_ENABLED = ast.literal_eval(os.environ.get('MONITORING_ENABLED', 'True'))
MONITORING_HOST_NAME = 'localhost'
MONITORING_HOST_NAME = os.getenv("MONITORING_HOST_NAME", HOSTNAME)
MONITORING_SERVICE_NAME = 'geonode'

# how long monitoring data should be stored
Expand Down
2 changes: 1 addition & 1 deletion geonode/templates/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ <h4 class="modal-title" id="myModalLabel">{% trans "Menu" %}</h4>
<li><a href="{% url "recent-activity" %}"><i class="fa fa-fire"></i> {% trans "Recent Activity" %}</a></li>
<li><a href="{% url "messages_inbox" %}"><i class="fa fa-inbox"></i> {% trans "Inbox" %}</a></li>
{% if USE_NOTIFICATIONS %}
<li><a href="{% url "notice_settings" %}"><i class="fa fa-bell"></i> {% trans "Notifications" %}</a></li>
<li><a href="{% url "pinax_notifications:notice_settings" %}"><i class="fa fa-bell"></i> {% trans "Notifications" %}</a></li>
{% endif %}
{% if perms.announcements.can_manage %}
<li><a href="{% url "announcements_list" %}"><i class="fa fa-bullhorn"></i> {% trans "Announcements" %}</a></li>
Expand Down
5 changes: 3 additions & 2 deletions geonode/tests/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
#########################################################################
# ##############################################################################
#
# Copyright (C) 2018 OSGeo
#
Expand All @@ -16,14 +16,15 @@
# You should have received a copy of the GNU General Public License
# along with this profgram. If not, see <http://www.gnu.org/licenses/>.
#
#########################################################################
# ##############################################################################

from django.test.testcases import SimpleTestCase, TestCase, LiveServerTestCase

try:
from django.utils.decorators import classproperty
except:
class classproperty(object):

def __init__(self, method=None):
self.fget = method

Expand Down
12 changes: 3 additions & 9 deletions geonode/tests/csw.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,20 @@
#
#########################################################################

from .base import GeoNodeBaseTestSupport

import glob
import os
from unittest import TestCase
from lxml import etree
import gisdata
from geonode.catalogue import get_catalogue
from geonode.utils import check_ogc_backend
from geonode import geoserver, qgis_server


class GeoNodeCSWTest(TestCase):
class GeoNodeCSWTest(GeoNodeBaseTestSupport):
"""Tests geonode.catalogue app/module"""

def setUp(self):
# call_command('loaddata', 'sample_admin', verbosity=0)
pass

def tearDown(self):
pass

def test_csw_base(self):
"""Verify that GeoNode works against any CSW"""

Expand Down

0 comments on commit c0b298f

Please sign in to comment.