django-simple-analytics


Namedjango-simple-analytics JSON
Version 1.0.1 PyPI version JSON
download
home_page
SummaryA simple django packages to track requests on the site
upload_time2023-09-03 09:52:46
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords django analytics
VCS
bugtrack_url
requirements asgiref django sqlparse
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Django Simple Analytics

![PyPI](https://img.shields.io/pypi/v/django-simple-analytics?style=for-the-badge)
[![](https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge)](https://github.com/psf/black)
![PyPI - License](https://img.shields.io/pypi/l/django-simple-analytics?style=for-the-badge)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-simple-analytics?style=for-the-badge)

Simple analytics is a very simple package to track requests done to the website and store them in database.

## Installation

From PYPi using `pip`:

```
pip install django-simple-analytics
```

## Usage

In order to install the package add the following line to `INSTALLED_APPS`

```python
INSTALLED_APPS = [
    ...
    "simple_analytics",
]
```

This will make the model available for you to call and query. To enable the middleware, add this at the bottom of the middleware list:

```python
MIDDLEWARE = [
    ...
    "simple_analytics.middleware.page_counts",
]
```

Then, you need to run migrations, finally:

```console
./manage.py migrate
```

To actually create the table in the database.

Now every request done to the django website will be recorded in the database with the following fields:

- Date: The date pf the request.
- Page: The path of the request.
- Method: The verb used to request the page.
- Whether the page exists or not.
- Origin: If the header exists in the requst, where the request originated.
- User: The user who performed the request. If the user is not authenticated, it will show as AnonymousUser.
- view_count: The number of requests to that page, per date and per method used.

## Licence

This package is distributed under [MIT Licence](./LICENCE).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "django-simple-analytics",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "django,analytics",
    "author": "",
    "author_email": "Ferran Jovell <ferran.jovell+gh@gmail.com>",
    "download_url": "",
    "platform": null,
    "description": "# Django Simple Analytics\n\n![PyPI](https://img.shields.io/pypi/v/django-simple-analytics?style=for-the-badge)\n[![](https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge)](https://github.com/psf/black)\n![PyPI - License](https://img.shields.io/pypi/l/django-simple-analytics?style=for-the-badge)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-simple-analytics?style=for-the-badge)\n\nSimple analytics is a very simple package to track requests done to the website and store them in database.\n\n## Installation\n\nFrom PYPi using `pip`:\n\n```\npip install django-simple-analytics\n```\n\n## Usage\n\nIn order to install the package add the following line to `INSTALLED_APPS`\n\n```python\nINSTALLED_APPS = [\n    ...\n    \"simple_analytics\",\n]\n```\n\nThis will make the model available for you to call and query. To enable the middleware, add this at the bottom of the middleware list:\n\n```python\nMIDDLEWARE = [\n    ...\n    \"simple_analytics.middleware.page_counts\",\n]\n```\n\nThen, you need to run migrations, finally:\n\n```console\n./manage.py migrate\n```\n\nTo actually create the table in the database.\n\nNow every request done to the django website will be recorded in the database with the following fields:\n\n- Date: The date pf the request.\n- Page: The path of the request.\n- Method: The verb used to request the page.\n- Whether the page exists or not.\n- Origin: If the header exists in the requst, where the request originated.\n- User: The user who performed the request. If the user is not authenticated, it will show as AnonymousUser.\n- view_count: The number of requests to that page, per date and per method used.\n\n## Licence\n\nThis package is distributed under [MIT Licence](./LICENCE).\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A simple django packages to track requests on the site",
    "version": "1.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/mrswats/django-simple-analytics/issues",
        "homepage": "https://github.com/mrswats/django-simple-analytics"
    },
    "split_keywords": [
        "django",
        "analytics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "729b780e8525a473f6d9e719aaf4e1bf39cb41147ed3ebbc079e1d9acce9a505",
                "md5": "cbd9f45f0c9857f0f6a6e969c1cd70d4",
                "sha256": "928f3f6b0d9fc62a53a26ae03808a26a62278f448621d00ca3ad9f6eaff20c2d"
            },
            "downloads": -1,
            "filename": "django_simple_analytics-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cbd9f45f0c9857f0f6a6e969c1cd70d4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7297,
            "upload_time": "2023-09-03T09:52:46",
            "upload_time_iso_8601": "2023-09-03T09:52:46.933953Z",
            "url": "https://files.pythonhosted.org/packages/72/9b/780e8525a473f6d9e719aaf4e1bf39cb41147ed3ebbc079e1d9acce9a505/django_simple_analytics-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-03 09:52:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mrswats",
    "github_project": "django-simple-analytics",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "asgiref",
            "specs": [
                [
                    "==",
                    "3.5.2"
                ]
            ]
        },
        {
            "name": "django",
            "specs": [
                [
                    "==",
                    "4.1.1"
                ]
            ]
        },
        {
            "name": "sqlparse",
            "specs": [
                [
                    "==",
                    "0.4.2"
                ]
            ]
        }
    ],
    "lcname": "django-simple-analytics"
}
        
Elapsed time: 0.11205s