Skip to content

Fake Counter is a simple Django app for displaying a random number based on the time of day.

Notifications You must be signed in to change notification settings

iterweb/django_fake_counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Fake Visitor Counter

Downloads
Fake Counter is a simple Django app for displaying a random number based on the time of day.

Quick start

  • Install:
    pip install django-fake-counter-0.1.tar.gz
    or
    pip install fake-count
  • Add fake_count to your INSTALLED_APPS setting like this:
INSTALLED_APPS = (
        ...
        'fake_count',
    )
  • Add these settings to settings.py file in your project:
CACHES = {
        'default': {
            'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
            'LOCATION': os.path.join(BASE_DIR, 'fake_count_cache'),
        }
    }
    # optional
    MAX_COUNT_DAY = integer value # default 500
    MAX_COUNT_NIGHT = integer value # default 200
  • Load {% fake_count_tmpl %} in your html template and use it like {% fake_counter %}:
{% load fake_count_tmpl %}
    <!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="UTF-8">
            <title>Title</title>
        </head>
        <body>
            <p>Some text</p>
            <p>{% fake_counter %}</p>
        </body>
    </html>

License: The 3-Clause BSD License
Copyright (c) 2021, ITerWeb

About

Fake Counter is a simple Django app for displaying a random number based on the time of day.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published