Skip to main content
Test Coverage Latest PyPi version python django docs licence

A pluggable django application that adds the ability for users to flag(report or moderate) your models.

flagging-process

For complete documentation you may visit Read the Doc. or see the docs directory.

Installation

Install using pip

$ pip install django-flag-app

If you want, you may install it from the source, grab the source code and install it.

$ git clone git://github.com/abhiabhi94/django-flag-app.git
$ cd django-flag-app
$ pip install .

Usage

Add app

To enable django_flag_app in your project you need to add it to INSTALLED_APPS in your projects settings.py file:

INSTALLED_APPS = (
    ...
    'flag',
    ...
)

Add URL

In your root urls.py:

urlpatterns = patterns(
        path('admin/', admin.site.urls),
        path('flag/', include('flag.urls')),
        ...
        path('api/', include('flag.api.urls')),  # only required for API Framework
        ...
    )

Migrate

Run the migrations to add the new models to your database:

python manage.py migrate flag

Connect the flag model with the target model

In models.py add the field flags as a GenericRelation field to the required model.

E.g. for a Post model, you may add the field as shown below:

from django.contrib.contenttypes.fields import GenericRelation

from flag.models import Flag


class Post(models.Model):
    user = models.ForeignKey(User)
    title = models.CharField(max_length=200)
    body = models.TextField()
    # the field name should be flags
    flags = GenericRelation(Flag)

Use template tag

If you want to use web API, this step is not required. See further instructions at Web API.

render_flag_form tag requires 3 required positional arguments:

  1. Instance of the targeted model.

  2. User object.

  3. Request object

To render the flag form for a the instance post, place this inside your detail view, perhaps in some template of the sort postdetail.html.

{% render_flag_form post user request %}

Contributing

Please see the instructions at Contributing.rst.

Release files for django-flag-app 2.0.0

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-flag-app 2.0.0
File Size Uploaded
django_flag_app-2.0.0.tar.gz 16.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-flag-app 2.0.0
File Interpreter ABI Platform
django_flag_app-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size:37.6 kB

Release files / django_flag_app-2.0.0.tar.gz

Download URL django_flag_app-2.0.0.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
29898fa7b9c3aea66f8b4c98f92c1b6063784d9e60fca8a3d71fddcb6f2b13e7
BLAKE2b-256 checksum
How to use checksums
d47967e74db44c4fa66a31a0cfd224894a262ecea3ee91c3bc56117d6f2388f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 11, 2025.

Transparency log

Release files / django_flag_app-2.0.0-py3-none-any.whl

Download URL django_flag_app-2.0.0-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3c364d699416d7a481b6b08badf3c6dd92d3b158575bb12b4a3da80f36ca440
BLAKE2b-256 checksum
How to use checksums
35e60e9db1f6a8c9a3286893a6f8f2098bc56e66afd6b372124a674480f14378
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 11, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

1 release file

1.0.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

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