Skip to main content

DJANGO COUNTRY FILTER

Django middleware is an application access filter from the country of the request. The idea that you can do an access control directly in the application, without the need for a firewall or other resource, because often the applications are for country-specific use without many complexities.

Installation and use

The use of middleware is very simple, just install the middleware via pip and configure it in the application.

$ pip install django_country_filter

In the settings.py file of the Django application, just insert the following line in the MIDDLEWARE configuration.

Need to DJANGO_COUNTRY_FILTER_PROVIDER and DJANGO_COUNTRY_FILTER_COUNTRIES configurations.

MIDDLEWARE = {
    'django_country_filter.DjangoCountryFilterMiddleware',
    ...
}

DJANGO_COUNTRY_FILTER_PROVIDER = 'ip2c' # But you can create your provider.
DJANGO_COUNTRY_FILTER_COUNTRIES = ['BR'] # Only Brazil access application.

How to help in development?

You can help improve the code, improve the documentation and also implement new providers. To help, just keep the tests integral.

Environment

$ python -m venv .env
$ source .env/bin/activate
$ pip install -r requirements/development.txt
$ pytest

Metadata

Release files for django-country-filter 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-country-filter 0.0.1
File Size Uploaded Provenance Actions
django_country_filter-0.0.1.tar.gz 3.3 kB Without provenance Details for django_country_filter-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-country-filter 0.0.1
File Interpreter ABI Platform Actions
django_country_filter-0.0.1-py3-none-any.whl Python 3 none any Details for django_country_filter-0.0.1-py3-none-any.whl

Total release size: 20.9 kB

Release files / django_country_filter-0.0.1.tar.gz

Download URL django_country_filter-0.0.1.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1a37695f43cce2b2c88c237561cf8b501e25ab2b2fc51a02746af283d80e19f8
BLAKE2b-256 checksum
How to use checksums
5143a7862ec6e42813b136337c15fac9c5c3fcbdca92ac78a6b17075ca79224f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

Release files / django_country_filter-0.0.1-py3-none-any.whl

Download URL django_country_filter-0.0.1-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8983b9bf71aee98b9d8809cd60313d20b8b9ef7ee824f6709f82034760367eb8
BLAKE2b-256 checksum
How to use checksums
07b5fd9902247e994c12ea15eb2e7cfc64936a137696775f50f4887c118ecafb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

Security for django-country-filter 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page