django - 在 Heroku 中安装 C 库

标签 django heroku geoip

我正在尝试使用 GeoIP与 Django 。它需要 MaxMind GeoIP C API .

如果我使用 Ruby,我可以简单地使用捆绑 C API 和 Ruby 绑定(bind)的 'geoip' gem,如 Installing MaxMind GeoIP ruby library on heroku 中所述。 .

不幸的是,Python 不存在这样的东西,所以我想知道如何从 Heroku 上的源代码安装 C API,或者 Heroku 上是否有等效的包管理器(即 OS X 的“brew install geoip” , 和 'sudo apt-get install geoip' 用于 Ubuntu)。

最佳答案

您需要编写自己的 buildpack 来编译 Heroku 中的任何内容,在您推送代码时,并且在您的 requirements.txt 中有一个包含二进制要求的包。请参阅 python buildpack 代码来指导您的工作 https://github.com/heroku/heroku-buildpack-python

关于django - 在 Heroku 中安装 C 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13668936/

相关文章:

python - Django make_aware 用法

mysql - MySQL/Postgres 之间的大小写敏感问题

performance - 如何提高 BigQuery 中 GeoIP 查询的性能?

perl - MaxMind Writer 创建自定义数据库以与 ELK Stack 中的 geoip 一起使用

python - 如何在多台服务器上实现 Web 应用程序的自动更新功能?

python - 如何让 django runserver 向我显示 DeprecationWarnings 和其他有用的消息?

Django 模型 - 共享公共(public)基类的不同对象类型的外键

Heroku 的 Hobby 计划每月最高费用是多少?

ruby-on-rails - 使用 Rails RefineryCMS 在 Heroku 上响应队列时间较长

delphi - delphi中的Maxmind geoip查询