Giter VIP home page Giter VIP logo

geodjango-basic-apps's People

Watchers

 avatar  avatar

geodjango-basic-apps's Issues

invalid time_zone setting causes strange stacktrace in geographic_admin

What steps will reproduce the problem?
1. install geographic_admin and make sure it is all working
2. edit settings.py to change TIME_ZONE to an invalid value eg.
TIME_ZONE='abcdefg'
3. python manage.py shell

------------------------------------------------------------------------
What is the expected output? What do you see instead?
a django python shell

instead I get a mysterious stack trace:
geo@tux:~/geographic_admin$ python manage.py shell
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/home/geo/lib/python/django/core/management/__init__.py", line 340,
in execute_manager
    utility.execute()
  File "/home/geo/lib/python/django/core/management/__init__.py", line 295,
in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/geo/lib/python/django/core/management/base.py", line 192, in
run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/geo/lib/python/django/core/management/base.py", line 219, in
execute
    output = self.handle(*args, **options)
  File "/home/geo/lib/python/django/core/management/base.py", line 348, in
handle
    return self.handle_noargs(**options)
  File "/home/geo/lib/python/django/core/management/commands/shell.py",
line 18, in handle_noargs
    loaded_models = get_models()
  File "/home/geo/lib/python/django/db/models/loading.py", line 136, in
get_models
    self._populate()
  File "/home/geo/lib/python/django/db/models/loading.py", line 57, in
_populate
    self.load_app(app_name, True)
  File "/home/geo/lib/python/django/db/models/loading.py", line 72, in load_app
    mod = __import__(app_name, {}, {}, ['models'])
  File "/home/geo/geographic_admin/world/models.py", line 6, in <module>
    from django.contrib.gis.db import models
  File "/home/geo/lib/python/django/contrib/gis/db/models/__init__.py",
line 5, in <module>
    from django.contrib.gis.db.models.manager import GeoManager
  File "/home/geo/lib/python/django/contrib/gis/db/models/manager.py", line
2, in <module>
    from django.contrib.gis.db.models.query import GeoQuerySet
  File "/home/geo/lib/python/django/contrib/gis/db/models/query.py", line
5, in <module>
    from django.contrib.gis.db.backend import SpatialBackend
  File "/home/geo/lib/python/django/contrib/gis/db/backend/__init__.py",
line 12, in <module>
    from django.contrib.gis.db.backend.postgis import create_spatial_db,
get_geo_where_clause, SpatialBackend
  File
"/home/geo/lib/python/django/contrib/gis/db/backend/postgis/__init__.py",
line 4, in <module>
    from django.contrib.gis.db.backend.postgis.adaptor import PostGISAdaptor
  File
"/home/geo/lib/python/django/contrib/gis/db/backend/postgis/adaptor.py",
line 5, in <module>
    from django.contrib.gis.db.backend.postgis.query import GEOM_FROM_WKB
  File
"/home/geo/lib/python/django/contrib/gis/db/backend/postgis/query.py", line
14, in <module>
    POSTGIS_VERSION, MAJOR_VERSION, MINOR_VERSION1, MINOR_VERSION2 =
postgis_version_tuple()
  File
"/home/geo/lib/python/django/contrib/gis/db/backend/postgis/management.py",
line 45, in postgis_version_tuple
    version = postgis_lib_version()
  File
"/home/geo/lib/python/django/contrib/gis/db/backend/postgis/management.py",
line 25, in postgis_lib_version
    return _get_postgis_func('postgis_lib_version')
  File
"/home/geo/lib/python/django/contrib/gis/db/backend/postgis/management.py",
line 13, in _get_postgis_func
    cursor.execute('SELECT %s()' % func)
  File "/home/geo/lib/python/django/db/backends/util.py", line 19, in execute
    return self.cursor.execute(sql, params)
psycopg2.ProgrammingError: current transaction is aborted, commands ignored
until end of transaction block
------------------------------------------------------------------------

What version of the product are you using? On what operating system?
geographic_admin revision 115
django 1.0.2
ubuntu 8.04 LTS
postgresql       8.3.5-0ubuntu0.8.04
python-psycopg2  2.0.6-3
output of SELECT postgis_full_version();
POSTGIS="1.3.5" GEOS="3.0.3-CAPI-1.4.2" PROJ="Rel. 4.6.1, 21 August 2008"
USE_STATS

------------------------------------------------------------------------

Please provide any additional information below.
the only settings I have changed in settings.py are the DATABASE_USER and
TIME_ZONE
when I change the timezone back to 
TIME_ZONE = 'America/Vancouver'
everything works fine.

Other commands to manage.py also give the same stack trace.
If I comment out the 'world' installed app I can get a shell as expected.

Original issue reported on code.google.com by [email protected] on 15 Feb 2009 at 8:35

error in cape example

What steps will reproduce the problem?
1. cape app
2. go to http://localhost:8000/wards/96/

What is the expected output? What do you see instead?

TemplateSyntaxError at /wards/96/

Caught AttributeError while rendering: 'tuple' object has no attribute 'srid'

Request Method:     GET
Request URL:    http://localhost:8000/wards/96/
Django Version:     1.2.1
Exception Type:     TemplateSyntaxError
Exception Value:    

Caught AttributeError while rendering: 'tuple' object has no attribute 'srid'

Exception Location: 
    /usr/local/lib/python2.6/dist-packages/Django-1.2.1-py2.6.egg/django/contrib/gi
s/db/backends/postgis/operations.py in get_geom_placeholder, line 390

What version of the product are you using? On what operating system?

Ubuntu 10.04

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 27 Aug 2010 at 6:13

load_data.py fails with latest django trunk

It looks like the utils module was recently changed a bit in
django.contrib.gis.

Here's what I changed to make load_data.py work:

[allan@petrof geographic_admin]$ svn diff load_data.py
Index: load_data.py
===================================================================
--- load_data.py        (revision 60)
+++ load_data.py        (working copy)
@@ -11,7 +11,9 @@
 import os
 os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

-from django.contrib.gis.utils import mapping, LayerMapping, add_postgis_srs
+from django.contrib.gis.utils.ogrinspect import mapping
+from django.contrib.gis.utils.layermapping import LayerMapping
+from django.contrib.gis.utils.srs import add_postgis_srs
 from world.models import WorldBorders

 add_postgis_srs(900913)

Original issue reported on code.google.com by [email protected] on 1 Sep 2008 at 3:59

Geographic databrowse shows no map



I appear to have geographic_admin up and running, and I can see the maps
rendering in the admin interface.

But I have no map in databrowse.  "World Borders" shows all the attributes
for a country, but the "Select Feature to See Geometry" listbox is empty,
and there is no map to the right of this control like there is in the
screenshots.

Any suggestions on how I can debug this?  The respective versions of
geographic_admin and django are shown below.



[allan@petrof proj]$ svn info geographic_admin/
Path: geographic_admin
URL:
http://geodjango-basic-apps.googlecode.com/svn/trunk/projects/geographic_admin
Repository Root: http://geodjango-basic-apps.googlecode.com/svn
Repository UUID: f561bbcf-a753-0410-87ae-9bb7ba73f0a0
Revision: 60
Node Kind: directory
Schedule: normal
Last Changed Author: dane.springmeyer
Last Changed Rev: 56
Last Changed Date: 2008-08-16 21:55:20 -0400 (Sat, 16 Aug 2008)


[root@petrof local]# svn info django_trunk
Path: django_trunk
URL: http://code.djangoproject.com/svn/django/trunk
Repository Root: http://code.djangoproject.com/svn
Repository UUID: bcc190cf-cafb-0310-a4f2-bffc1f526a37
Revision: 8793
Node Kind: directory
Schedule: normal
Last Changed Author: russellm
Last Changed Rev: 8793
Last Changed Date: 2008-09-01 07:34:22 -0400 (Mon, 01 Sep 2008)


Original issue reported on code.google.com by [email protected] on 1 Sep 2008 at 4:04

Django returns error after modifying country boundary polygon

What steps will reproduce the problem?

1. Start django using the builtin server
geographic_admin> python manage.py runserver

2. Load up any country's admin page
http://localhost:8000/admin/world/worldborders/138/

3. Move a vertex of the polygon

4. Click save.

5. Return to the country's admin page again
http://localhost:8000/admin/world/worldborders/138/

--------------------------------------------------------------------
What is the expected output? What do you see instead?

I would expect to see the admin page for the country, but instead I get a
Django error page...

Environment:

Request Method: GET
Request URL: http://optiplexe:8000/admin/world/worldborders/21/
Django Version: 1.0-final-SVN-9084
Python Version: 2.5.2
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.databrowse',
 'django.contrib.gis',
 'world']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware')


Traceback:
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in
get_response
  86.                 response = callback(request, *callback_args,
**callback_kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in root
  158.                 return self.model_page(request, *url.split('/', 2))
File "/usr/lib/python2.5/site-packages/django/views/decorators/cache.py" in
_wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in
model_page
  177.         return admin_obj(request, rest_of_url)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in
__call__
  197.             return self.change_view(request, unquote(url))
File "/usr/lib/python2.5/site-packages/django/db/transaction.py" in
_commit_on_success
  238.                 res = func(*args, **kw)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in
change_view
  598.             form = ModelForm(instance=obj)
File "/usr/lib/python2.5/site-packages/django/forms/models.py" in __init__
  201.             object_data = model_to_dict(instance, opts.fields,
opts.exclude)
File "/usr/lib/python2.5/site-packages/django/forms/models.py" in model_to_dict
  123.             data[f.name] = f.value_from_object(instance)
File "/usr/lib/python2.5/site-packages/django/db/models/fields/__init__.py"
in value_from_object
  332.         return getattr(obj, self.attname)
File
"/usr/lib/python2.5/site-packages/django/contrib/gis/db/models/proxy.py" in
__get__
  36.             geom = self._klass(geom_value)
File "/usr/lib/python2.5/site-packages/django/contrib/gis/geos/base.py" in
__init__
  66.                 g = from_hex(geo_input, len(geo_input))
File
"/usr/lib/python2.5/site-packages/django/contrib/gis/geos/prototypes/errcheck.py
"
in check_geom
  32.         raise GEOSException('Error encountered checking Geometry
returned from GEOS C function "%s".' % func.__name__)

Exception Type: GEOSException at /admin/world/worldborders/21/
Exception Value: Error encountered checking Geometry returned from GEOS C
function "GEOSGeomFromHEX_buf".

--------------------------------------------------------------------
What version of the product are you using? On what operating system?
Django Version: 1.0-final-SVN-9084
Python Version: 2.5.2
Ubuntu 8.04

--------------------------------------------------------------------
Please provide any additional information below.
I get this response on two separate servers.

Original issue reported on code.google.com by [email protected] on 22 Sep 2008 at 9:10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.