[GeoNode-users] NameError: name 'PROJECT_ROOT' is not defined

Ariel Nunez ingenieroariel at gmail.com
Thu Aug 13 11:23:42 PDT 2015


Add this to the start of that file:

PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))

I have committed a fix for this in github.

-a

On Thu, Aug 13, 2015 at 12:28 PM, Natalia Queiroz <queiroz.nati at gmail.com>
wrote:

> Hello Group,
>
> I'm working on a complete installation of Geonode and I'm stuck on the
> part of *Synchronise db, *it says that there is no name 'PROJECT_ROOT'
> defined
>
> Any Idea?
>
> # python manage.py syncdb --noinput --all
> Traceback (most recent call last):
>   File "manage.py", line 28, in <module>
>     execute_from_command_line(sys.argv)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 399, in execute_from_command_line
>     utility.execute()
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 392, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 261, in fetch_command
>     commands = get_commands()
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 107, in get_commands
>     apps = settings.INSTALLED_APPS
>   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py",
> line 54, in __getattr__
>     self._setup(name)
>   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py",
> line 49, in _setup
>     self._wrapped = Settings(settings_module)
>   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py",
> line 128, in __init__
>     mod = importlib.import_module(self.SETTINGS_MODULE)
>   File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py",
> line 40, in import_module
>     __import__(name)
>   File "/home/ubuntu/geonode/geonode/settings.py", line 885, in <module>
>     from local_settings import *  # noqa
>   File "/home/ubuntu/geonode/geonode/local_settings.py", line 39, in
> <module>
>     'LOG_FILE': '%s/geoserver/data/logs/geoserver.log' %
> os.path.abspath(os.path.join(PROJECT_ROOT, os.pardir)),
> *NameError: name 'PROJECT_ROOT' is not defined*
>
>
> local_settings.py file
>
> import os
>
> SITEURL = "http://localhost:8000/"
>
> DATABASES = {
>     'default': {
>          'ENGINE': 'django.db.backends.postgresql_psycopg2',
>          'NAME': 'geonode',
>          'USER': 'geonode',
>          'PASSWORD': 'geonode',
>      },
>     # vector datastore for uploads
>     'datastore' : {
>         'ENGINE': 'django.contrib.gis.db.backends.postgis',
>         'ENGINE': '', # Empty ENGINE name disables
>         'NAME': 'geonode-imports',
>         'USER' : 'geonode',
>         'PASSWORD' : 'geonode',
>         'HOST' : 'localhost',
>         'PORT' : '5432',
>     }
> }
>
>
> # OGC (WMS/WFS/WCS) Server Settings
> OGC_SERVER = {
>     'default' : {
>         'BACKEND' : 'geonode.geoserver',
>         'LOCATION' : 'http://localhost:8080/geoserver/',
>         'PUBLIC_LOCATION' : 'http://localhost:8080/geoserver/',
>         'USER' : 'admin',
>         'PASSWORD' : 'geoserver',
>         'MAPFISH_PRINT_ENABLED' : True,
>         'PRINT_NG_ENABLED' : True,
>         'GEONODE_SECURITY_ENABLED' : True,
>         'GEOGIG_ENABLED' : False,
>         'WMST_ENABLED' : False,
>         'BACKEND_WRITE_ENABLED': True,
>         'WPS_ENABLED' : False,
>         'LOG_FILE': '%s/geoserver/data/logs/geoserver.log' %
> os.path.abspath(os.path.join(PROJECT_ROOT, os.pardir)),
>         # Set to name of database in DATABASES dictionary to enable
>         'DATASTORE': '', #'datastore',
>     }
> }
>
> CATALOGUE = {
>     'default': {
>         # The underlying CSW implementation
>         # default is pycsw in local mode (tied directly to GeoNode Django
> DB)
>         'ENGINE': 'geonode.catalogue.backends.pycsw_local',
>         # pycsw in non-local mode
>         # 'ENGINE': 'geonode.catalogue.backends.pycsw_http',
>         # GeoNetwork opensource
>         # 'ENGINE': 'geonode.catalogue.backends.geonetwork',
>         # deegree and others
>         # 'ENGINE': 'geonode.catalogue.backends.generic',
>
>         # The FULLY QUALIFIED base url to the CSW instance for this GeoNode
>         'URL': '%scatalogue/csw' % SITEURL,
>         # 'URL': 'http://localhost:8080/geonetwork/srv/en/csw',
>         # 'URL': 'http://localhost:8080/deegree-csw-demo-3.0.4/services',
>
>         # login credentials (for GeoNetwork)
>         'USER': 'admin',
>         'PASSWORD': 'admin',
>     }
> }
>
> # Default preview library
> #LAYER_PREVIEW_LIBRARY = 'geoext'
>
>
> ALLOWED_HOST = ['localhost']
>
>
>
> --
>
>
> Natália Oliveira
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/geonode-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20150813/e257a94a/attachment.html>


More information about the geonode-users mailing list