Troubleshooting

This page helps you diagnose and fix common issues with Django Growl Notifier.

Common Issues

Notifications Not Appearing

Symptom: No Growl notifications are shown.

Solutions:

  1. Check if Growl is running

    • Windows: Check Task Manager for Growl.exe

    • macOS: Check menu bar for Growl icon

    • Linux: Verify GNTP-compatible daemon is running

  2. Verify Growl is listening for network notifications

    • Open Growl settings/preferences

    • Enable “Listen for incoming notifications”

    • Check “Allow remote application registration”

  3. Test network connectivity

    # Test if port is open
    telnet 192.168.1.100 23053
    
    # Or using netcat
    nc -zv 192.168.1.100 23053
    
  4. Check Django settings

    # In Django shell
    from django.conf import settings
    
    print("GROWL_ENABLED:", getattr(settings, 'GROWL_ENABLED', 'Not set'))
    print("GROWL_HOSTS:", getattr(settings, 'GROWL_HOSTS', 'Not set'))
    print("App installed:", 'django_growl' in settings.INSTALLED_APPS)
    
  5. Enable debug logging

    # settings.py
    LOGGING = {
        'version': 1,
        'disable_existing_loggers': False,
        'handlers': {
            'console': {
                'class': 'logging.StreamHandler',
            },
        },
        'loggers': {
            'django_growl': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
        },
    }
    

Notifications Work Locally But Not on Remote Hosts

Symptom: Local notifications work, but remote hosts don’t receive them.

Solutions:

  1. Check firewall settings

    • Port 23053 must be open on remote machines

    • Both incoming and outgoing traffic

    • Check both OS firewall and network firewall

    # Windows: Allow port in Windows Firewall
    netsh advfirewall firewall add rule name="Growl" dir=in action=allow protocol=TCP localport=23053
    
    # Linux: Using ufw
    sudo ufw allow 23053/tcp
    
    # Linux: Using iptables
    sudo iptables -A INPUT -p tcp --dport 23053 -j ACCEPT
    
  2. Verify Growl network settings on remote machine

    • Enable “Listen for incoming notifications”

    • Check allowed hosts/networks

    • Verify password settings (if any)

  3. Test with command line

    # Test script to verify connectivity
    import gntp.notifier
    
    growl = gntp.notifier.GrowlNotifier(
        applicationName='Test',
        notifications=['Test'],
        defaultNotifications=['Test'],
        hostname='192.168.1.100',
        port=23053
    )
    
    try:
        growl.register()
        growl.notify(
            noteType='Test',
            title='Test Notification',
            description='Testing connectivity'
        )
        print("Success!")
    except Exception as e:
        print(f"Error: {e}")
    

Icons Not Showing

Symptom: Notifications appear but without icons.

Solutions:

  1. Verify icon file exists

    # In Django shell
    from pathlib import Path
    from django.conf import settings
    
    icon_path = Path(settings.GROWL_ICON)
    print(f"Icon exists: {icon_path.is_file()}")
    print(f"Icon path: {icon_path}")
    
  2. Check icon format

    • Supported formats: PNG, JPG, GIF

    • Recommended: PNG with transparency

    • Size: 48x48 to 128x128 pixels

  3. Use absolute paths or URIs

    # Good
    GROWL_ICON = '/absolute/path/to/icon.png'
    GROWL_ICON = Path(BASE_DIR) / 'static' / 'logo.png'
    
    # Bad
    GROWL_ICON = 'icon.png'  # Relative path may not work
    
  4. Test with default icon

    # Temporarily remove custom icon
    # GROWL_ICON = ...  # Comment this out
    
    # Restart server and test
    

Error Notifications Not Working

Symptom: Server start notifications work, but error notifications don’t appear.

Solutions:

  1. Verify middleware is installed

    # settings.py
    MIDDLEWARE = [
        # ... other middleware
        'django_growl.middleware.GrowlErrorMiddleware',  # Must be here
    ]
    
  2. Check error notification is enabled

    # settings.py
    GROWL_NOTIFY_ERRORS = True  # Must be True
    
  3. Test with intentional error

    # Create a test view
    def test_error(request):
        raise Exception("Test error for Growl notification")
    
  4. Check error logs

    # Enable logging for middleware
    LOGGING = {
        'loggers': {
            'django_growl.middleware': {
                'handlers': ['console'],
                'level': 'DEBUG',
            },
        },
    }
    

Duplicate Notifications

Symptom: Receiving multiple identical notifications.

Cause: Usually due to Django auto-reloader in development.

Solutions:

  1. This is expected behavior in development - Django’s runserver reloads code automatically

  2. Disable auto-reload for testing

    python manage.py runserver --noreload
    
  3. Won’t occur in production (using gunicorn, uwsgi, etc.)

Connection Timeout

Symptom: Error messages about connection timeout.

Solutions:

  1. Increase timeout (if using custom code)

    import gntp.notifier
    
    growl = gntp.notifier.GrowlNotifier(
        # ... other params
        timeout=5  # Increase timeout to 5 seconds
    )
    
  2. Check network latency

    ping 192.168.1.100
    
  3. Verify Growl is responding

    • Restart Growl application

    • Check Growl logs for errors

Package Import Errors

Symptom: ImportError or ModuleNotFoundError.

Solutions:

  1. Verify installation

    pip show django-growl-notifier
    
  2. Check Python path

    import sys
    print(sys.path)
    
  3. Reinstall package

    pip uninstall django-growl-notifier
    pip install django-growl-notifier
    
  4. Verify Django detects the app

    python manage.py shell
    >>> from django.apps import apps
    >>> apps.get_app_config('django_growl')
    

Debugging Tips

Enable Verbose Logging

# settings.py
LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'verbose': {
            'format': '{levelname} {asctime} {module} {message}',
            'style': '{',
        },
    },
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
            'formatter': 'verbose',
        },
    },
    'loggers': {
        'django_growl': {
            'handlers': ['console'],
            'level': 'DEBUG',
            'propagate': False,
        },
    },
}

Test Notification Manually

# In Django shell
from django_growl import send_notification

send_notification(
    title="Test",
    message="Testing notification system",
    sticky=True
)

Check Notifier Status

# In Django shell
from django_growl import get_growl_notifier

notifier = get_growl_notifier()
print(f"Enabled: {notifier.enabled}")
print(f"Hosts configured: {len(notifier.growl_hosts)}")
print(f"Notifiers registered: {len(notifier.notifiers)}")

for item in notifier.notifiers:
    print(f"  - {item['host']}:{item['port']}")

Performance Issues

Notifications Slowing Down Application

Symptom: Application feels slow when notifications are enabled.

Solutions:

  1. Use async/background tasks for notifications

    from django_growl import send_notification
    from celery import shared_task
    
    @shared_task
    def send_async_notification(title, message):
        send_notification(title, message)
    
    # Use in views
    send_async_notification.delay("Task Done", "Processing complete")
    
  2. Reduce notification frequency

    • Don’t send notification on every request

    • Aggregate multiple events into one notification

  3. Disable in production

    # settings/production.py
    GROWL_ENABLED = False
    

Getting Help

If you’re still experiencing issues:

  1. Check the logs - Enable DEBUG logging as shown above

  2. Search existing issues - GitHub Issues

  3. Create a new issue with:

    • Django version

    • Python version

    • django-growl-notifier version

    • Full error traceback

    • Relevant configuration

  4. Contact support:

Useful Commands

# Check installed version
pip show django-growl-notifier

# Test Growl connectivity
telnet localhost 23053

# Check Django settings
python manage.py shell -c "from django.conf import settings; print(settings.GROWL_HOSTS)"

# Test notification
python manage.py shell -c "from django_growl import send_notification; send_notification('Test', 'Testing')"

# View logs in real-time
python manage.py runserver 2>&1 | grep django_growl

Next Steps