anandsingh / geodjango-basic-apps Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/geodjango-basic-apps
Automatically exported from code.google.com/p/geodjango-basic-apps
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
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
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
[deleted issue]
django v1.3 fix
Original issue reported on code.google.com by [email protected]
on 15 Jun 2011 at 10:55
Attachments:
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
engine variable
Original issue reported on code.google.com by [email protected]
on 16 Jun 2011 at 8:46
Attachments:
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.