- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我想使用django-tenant-schemas和GeoDjango (PostGIS)在我的 Django 项目中。我有一个默认数据库。但 django-tenant-schemas 和 GeoDjango 都希望我在设置中为数据库设置一个自定义引擎。
django-tenant-schemas 希望将其设置为 tenant_schemas.postgresql_backend
而 GeoDjango 希望将其设置为 django.contrib.gis.db.backends.postgis 。
这个问题有解决办法吗?
编辑:我只想将 GeoDjango 用于单个模型,并且我使用单个 Postgres 数据库。
最佳答案
我解决这个问题的方法是更改tenant_schame.postgresql_backend.base中的ORIGINAL_BACKEND。我把它改为
ORIGINAL_BACKEND = getattr(settings, 'ORIGINAL_BACKEND', 'django.contrib.gis.db.backends.postgis')
来自
ORIGINAL_BACKEND = getattr(settings, 'ORIGINAL_BACKEND', 'django.db.backends.postgresql_psycopg2')
关于python - Django-tenant-schemas 和 GeoDjango 一起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47016787/
我已经按照 geodjango 安装(windows XP)和教程进行了完善我正在运行 Django 1.2当我进入 syncdb 并运行时,我收到以下信息。 raise Improperly
我试图让 GeoDjango 在 ubuntu 上运行并且遇到了 GDAL 的问题。 我已经下载并安装了 GDAL 没有问题。 我必须将以下行添加到我的项目设置中: GDAL_LIBRARY_PATH
我的问题与 this 几乎相同.但是它很旧,感觉它一定是一个相当普遍的场景,可能有更好的解决方案。 我有一个类似的模型: class Person(models.Model): locatio
在我的模型中,我通过以下方式定义了一个多边形字段 polygon = models.PolygonField(srid=4326, geography=True, null=True, blank=T
如果可以的话: >>> from django.contrib.gis.geos import GEOSGeometry >>> from django.contrib.gis.geos import
我有以下(简化的)模型: class Zone(gismodels.Model): name = gismodels.CharField() poly = gismodels.Poly
我只是在学习 geo-django。我可以从一个点找出所有地方的距离。但是当我使用 .values带注释的方法 distance领域,我得到 TypeError: Object of type 'Di
首先我需要说这是我的第一个 GeoDjango 任务 - 所以如果有一些“RTF”行请告诉我。 我有两个 Django 模型: 设施模型。对于 code1 和 code2 的组合,不同位置可以存在几个
我目前正在构建我的第一个基于 Django 的应用程序,该应用程序正在进行中到目前为止还算不错。目标之一是允许用户发帖信息(文本、图片、视频)以及应用程序能够自动检测他们发布此信息的位置(即从浏览器中
我的 django 项目中有一个表单和一个表单集。该表单有一个带有点几何图形的输入。所以我在那里输入了看起来像这样的内容: 39.237103, 25.667217 当用户发送表单时,我想分割此输入并
我正在使用 postgis 和 geodjango,并且有很多区域几何图形作为多边形字段,其中许多似乎都有孔,有什么方法可以用来关闭这些孔并保留外部边界? 谢谢 最佳答案 documentation州
我正在尝试使用 GeoDjango 在 Python 中计算一组点上的簇。 问题:给定一组点,输出一组这些点的簇。(我可以提前指定集群数量/集群大小/距离以简化) 有几个solutions在网络上进行
我正在尝试使用 Leaflet 在弹出窗口中显示用户名。现在,我只能将外键 id/pk 作为数字返回,但我想在弹出窗口中显示用户的真实姓名。 (模型中的名称字段在弹出窗口中正确显示) 这是一个简单的模
我已经使用 PostGIS 后端创建了一个 Django 项目,据我所知,这一切似乎都很好。我现在在这个项目中创建了一个应用程序,如下所示: from django.contrib.gis.db im
我的 Profile 模型有这个字段: location = models.PointField(geography=True, dim=2, srid=4326) 我想使用 GeoDjango 计算
我有一个 Django 应用程序,在我安装 GeoDjango 之前它运行良好。我正在使用 Python 2.7.13(通过 mac 端口安装)、Django 1.10.4 运行 MacOS Sier
我想使用 GeoDjango 进行基本的位置搜索。具体来说,我想给搜索功能一个邮政编码/城市/县,并找到 5mi、10mi、20mi 等以内的所有邮政编码/城市/县。我在文档中找到了以下段落: Usi
我正在尝试根据地理位置的接近程度来检索一些帖子。 正如您在代码中看到的那样,我正在使用 GeoDjango 并且代码是在 View 中执行的。 问题是距离过滤器似乎被完全忽略了。 当我检查查询集上的距
我已经使用 postgis 实现了 GeoDjango。 这是我的模型: ... geometria = models.PolygonField(srid=4326, null=True)
我想知道是否有办法知道 OSMWidget 坐标何时更改,我假装在经度和纬度字段上反射(reflect)此更改。我有以下表格: from django.contrib.gis import forms
我是一名优秀的程序员,十分优秀!