Skip to main content

Django Analytics simple is a package designed to facilitate tracking and analysis of data in Django web applications

Project description

Django Analytics Simple

See documentation at : Español | English

Django Analytics simple is a Django package designed to facilitate tracking and analysis of user data in web applications. It provides middleware that records information about users, including details such as browser, operating system, device, and geographical location. The collected data is stored in a new database table, enabling detailed analytics to improve user experience and make informed decisions in application development and maintenance.

Installation

You can install Django Analytics simple using pip:

pip install django_analytics_simple

Then, add 'django_analytics' to your Django project's installed apps in the settings.py file:

INSTALLED_APPS = [
    ...
    'django_analytics_simple',
    ...
]

Next, include the provided middleware in your project's middleware stack in the same settings.py file:

MIDDLEWARE = [
    ...
    'django_analytics_simple.middleware.AnalyticsMiddleware',
    ...
]

Configuration

Django Analytics simple requires the GeoLite2-City.mmdb file for IP geolocation, which should already be included in the package, and it will be updated monthly.

Additionally, you can set the ANALYTICS_LANGUAGE variable in your Django project's settings.py file to specify the language for location data retrieval.

ANALYTICS_LANGUAGE = 'en'  # Specify the language for location data retrieval

Please note that you may need to review the languages supported by MaxMindDB for proper configuration.

Dependencies

Django Analytics simple relies on the following external libraries:

[MaxMindDB] https://pypi.org/project/maxminddb/ [User-agents] https://pypi.org/project/user-agents/ Ensure that these dependencies are installed before using Django Analytics.

Usage

After configuring Django Analytics simple, run the following commands to apply migrations:

python manage.py makemigrations django_analytics_simple
python manage.py migrate

License

This project is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. See the LICENSE file for details.

Author

Santiago Nestor Britos - s.britos@hotmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_analytics_simple-2024.0.9.tar.gz (25.9 MB view hashes)

Uploaded Source

Built Distribution

django_analytics_simple-2024.0.9-py3-none-any.whl (26.2 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page