diff options
author | CoprDistGit <infra@openeuler.org> | 2023-06-20 08:47:44 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-06-20 08:47:44 +0000 |
commit | dce58f3f21c387cea684fa7fa90c42291e0060bd (patch) | |
tree | 36811a110ec95ac6d8e781a1ff067e27a7f5e200 | |
parent | 3b6941dc0818d28f53c90f35be19e3d57ec16df3 (diff) |
automatic import of python-dj-auditopeneuler20.03
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-dj-audit.spec | 335 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 337 insertions, 0 deletions
@@ -0,0 +1 @@ +/dj_audit-0.1.4.tar.gz diff --git a/python-dj-audit.spec b/python-dj-audit.spec new file mode 100644 index 0000000..d0832b4 --- /dev/null +++ b/python-dj-audit.spec @@ -0,0 +1,335 @@ +%global _empty_manifest_terminate_build 0 +Name: python-dj-audit +Version: 0.1.4 +Release: 1 +Summary: Django Audit is a simple Django app that tracks and logs requests to your application. +License: Apache Software License +URL: https://github.com/Emmarex/django-audit +Source0: https://mirrors.aliyun.com/pypi/web/packages/9b/48/096bc0fdf7d78506b258efeb90cf94074018631cdc3bcd293f8c2f4dcec0/dj_audit-0.1.4.tar.gz +BuildArch: noarch + +Requires: python3-Django +Requires: python3-psycopg2-binary + +%description +# django-audit + + + + +[](https://codecov.io/gh/Emmarex/django-audit) +[](https://github.com/Emmarex/django-audit/actions/workflows/main.yml) +[](https://github.com/pre-commit/pre-commit) + +Django Audit is a simple Django app that tracks and logs requests to your application. + +## Quick Start + +1. Install django-audit + +```bash +pip install dj-audit +``` + +2. Add ```dj_audit``` to your INSTALLED_APPS: + +```python +INSTALLED_APPS = [ + ..., + "dj_audit" +] +``` + +3. Add ```dj_audit``` middleware: + +```python +MIDDLEWARE = [ + ... + "dj_audit.middleware.AuditMiddleware" +] +``` + +if you want access to the dj-audit dashboard, then add the following to your ```urls.py``` + +```python +urlpatterns = [ + path("admin/", admin.site.urls), + path("dj-audit/", include('dj_audit.urls')) +] +``` + +4. Run migrate + +```bash +python manage.py migrate +``` + +## Management commands + +```flush_auditlog``` - Cleans up dj-audit AuditLog table + +```bash +python manage.py flush_auditlog +``` + +## Customizing dj-audit +You have a couple options available to you to customize ```dj-audit``` a bit. These should be defined in your ```settings.py``` file. + +- ```AUDIT_LOG_TEMPLATE```: str: If set, the template here will be render when the user visits the audit log page (i.e /dj-audit/audit-logs/) + +- ```REQUEST_STATUS_TEMPLATE```: str: If set, the template here will be render when the user visits the request status page (i.e /dj-audit/request-status/) + +- ```IGNORE_FILE_EXTENSIONS```: list: If set, the middleware will not log endpoints containing the extensions specified in the list. **DEFAULT**: ```['.svg', '.js', '.css', '.png', '.jpg', '.ico']``` + +- ```AUDIT_LOG_DJ_REST_CONTENT_TYPES```: list: content type of your Rest APIs. **DEFAULT**: ```['application/json', 'application/xml']``` + +- ```AUDIT_LOG_DJ_EXTRA_CONDITIONS_FOR_200```: bool: Specify if there are extra conditions you will like to check to validate if a request is successful or not. **DEFAULT**: ```False``` + +- ```AUDIT_LOG_DJ_EXTRA_CONDITIONS```: list: Extra conditions to set to determine if a request body is successful or not. **DEFAULT**: ```[]``` + + +## Test + +```bash +make test +``` + +or with coverage + +```bash +make coverage_test +``` + + +%package -n python3-dj-audit +Summary: Django Audit is a simple Django app that tracks and logs requests to your application. +Provides: python-dj-audit +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-dj-audit +# django-audit + + + + +[](https://codecov.io/gh/Emmarex/django-audit) +[](https://github.com/Emmarex/django-audit/actions/workflows/main.yml) +[](https://github.com/pre-commit/pre-commit) + +Django Audit is a simple Django app that tracks and logs requests to your application. + +## Quick Start + +1. Install django-audit + +```bash +pip install dj-audit +``` + +2. Add ```dj_audit``` to your INSTALLED_APPS: + +```python +INSTALLED_APPS = [ + ..., + "dj_audit" +] +``` + +3. Add ```dj_audit``` middleware: + +```python +MIDDLEWARE = [ + ... + "dj_audit.middleware.AuditMiddleware" +] +``` + +if you want access to the dj-audit dashboard, then add the following to your ```urls.py``` + +```python +urlpatterns = [ + path("admin/", admin.site.urls), + path("dj-audit/", include('dj_audit.urls')) +] +``` + +4. Run migrate + +```bash +python manage.py migrate +``` + +## Management commands + +```flush_auditlog``` - Cleans up dj-audit AuditLog table + +```bash +python manage.py flush_auditlog +``` + +## Customizing dj-audit +You have a couple options available to you to customize ```dj-audit``` a bit. These should be defined in your ```settings.py``` file. + +- ```AUDIT_LOG_TEMPLATE```: str: If set, the template here will be render when the user visits the audit log page (i.e /dj-audit/audit-logs/) + +- ```REQUEST_STATUS_TEMPLATE```: str: If set, the template here will be render when the user visits the request status page (i.e /dj-audit/request-status/) + +- ```IGNORE_FILE_EXTENSIONS```: list: If set, the middleware will not log endpoints containing the extensions specified in the list. **DEFAULT**: ```['.svg', '.js', '.css', '.png', '.jpg', '.ico']``` + +- ```AUDIT_LOG_DJ_REST_CONTENT_TYPES```: list: content type of your Rest APIs. **DEFAULT**: ```['application/json', 'application/xml']``` + +- ```AUDIT_LOG_DJ_EXTRA_CONDITIONS_FOR_200```: bool: Specify if there are extra conditions you will like to check to validate if a request is successful or not. **DEFAULT**: ```False``` + +- ```AUDIT_LOG_DJ_EXTRA_CONDITIONS```: list: Extra conditions to set to determine if a request body is successful or not. **DEFAULT**: ```[]``` + + +## Test + +```bash +make test +``` + +or with coverage + +```bash +make coverage_test +``` + + +%package help +Summary: Development documents and examples for dj-audit +Provides: python3-dj-audit-doc +%description help +# django-audit + + + + +[](https://codecov.io/gh/Emmarex/django-audit) +[](https://github.com/Emmarex/django-audit/actions/workflows/main.yml) +[](https://github.com/pre-commit/pre-commit) + +Django Audit is a simple Django app that tracks and logs requests to your application. + +## Quick Start + +1. Install django-audit + +```bash +pip install dj-audit +``` + +2. Add ```dj_audit``` to your INSTALLED_APPS: + +```python +INSTALLED_APPS = [ + ..., + "dj_audit" +] +``` + +3. Add ```dj_audit``` middleware: + +```python +MIDDLEWARE = [ + ... + "dj_audit.middleware.AuditMiddleware" +] +``` + +if you want access to the dj-audit dashboard, then add the following to your ```urls.py``` + +```python +urlpatterns = [ + path("admin/", admin.site.urls), + path("dj-audit/", include('dj_audit.urls')) +] +``` + +4. Run migrate + +```bash +python manage.py migrate +``` + +## Management commands + +```flush_auditlog``` - Cleans up dj-audit AuditLog table + +```bash +python manage.py flush_auditlog +``` + +## Customizing dj-audit +You have a couple options available to you to customize ```dj-audit``` a bit. These should be defined in your ```settings.py``` file. + +- ```AUDIT_LOG_TEMPLATE```: str: If set, the template here will be render when the user visits the audit log page (i.e /dj-audit/audit-logs/) + +- ```REQUEST_STATUS_TEMPLATE```: str: If set, the template here will be render when the user visits the request status page (i.e /dj-audit/request-status/) + +- ```IGNORE_FILE_EXTENSIONS```: list: If set, the middleware will not log endpoints containing the extensions specified in the list. **DEFAULT**: ```['.svg', '.js', '.css', '.png', '.jpg', '.ico']``` + +- ```AUDIT_LOG_DJ_REST_CONTENT_TYPES```: list: content type of your Rest APIs. **DEFAULT**: ```['application/json', 'application/xml']``` + +- ```AUDIT_LOG_DJ_EXTRA_CONDITIONS_FOR_200```: bool: Specify if there are extra conditions you will like to check to validate if a request is successful or not. **DEFAULT**: ```False``` + +- ```AUDIT_LOG_DJ_EXTRA_CONDITIONS```: list: Extra conditions to set to determine if a request body is successful or not. **DEFAULT**: ```[]``` + + +## Test + +```bash +make test +``` + +or with coverage + +```bash +make coverage_test +``` + + +%prep +%autosetup -n dj_audit-0.1.4 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-dj-audit -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.1.4-1 +- Package Spec generated @@ -0,0 +1 @@ +8075b0f4c93150464f0cf8c601456a6b dj_audit-0.1.4.tar.gz |