{"id":16624258,"url":"https://github.com/dcramer/django-notices","last_synced_at":"2025-07-26T22:38:14.537Z","repository":{"id":643906,"uuid":"285924","full_name":"dcramer/django-notices","owner":"dcramer","description":"A message notification system for Django","archived":false,"fork":false,"pushed_at":"2010-02-01T06:53:52.000Z","size":440,"stargazers_count":22,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-21T15:11:25.498Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcramer.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-08-23T20:22:07.000Z","updated_at":"2023-09-08T16:25:43.000Z","dependencies_parsed_at":"2022-08-16T10:35:08.948Z","dependency_job_id":null,"html_url":"https://github.com/dcramer/django-notices","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dcramer/django-notices","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcramer%2Fdjango-notices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcramer%2Fdjango-notices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcramer%2Fdjango-notices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcramer%2Fdjango-notices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcramer","download_url":"https://codeload.github.com/dcramer/django-notices/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcramer%2Fdjango-notices/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267254056,"owners_count":24060137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T03:45:41.958Z","updated_at":"2025-07-26T22:38:14.515Z","avatar_url":"https://github.com/dcramer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"django-notices\n--------------\n\ndjango-notices is a replacement for the built-in message notification system in Django. It works off of the current session rather than a database store, which means it also works for Anonymous users, and does not require doing database queries each time you need to access it.\n\nInstallation\n============\n\nTo install the latest stable version::\n\n\tsudo easy_install django-notices\n\nTo install the latest development version (updated quite often)::\n\n\tgit clone git://github.com/dcramer/django-notices.git\n\tcd django_notices\n\tsudo python setup.py install\n\nUsage\n=====\n\nThe easiest way to use django-notices, is simply by adding it to your settings.py::\n\n\tINSTALLED_APPS = (\n\t    '...',\n\t    'django_notices',\n\t)\n\t\n\tMIDDLEWARE_CLASSES = (\n\t    'django_notices.middleware.NoticeMiddleware',\n\t)\n\t\n\tTEMPLATE_CONTEXT_PROCESSORS = (\n\t    'django_notices.context_processors.notices',\n\t)\n\nOnce you've done this you'll now have access to two important pieces of the notice system, the ``notices`` context variable, and ``request.notices``.\n\nThe first thing you're going to want to do, is add a handler for ``notices`` within your templates::\n\n\t\u003cdiv id=\"notices\"\u003e\n\t\t\u003cul\u003e\n\t\t\t{% for notice in request.notices %}\n\t\t\t\t\u003cli class=\"notice notice-{{ notice.level_label }}\"\u003e{{ notice.message|escape }}\u003c/li\u003e\n\t\t\t{% endfor %}\n\t\t\u003c/ul\u003e\n\t\u003c/div\u003e\n\nWhat this does, is on each page load, displays each active notice and clears it from the session.\n\nNow once you can display your notices, you'll need to begin adding them. This is also made very ::\n\n\tdef my_view(request):\n\t\trequest.notices.warn('This is a warning')\n\nThere are several methods available in the built-in handler::\n\n\tNoticeHandler.warn\n\tNoticeHandler.error\n\tNoticeHandler.info\n\tNoticeHandler.debug\n\tNoticeHandler.success\n\nBy default, DEBUG level notices are not shown. To change this, you can adjust the ``NOTICE_LEVEL`` setting in your ``settings.py``::\n\n\tfrom django_notices import DEBUG\n\tNOTICE_LEVEL = DEBUG","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcramer%2Fdjango-notices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcramer%2Fdjango-notices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcramer%2Fdjango-notices/lists"}