micro-users 1.3.1__tar.gz → 1.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of micro-users might be problematic. Click here for more details.

Files changed (38) hide show
  1. micro_users-1.3.2/PKG-INFO +282 -0
  2. micro_users-1.3.2/README.md +251 -0
  3. micro_users-1.3.2/micro_users.egg-info/PKG-INFO +282 -0
  4. {micro_users-1.3.1 → micro_users-1.3.2}/pyproject.toml +1 -1
  5. {micro_users-1.3.1 → micro_users-1.3.2}/setup.py +1 -1
  6. {micro_users-1.3.1 → micro_users-1.3.2}/users/tables.py +6 -6
  7. micro_users-1.3.1/PKG-INFO +0 -133
  8. micro_users-1.3.1/README.md +0 -102
  9. micro_users-1.3.1/micro_users.egg-info/PKG-INFO +0 -133
  10. {micro_users-1.3.1 → micro_users-1.3.2}/LICENSE +0 -0
  11. {micro_users-1.3.1 → micro_users-1.3.2}/MANIFEST.in +0 -0
  12. {micro_users-1.3.1 → micro_users-1.3.2}/micro_users.egg-info/SOURCES.txt +0 -0
  13. {micro_users-1.3.1 → micro_users-1.3.2}/micro_users.egg-info/dependency_links.txt +0 -0
  14. {micro_users-1.3.1 → micro_users-1.3.2}/micro_users.egg-info/requires.txt +0 -0
  15. {micro_users-1.3.1 → micro_users-1.3.2}/micro_users.egg-info/top_level.txt +0 -0
  16. {micro_users-1.3.1 → micro_users-1.3.2}/setup.cfg +0 -0
  17. {micro_users-1.3.1 → micro_users-1.3.2}/users/__init__.py +0 -0
  18. {micro_users-1.3.1 → micro_users-1.3.2}/users/admin.py +0 -0
  19. {micro_users-1.3.1 → micro_users-1.3.2}/users/apps.py +0 -0
  20. {micro_users-1.3.1 → micro_users-1.3.2}/users/filters.py +0 -0
  21. {micro_users-1.3.1 → micro_users-1.3.2}/users/forms.py +0 -0
  22. {micro_users-1.3.1 → micro_users-1.3.2}/users/migrations/0001_initial.py +0 -0
  23. {micro_users-1.3.1 → micro_users-1.3.2}/users/migrations/0002_alter_useractivitylog_action.py +0 -0
  24. {micro_users-1.3.1 → micro_users-1.3.2}/users/migrations/__init__.py +0 -0
  25. {micro_users-1.3.1 → micro_users-1.3.2}/users/models.py +0 -0
  26. {micro_users-1.3.1 → micro_users-1.3.2}/users/signals.py +0 -0
  27. {micro_users-1.3.1 → micro_users-1.3.2}/users/static/css/login.css +0 -0
  28. {micro_users-1.3.1 → micro_users-1.3.2}/users/static/img/default_profile.webp +0 -0
  29. {micro_users-1.3.1 → micro_users-1.3.2}/users/templates/registration/login.html +0 -0
  30. {micro_users-1.3.1 → micro_users-1.3.2}/users/templates/user_activity_log.html +0 -0
  31. {micro_users-1.3.1 → micro_users-1.3.2}/users/templates/users/manage_users.html +0 -0
  32. {micro_users-1.3.1 → micro_users-1.3.2}/users/templates/users/profile.html +0 -0
  33. {micro_users-1.3.1 → micro_users-1.3.2}/users/templates/users/profile_edit.html +0 -0
  34. {micro_users-1.3.1 → micro_users-1.3.2}/users/templates/users/user_actions.html +0 -0
  35. {micro_users-1.3.1 → micro_users-1.3.2}/users/templates/users/user_detail.html +0 -0
  36. {micro_users-1.3.1 → micro_users-1.3.2}/users/templates/users/user_form.html +0 -0
  37. {micro_users-1.3.1 → micro_users-1.3.2}/users/urls.py +0 -0
  38. {micro_users-1.3.1 → micro_users-1.3.2}/users/views.py +0 -0
@@ -0,0 +1,282 @@
1
+ Metadata-Version: 2.1
2
+ Name: micro_users
3
+ Version: 1.3.2
4
+ Summary: Arabic Django user management app with abstract user, permissions, and activity logging
5
+ Home-page: https://github.com/debeski/micro-users
6
+ Author: DeBeski
7
+ Author-email: DeBeski <debeski1@gmail.com>
8
+ License: MIT
9
+ Keywords: django,users,permissions,authentication
10
+ Classifier: Framework :: Django
11
+ Classifier: Framework :: Django :: 5
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: License :: OSI Approved :: MIT License
21
+ Classifier: Operating System :: OS Independent
22
+ Requires-Python: >=3.9
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: Django>=5.1
26
+ Requires-Dist: django-crispy-forms>=2.4
27
+ Requires-Dist: django-tables2>=2.7
28
+ Requires-Dist: django-filter>=24.3
29
+ Requires-Dist: pillow>=11.0
30
+ Requires-Dist: babel>=2.1
31
+
32
+ # Micro Users - Arabic Django User Management App
33
+
34
+ [![PyPI version](https://badge.fury.io/py/micro-users.svg)](https://pypi.org/project/micro-users/)
35
+
36
+ **Arabic** lightweight, reusable Django app providing user management with abstract user, permissions, localization, and activity logging.
37
+
38
+ ## Requirements
39
+ - **Must be installed on a fresh database.**
40
+ - Python 3.11+
41
+ - Django 5.1+
42
+ - django-crispy-forms 2.4+
43
+ - django-tables2 2.7+
44
+ - django-filter 24.3+
45
+ - pillow 11.0+
46
+ - babel 2.1+
47
+
48
+ ## Features
49
+ - Custom AbstractUser model
50
+ - User permissions system
51
+ - Activity logging (login/logout, CRUD tracking)
52
+ - Specific User detail and log view *new*
53
+ - Localization support
54
+ - Admin interface integration
55
+ - CRUD views and templates
56
+ - Filtering and tabulation
57
+
58
+ ## Installation
59
+
60
+ ```bash
61
+ pip install git+https://github.com/debeski/micro-users.git
62
+ # OR local
63
+ pip install micro-users
64
+ ```
65
+
66
+ ## Configuration
67
+
68
+ 1. Add to `INSTALLED_APPS`:
69
+ ```python
70
+ INSTALLED_APPS = [
71
+ 'users', # Preferably on top
72
+ 'django.contrib.admin',
73
+ 'django.contrib.auth',
74
+ ...
75
+ ]
76
+ ```
77
+
78
+ 2. Set custom user model in settings.py:
79
+ ```python
80
+ AUTH_USER_MODEL = 'users.CustomUser'
81
+ ```
82
+
83
+ 3. Include URLs in your main project folder `urls.py`:
84
+ ```python
85
+ urlpatterns = [
86
+ ...
87
+ path('manage/', include('users.urls')),
88
+ ]
89
+ ```
90
+
91
+ 4. Run migrations:
92
+ ```bash
93
+ python manage.py migrate users
94
+ ```
95
+
96
+ ## How to Use
97
+
98
+ Once configured, the app automatically handles user management and activity logging. Ensure your project has a `base.html` template in the root templates directory, as all user management templates extend it.
99
+
100
+ ### Activity Logging
101
+
102
+ The app automatically logs **LOGIN** and **LOGOUT** actions. For custom logging of other actions in your application, you can use the following helper functions:
103
+
104
+ #### Available Helper Functions
105
+
106
+ 1. **Get Client IP** - Extract the user's IP address from request:
107
+ ```python
108
+ from users.signals import get_client_ip
109
+
110
+ # Usage in views
111
+ ip_address = get_client_ip(request)
112
+ ```
113
+
114
+ 2. **Log User Action** - Create a reusable logging function:
115
+ ```python
116
+ from django.utils import timezone
117
+ from users.models import UserActivityLog
118
+ from users.signals import get_client_ip
119
+
120
+ def log_user_action(request, instance, action, model_name):
121
+ """
122
+ Logs a user action to the activity log.
123
+
124
+ Args:
125
+ request: HttpRequest object
126
+ instance: The model instance being acted upon
127
+ action: Action type (see ACTION_TYPES below)
128
+ model_name: Name of the model/entity (in Arabic or English)
129
+ """
130
+ UserActivityLog.objects.create(
131
+ user=request.user,
132
+ action=action,
133
+ model_name=model_name,
134
+ object_id=instance.pk,
135
+ number=instance.number if hasattr(instance, 'number') else '',
136
+ timestamp=timezone.now(),
137
+ ip_address=get_client_ip(request),
138
+ user_agent=request.META.get("HTTP_USER_AGENT", ""),
139
+ )
140
+ ```
141
+
142
+ #### Action Types Available
143
+ Use these constants when logging actions:
144
+
145
+ | Action Constant | Arabic Display | Description |
146
+ |-----------------|----------------|-------------|
147
+ | `'LOGIN'` | تسجيل دخـول | User login (auto-logged) |
148
+ | `'LOGOUT'` | تسجيل خـروج | User logout (auto-logged) |
149
+ | `'CREATE'` | انشـاء | Object creation |
150
+ | `'UPDATE'` | تعديـل | Object modification |
151
+ | `'DELETE'` | حــذف | Object deletion |
152
+ | `'VIEW'` | عـرض | Object viewing |
153
+ | `'DOWNLOAD'` | تحميل | File download |
154
+ | `'CONFIRM'` | تأكيـد | Action confirmation |
155
+ | `'REJECT'` | رفــض | Action rejection |
156
+ | `'RESET'` | اعادة ضبط | Password/Data reset |
157
+
158
+ #### Usage Examples
159
+
160
+ 1. **Logging a CREATE action**:
161
+ ```python
162
+ def create_document(request):
163
+ # ... create logic ...
164
+ document = Document.objects.create(...)
165
+
166
+ # Log the action
167
+ from users.models import UserActivityLog
168
+ from users.signals import get_client_ip
169
+
170
+ UserActivityLog.objects.create(
171
+ user=request.user,
172
+ action='CREATE',
173
+ model_name='وثيقة',
174
+ object_id=document.pk,
175
+ number=document.number,
176
+ ip_address=get_client_ip(request),
177
+ user_agent=request.META.get("HTTP_USER_AGENT", ""),
178
+ )
179
+ ```
180
+
181
+ 2. **Using the helper function**:
182
+ ```python
183
+ # Create a helper function in your app
184
+ def log_action(request, instance, action, model_name):
185
+ from users.models import UserActivityLog
186
+ from users.signals import get_client_ip
187
+ from django.utils import timezone
188
+
189
+ UserActivityLog.objects.create(
190
+ user=request.user,
191
+ action=action,
192
+ model_name=model_name,
193
+ object_id=instance.pk,
194
+ number=getattr(instance, 'number', ''),
195
+ timestamp=timezone.now(),
196
+ ip_address=get_client_ip(request),
197
+ user_agent=request.META.get("HTTP_USER_AGENT", ""),
198
+ )
199
+
200
+ # Usage in views
201
+ def update_order(request, order_id):
202
+ order = get_object_or_404(Order, pk=order_id)
203
+ # ... update logic ...
204
+ log_action(request, order, 'UPDATE', 'طلب')
205
+ ```
206
+
207
+ 3. **Logging without an instance** (for general actions):
208
+ ```python
209
+ def log_general_action(request, action, model_name, description=''):
210
+ from users.models import UserActivityLog
211
+ from users.signals import get_client_ip
212
+ from django.utils import timezone
213
+
214
+ UserActivityLog.objects.create(
215
+ user=request.user,
216
+ action=action,
217
+ model_name=model_name,
218
+ object_id=None,
219
+ number=description,
220
+ timestamp=timezone.now(),
221
+ ip_address=get_client_ip(request),
222
+ user_agent=request.META.get("HTTP_USER_AGENT", ""),
223
+ )
224
+
225
+ # Usage
226
+ log_general_action(request, 'CONFIRM', 'نظام', 'تم تأكيد الإعدادات')
227
+ ```
228
+
229
+ ## Available URLs
230
+
231
+ All user management URLs are prefixed with `manage/` as configured. Below is the complete list:
232
+
233
+ | URL Pattern | View/Function | Description |
234
+ |-------------|---------------|-------------|
235
+ | `manage/login/` | `auth_views.LoginView.as_view()` | User login |
236
+ | `manage/logout/` | `auth_views.LogoutView.as_view()` | User logout |
237
+ | `manage/users/` | `views.UserListView.as_view()` | List all users |
238
+ | `manage/users/create/` | `views.create_user` | Create new user |
239
+ | `manage/users/edit/<int:pk>/` | `views.edit_user` | Edit existing user |
240
+ | `manage/users/delete/<int:pk>/` | `views.delete_user` | Delete user |
241
+ | `manage/users/<int:pk>/` | `views.UserDetailView.as_view()` | View user details |
242
+ | `manage/profile` | `views.user_profile` | View current user profile |
243
+ | `manage/profile/edit/` | `views.edit_profile` | Edit current profile |
244
+ | `manage/logs/` | `views.UserActivityLogView.as_view()` | View activity logs |
245
+ | `manage/reset_password/<int:pk>/` | `views.reset_password` | Reset user password |
246
+
247
+ ## Structure
248
+ ```
249
+ users/
250
+ ├── views.py # CRUD operations
251
+ ├── urls.py # URL routing
252
+ ├── tables.py # User and Activity Log tables
253
+ ├── signals.py # Logging signals
254
+ ├── models.py # User model, permissions, activity logs
255
+ ├── forms.py # Creation, edit,. etc.
256
+ ├── filter.py # Search filters
257
+ ├── apps.py # Permissions Localization
258
+ ├── admin.py # Admin UI integration
259
+ ├── __init__.py # Python init
260
+ ├── templates/ # HTML templates
261
+ ├── static/ # CSS classes
262
+ └── migrations/ # Database migrations
263
+ ```
264
+
265
+ ## Version History
266
+
267
+ | Version | Changes |
268
+ |----------|---------|
269
+ | v1.0.0 | • Initial release as pip package |
270
+ | v1.0.1 | • Fixed a couple of new issues as a pip package |
271
+ | v1.0.2 | • Fixed the readme and building files |
272
+ | v1.0.3 | • Still getting the hang of this pip publish thing |
273
+ | v1.0.4 | • Honestly still messing with and trying settings and stuff out |
274
+ | v1.1.0 | • OK, finally a working seamless micro-users app |
275
+ | v1.1.1 | • Fixed an expolit where a staff member could disable the ADMIN user |
276
+ | v1.2.0 | • Added User Details view with specific user activity log |
277
+ | v1.2.1 | • Fixed a minor import bug |
278
+ | v1.2.3 | • Separated user detail view from table for consistency<br> • Optimized the new detail + log view for optimal compatibiliyy with users |
279
+ | v1.2.4 | • Fixed a couple of visual inconsistencies |
280
+ | v1.3.0 | • Patched a critical security permission issue<br> • Disabled ADMIN from being viewed/edited from all other members<br> • Fixed a crash when sorting with full_name<br> • Enabled Logging for all actions |
281
+ | v1.3.1 | • Corrected a misplaced code that caused a crash when editing profile |
282
+ | v1.3.2 | • Minor table modifications |
@@ -0,0 +1,251 @@
1
+ # Micro Users - Arabic Django User Management App
2
+
3
+ [![PyPI version](https://badge.fury.io/py/micro-users.svg)](https://pypi.org/project/micro-users/)
4
+
5
+ **Arabic** lightweight, reusable Django app providing user management with abstract user, permissions, localization, and activity logging.
6
+
7
+ ## Requirements
8
+ - **Must be installed on a fresh database.**
9
+ - Python 3.11+
10
+ - Django 5.1+
11
+ - django-crispy-forms 2.4+
12
+ - django-tables2 2.7+
13
+ - django-filter 24.3+
14
+ - pillow 11.0+
15
+ - babel 2.1+
16
+
17
+ ## Features
18
+ - Custom AbstractUser model
19
+ - User permissions system
20
+ - Activity logging (login/logout, CRUD tracking)
21
+ - Specific User detail and log view *new*
22
+ - Localization support
23
+ - Admin interface integration
24
+ - CRUD views and templates
25
+ - Filtering and tabulation
26
+
27
+ ## Installation
28
+
29
+ ```bash
30
+ pip install git+https://github.com/debeski/micro-users.git
31
+ # OR local
32
+ pip install micro-users
33
+ ```
34
+
35
+ ## Configuration
36
+
37
+ 1. Add to `INSTALLED_APPS`:
38
+ ```python
39
+ INSTALLED_APPS = [
40
+ 'users', # Preferably on top
41
+ 'django.contrib.admin',
42
+ 'django.contrib.auth',
43
+ ...
44
+ ]
45
+ ```
46
+
47
+ 2. Set custom user model in settings.py:
48
+ ```python
49
+ AUTH_USER_MODEL = 'users.CustomUser'
50
+ ```
51
+
52
+ 3. Include URLs in your main project folder `urls.py`:
53
+ ```python
54
+ urlpatterns = [
55
+ ...
56
+ path('manage/', include('users.urls')),
57
+ ]
58
+ ```
59
+
60
+ 4. Run migrations:
61
+ ```bash
62
+ python manage.py migrate users
63
+ ```
64
+
65
+ ## How to Use
66
+
67
+ Once configured, the app automatically handles user management and activity logging. Ensure your project has a `base.html` template in the root templates directory, as all user management templates extend it.
68
+
69
+ ### Activity Logging
70
+
71
+ The app automatically logs **LOGIN** and **LOGOUT** actions. For custom logging of other actions in your application, you can use the following helper functions:
72
+
73
+ #### Available Helper Functions
74
+
75
+ 1. **Get Client IP** - Extract the user's IP address from request:
76
+ ```python
77
+ from users.signals import get_client_ip
78
+
79
+ # Usage in views
80
+ ip_address = get_client_ip(request)
81
+ ```
82
+
83
+ 2. **Log User Action** - Create a reusable logging function:
84
+ ```python
85
+ from django.utils import timezone
86
+ from users.models import UserActivityLog
87
+ from users.signals import get_client_ip
88
+
89
+ def log_user_action(request, instance, action, model_name):
90
+ """
91
+ Logs a user action to the activity log.
92
+
93
+ Args:
94
+ request: HttpRequest object
95
+ instance: The model instance being acted upon
96
+ action: Action type (see ACTION_TYPES below)
97
+ model_name: Name of the model/entity (in Arabic or English)
98
+ """
99
+ UserActivityLog.objects.create(
100
+ user=request.user,
101
+ action=action,
102
+ model_name=model_name,
103
+ object_id=instance.pk,
104
+ number=instance.number if hasattr(instance, 'number') else '',
105
+ timestamp=timezone.now(),
106
+ ip_address=get_client_ip(request),
107
+ user_agent=request.META.get("HTTP_USER_AGENT", ""),
108
+ )
109
+ ```
110
+
111
+ #### Action Types Available
112
+ Use these constants when logging actions:
113
+
114
+ | Action Constant | Arabic Display | Description |
115
+ |-----------------|----------------|-------------|
116
+ | `'LOGIN'` | تسجيل دخـول | User login (auto-logged) |
117
+ | `'LOGOUT'` | تسجيل خـروج | User logout (auto-logged) |
118
+ | `'CREATE'` | انشـاء | Object creation |
119
+ | `'UPDATE'` | تعديـل | Object modification |
120
+ | `'DELETE'` | حــذف | Object deletion |
121
+ | `'VIEW'` | عـرض | Object viewing |
122
+ | `'DOWNLOAD'` | تحميل | File download |
123
+ | `'CONFIRM'` | تأكيـد | Action confirmation |
124
+ | `'REJECT'` | رفــض | Action rejection |
125
+ | `'RESET'` | اعادة ضبط | Password/Data reset |
126
+
127
+ #### Usage Examples
128
+
129
+ 1. **Logging a CREATE action**:
130
+ ```python
131
+ def create_document(request):
132
+ # ... create logic ...
133
+ document = Document.objects.create(...)
134
+
135
+ # Log the action
136
+ from users.models import UserActivityLog
137
+ from users.signals import get_client_ip
138
+
139
+ UserActivityLog.objects.create(
140
+ user=request.user,
141
+ action='CREATE',
142
+ model_name='وثيقة',
143
+ object_id=document.pk,
144
+ number=document.number,
145
+ ip_address=get_client_ip(request),
146
+ user_agent=request.META.get("HTTP_USER_AGENT", ""),
147
+ )
148
+ ```
149
+
150
+ 2. **Using the helper function**:
151
+ ```python
152
+ # Create a helper function in your app
153
+ def log_action(request, instance, action, model_name):
154
+ from users.models import UserActivityLog
155
+ from users.signals import get_client_ip
156
+ from django.utils import timezone
157
+
158
+ UserActivityLog.objects.create(
159
+ user=request.user,
160
+ action=action,
161
+ model_name=model_name,
162
+ object_id=instance.pk,
163
+ number=getattr(instance, 'number', ''),
164
+ timestamp=timezone.now(),
165
+ ip_address=get_client_ip(request),
166
+ user_agent=request.META.get("HTTP_USER_AGENT", ""),
167
+ )
168
+
169
+ # Usage in views
170
+ def update_order(request, order_id):
171
+ order = get_object_or_404(Order, pk=order_id)
172
+ # ... update logic ...
173
+ log_action(request, order, 'UPDATE', 'طلب')
174
+ ```
175
+
176
+ 3. **Logging without an instance** (for general actions):
177
+ ```python
178
+ def log_general_action(request, action, model_name, description=''):
179
+ from users.models import UserActivityLog
180
+ from users.signals import get_client_ip
181
+ from django.utils import timezone
182
+
183
+ UserActivityLog.objects.create(
184
+ user=request.user,
185
+ action=action,
186
+ model_name=model_name,
187
+ object_id=None,
188
+ number=description,
189
+ timestamp=timezone.now(),
190
+ ip_address=get_client_ip(request),
191
+ user_agent=request.META.get("HTTP_USER_AGENT", ""),
192
+ )
193
+
194
+ # Usage
195
+ log_general_action(request, 'CONFIRM', 'نظام', 'تم تأكيد الإعدادات')
196
+ ```
197
+
198
+ ## Available URLs
199
+
200
+ All user management URLs are prefixed with `manage/` as configured. Below is the complete list:
201
+
202
+ | URL Pattern | View/Function | Description |
203
+ |-------------|---------------|-------------|
204
+ | `manage/login/` | `auth_views.LoginView.as_view()` | User login |
205
+ | `manage/logout/` | `auth_views.LogoutView.as_view()` | User logout |
206
+ | `manage/users/` | `views.UserListView.as_view()` | List all users |
207
+ | `manage/users/create/` | `views.create_user` | Create new user |
208
+ | `manage/users/edit/<int:pk>/` | `views.edit_user` | Edit existing user |
209
+ | `manage/users/delete/<int:pk>/` | `views.delete_user` | Delete user |
210
+ | `manage/users/<int:pk>/` | `views.UserDetailView.as_view()` | View user details |
211
+ | `manage/profile` | `views.user_profile` | View current user profile |
212
+ | `manage/profile/edit/` | `views.edit_profile` | Edit current profile |
213
+ | `manage/logs/` | `views.UserActivityLogView.as_view()` | View activity logs |
214
+ | `manage/reset_password/<int:pk>/` | `views.reset_password` | Reset user password |
215
+
216
+ ## Structure
217
+ ```
218
+ users/
219
+ ├── views.py # CRUD operations
220
+ ├── urls.py # URL routing
221
+ ├── tables.py # User and Activity Log tables
222
+ ├── signals.py # Logging signals
223
+ ├── models.py # User model, permissions, activity logs
224
+ ├── forms.py # Creation, edit,. etc.
225
+ ├── filter.py # Search filters
226
+ ├── apps.py # Permissions Localization
227
+ ├── admin.py # Admin UI integration
228
+ ├── __init__.py # Python init
229
+ ├── templates/ # HTML templates
230
+ ├── static/ # CSS classes
231
+ └── migrations/ # Database migrations
232
+ ```
233
+
234
+ ## Version History
235
+
236
+ | Version | Changes |
237
+ |----------|---------|
238
+ | v1.0.0 | • Initial release as pip package |
239
+ | v1.0.1 | • Fixed a couple of new issues as a pip package |
240
+ | v1.0.2 | • Fixed the readme and building files |
241
+ | v1.0.3 | • Still getting the hang of this pip publish thing |
242
+ | v1.0.4 | • Honestly still messing with and trying settings and stuff out |
243
+ | v1.1.0 | • OK, finally a working seamless micro-users app |
244
+ | v1.1.1 | • Fixed an expolit where a staff member could disable the ADMIN user |
245
+ | v1.2.0 | • Added User Details view with specific user activity log |
246
+ | v1.2.1 | • Fixed a minor import bug |
247
+ | v1.2.3 | • Separated user detail view from table for consistency<br> • Optimized the new detail + log view for optimal compatibiliyy with users |
248
+ | v1.2.4 | • Fixed a couple of visual inconsistencies |
249
+ | v1.3.0 | • Patched a critical security permission issue<br> • Disabled ADMIN from being viewed/edited from all other members<br> • Fixed a crash when sorting with full_name<br> • Enabled Logging for all actions |
250
+ | v1.3.1 | • Corrected a misplaced code that caused a crash when editing profile |
251
+ | v1.3.2 | • Minor table modifications |
@@ -0,0 +1,282 @@
1
+ Metadata-Version: 2.1
2
+ Name: micro-users
3
+ Version: 1.3.2
4
+ Summary: Arabic Django user management app with abstract user, permissions, and activity logging
5
+ Home-page: https://github.com/debeski/micro-users
6
+ Author: DeBeski
7
+ Author-email: DeBeski <debeski1@gmail.com>
8
+ License: MIT
9
+ Keywords: django,users,permissions,authentication
10
+ Classifier: Framework :: Django
11
+ Classifier: Framework :: Django :: 5
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: License :: OSI Approved :: MIT License
21
+ Classifier: Operating System :: OS Independent
22
+ Requires-Python: >=3.9
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: Django>=5.1
26
+ Requires-Dist: django-crispy-forms>=2.4
27
+ Requires-Dist: django-tables2>=2.7
28
+ Requires-Dist: django-filter>=24.3
29
+ Requires-Dist: pillow>=11.0
30
+ Requires-Dist: babel>=2.1
31
+
32
+ # Micro Users - Arabic Django User Management App
33
+
34
+ [![PyPI version](https://badge.fury.io/py/micro-users.svg)](https://pypi.org/project/micro-users/)
35
+
36
+ **Arabic** lightweight, reusable Django app providing user management with abstract user, permissions, localization, and activity logging.
37
+
38
+ ## Requirements
39
+ - **Must be installed on a fresh database.**
40
+ - Python 3.11+
41
+ - Django 5.1+
42
+ - django-crispy-forms 2.4+
43
+ - django-tables2 2.7+
44
+ - django-filter 24.3+
45
+ - pillow 11.0+
46
+ - babel 2.1+
47
+
48
+ ## Features
49
+ - Custom AbstractUser model
50
+ - User permissions system
51
+ - Activity logging (login/logout, CRUD tracking)
52
+ - Specific User detail and log view *new*
53
+ - Localization support
54
+ - Admin interface integration
55
+ - CRUD views and templates
56
+ - Filtering and tabulation
57
+
58
+ ## Installation
59
+
60
+ ```bash
61
+ pip install git+https://github.com/debeski/micro-users.git
62
+ # OR local
63
+ pip install micro-users
64
+ ```
65
+
66
+ ## Configuration
67
+
68
+ 1. Add to `INSTALLED_APPS`:
69
+ ```python
70
+ INSTALLED_APPS = [
71
+ 'users', # Preferably on top
72
+ 'django.contrib.admin',
73
+ 'django.contrib.auth',
74
+ ...
75
+ ]
76
+ ```
77
+
78
+ 2. Set custom user model in settings.py:
79
+ ```python
80
+ AUTH_USER_MODEL = 'users.CustomUser'
81
+ ```
82
+
83
+ 3. Include URLs in your main project folder `urls.py`:
84
+ ```python
85
+ urlpatterns = [
86
+ ...
87
+ path('manage/', include('users.urls')),
88
+ ]
89
+ ```
90
+
91
+ 4. Run migrations:
92
+ ```bash
93
+ python manage.py migrate users
94
+ ```
95
+
96
+ ## How to Use
97
+
98
+ Once configured, the app automatically handles user management and activity logging. Ensure your project has a `base.html` template in the root templates directory, as all user management templates extend it.
99
+
100
+ ### Activity Logging
101
+
102
+ The app automatically logs **LOGIN** and **LOGOUT** actions. For custom logging of other actions in your application, you can use the following helper functions:
103
+
104
+ #### Available Helper Functions
105
+
106
+ 1. **Get Client IP** - Extract the user's IP address from request:
107
+ ```python
108
+ from users.signals import get_client_ip
109
+
110
+ # Usage in views
111
+ ip_address = get_client_ip(request)
112
+ ```
113
+
114
+ 2. **Log User Action** - Create a reusable logging function:
115
+ ```python
116
+ from django.utils import timezone
117
+ from users.models import UserActivityLog
118
+ from users.signals import get_client_ip
119
+
120
+ def log_user_action(request, instance, action, model_name):
121
+ """
122
+ Logs a user action to the activity log.
123
+
124
+ Args:
125
+ request: HttpRequest object
126
+ instance: The model instance being acted upon
127
+ action: Action type (see ACTION_TYPES below)
128
+ model_name: Name of the model/entity (in Arabic or English)
129
+ """
130
+ UserActivityLog.objects.create(
131
+ user=request.user,
132
+ action=action,
133
+ model_name=model_name,
134
+ object_id=instance.pk,
135
+ number=instance.number if hasattr(instance, 'number') else '',
136
+ timestamp=timezone.now(),
137
+ ip_address=get_client_ip(request),
138
+ user_agent=request.META.get("HTTP_USER_AGENT", ""),
139
+ )
140
+ ```
141
+
142
+ #### Action Types Available
143
+ Use these constants when logging actions:
144
+
145
+ | Action Constant | Arabic Display | Description |
146
+ |-----------------|----------------|-------------|
147
+ | `'LOGIN'` | تسجيل دخـول | User login (auto-logged) |
148
+ | `'LOGOUT'` | تسجيل خـروج | User logout (auto-logged) |
149
+ | `'CREATE'` | انشـاء | Object creation |
150
+ | `'UPDATE'` | تعديـل | Object modification |
151
+ | `'DELETE'` | حــذف | Object deletion |
152
+ | `'VIEW'` | عـرض | Object viewing |
153
+ | `'DOWNLOAD'` | تحميل | File download |
154
+ | `'CONFIRM'` | تأكيـد | Action confirmation |
155
+ | `'REJECT'` | رفــض | Action rejection |
156
+ | `'RESET'` | اعادة ضبط | Password/Data reset |
157
+
158
+ #### Usage Examples
159
+
160
+ 1. **Logging a CREATE action**:
161
+ ```python
162
+ def create_document(request):
163
+ # ... create logic ...
164
+ document = Document.objects.create(...)
165
+
166
+ # Log the action
167
+ from users.models import UserActivityLog
168
+ from users.signals import get_client_ip
169
+
170
+ UserActivityLog.objects.create(
171
+ user=request.user,
172
+ action='CREATE',
173
+ model_name='وثيقة',
174
+ object_id=document.pk,
175
+ number=document.number,
176
+ ip_address=get_client_ip(request),
177
+ user_agent=request.META.get("HTTP_USER_AGENT", ""),
178
+ )
179
+ ```
180
+
181
+ 2. **Using the helper function**:
182
+ ```python
183
+ # Create a helper function in your app
184
+ def log_action(request, instance, action, model_name):
185
+ from users.models import UserActivityLog
186
+ from users.signals import get_client_ip
187
+ from django.utils import timezone
188
+
189
+ UserActivityLog.objects.create(
190
+ user=request.user,
191
+ action=action,
192
+ model_name=model_name,
193
+ object_id=instance.pk,
194
+ number=getattr(instance, 'number', ''),
195
+ timestamp=timezone.now(),
196
+ ip_address=get_client_ip(request),
197
+ user_agent=request.META.get("HTTP_USER_AGENT", ""),
198
+ )
199
+
200
+ # Usage in views
201
+ def update_order(request, order_id):
202
+ order = get_object_or_404(Order, pk=order_id)
203
+ # ... update logic ...
204
+ log_action(request, order, 'UPDATE', 'طلب')
205
+ ```
206
+
207
+ 3. **Logging without an instance** (for general actions):
208
+ ```python
209
+ def log_general_action(request, action, model_name, description=''):
210
+ from users.models import UserActivityLog
211
+ from users.signals import get_client_ip
212
+ from django.utils import timezone
213
+
214
+ UserActivityLog.objects.create(
215
+ user=request.user,
216
+ action=action,
217
+ model_name=model_name,
218
+ object_id=None,
219
+ number=description,
220
+ timestamp=timezone.now(),
221
+ ip_address=get_client_ip(request),
222
+ user_agent=request.META.get("HTTP_USER_AGENT", ""),
223
+ )
224
+
225
+ # Usage
226
+ log_general_action(request, 'CONFIRM', 'نظام', 'تم تأكيد الإعدادات')
227
+ ```
228
+
229
+ ## Available URLs
230
+
231
+ All user management URLs are prefixed with `manage/` as configured. Below is the complete list:
232
+
233
+ | URL Pattern | View/Function | Description |
234
+ |-------------|---------------|-------------|
235
+ | `manage/login/` | `auth_views.LoginView.as_view()` | User login |
236
+ | `manage/logout/` | `auth_views.LogoutView.as_view()` | User logout |
237
+ | `manage/users/` | `views.UserListView.as_view()` | List all users |
238
+ | `manage/users/create/` | `views.create_user` | Create new user |
239
+ | `manage/users/edit/<int:pk>/` | `views.edit_user` | Edit existing user |
240
+ | `manage/users/delete/<int:pk>/` | `views.delete_user` | Delete user |
241
+ | `manage/users/<int:pk>/` | `views.UserDetailView.as_view()` | View user details |
242
+ | `manage/profile` | `views.user_profile` | View current user profile |
243
+ | `manage/profile/edit/` | `views.edit_profile` | Edit current profile |
244
+ | `manage/logs/` | `views.UserActivityLogView.as_view()` | View activity logs |
245
+ | `manage/reset_password/<int:pk>/` | `views.reset_password` | Reset user password |
246
+
247
+ ## Structure
248
+ ```
249
+ users/
250
+ ├── views.py # CRUD operations
251
+ ├── urls.py # URL routing
252
+ ├── tables.py # User and Activity Log tables
253
+ ├── signals.py # Logging signals
254
+ ├── models.py # User model, permissions, activity logs
255
+ ├── forms.py # Creation, edit,. etc.
256
+ ├── filter.py # Search filters
257
+ ├── apps.py # Permissions Localization
258
+ ├── admin.py # Admin UI integration
259
+ ├── __init__.py # Python init
260
+ ├── templates/ # HTML templates
261
+ ├── static/ # CSS classes
262
+ └── migrations/ # Database migrations
263
+ ```
264
+
265
+ ## Version History
266
+
267
+ | Version | Changes |
268
+ |----------|---------|
269
+ | v1.0.0 | • Initial release as pip package |
270
+ | v1.0.1 | • Fixed a couple of new issues as a pip package |
271
+ | v1.0.2 | • Fixed the readme and building files |
272
+ | v1.0.3 | • Still getting the hang of this pip publish thing |
273
+ | v1.0.4 | • Honestly still messing with and trying settings and stuff out |
274
+ | v1.1.0 | • OK, finally a working seamless micro-users app |
275
+ | v1.1.1 | • Fixed an expolit where a staff member could disable the ADMIN user |
276
+ | v1.2.0 | • Added User Details view with specific user activity log |
277
+ | v1.2.1 | • Fixed a minor import bug |
278
+ | v1.2.3 | • Separated user detail view from table for consistency<br> • Optimized the new detail + log view for optimal compatibiliyy with users |
279
+ | v1.2.4 | • Fixed a couple of visual inconsistencies |
280
+ | v1.3.0 | • Patched a critical security permission issue<br> • Disabled ADMIN from being viewed/edited from all other members<br> • Fixed a crash when sorting with full_name<br> • Enabled Logging for all actions |
281
+ | v1.3.1 | • Corrected a misplaced code that caused a crash when editing profile |
282
+ | v1.3.2 | • Minor table modifications |
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
8
8
 
9
9
  [project]
10
10
  name = "micro_users"
11
- version = "1.3.1"
11
+ version = "1.3.2"
12
12
  description = "Arabic Django user management app with abstract user, permissions, and activity logging"
13
13
  readme = "README.md"
14
14
  requires-python = ">=3.11"
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="micro_users",
8
- version="1.3.1",
8
+ version="1.3.2",
9
9
  author="DeBeski",
10
10
  author_email="debeski1@gmail.com",
11
11
  description="Arabic django user management app with abstract user, permissions, and activity logging",
@@ -1,5 +1,3 @@
1
- # Imports of the required python modules and libraries
2
- ######################################################
3
1
  import django_tables2 as tables
4
2
  from django.contrib.auth import get_user_model
5
3
  from .models import UserActivityLog
@@ -9,7 +7,11 @@ User = get_user_model() # Use custom user model
9
7
  class UserTable(tables.Table):
10
8
  username = tables.Column(verbose_name="اسم المستخدم")
11
9
  email = tables.Column(verbose_name="البريد الالكتروني")
12
- full_name = tables.Column(verbose_name="الاسم بالكامل", orderable=False,)
10
+ full_name = tables.Column(
11
+ verbose_name="الاسم الكامل",
12
+ accessor='user.full_name',
13
+ order_by='user__first_name'
14
+ )
13
15
  is_staff = tables.BooleanColumn(verbose_name="مسؤول")
14
16
  is_active = tables.BooleanColumn(verbose_name="نشط")
15
17
  last_login = tables.DateColumn(
@@ -22,7 +24,6 @@ class UserTable(tables.Table):
22
24
  orderable=False,
23
25
  verbose_name=''
24
26
  )
25
-
26
27
  class Meta:
27
28
  model = User
28
29
  template_name = "django_tables2/bootstrap5.html"
@@ -30,13 +31,12 @@ class UserTable(tables.Table):
30
31
  attrs = {'class': 'table table-hover align-middle'}
31
32
 
32
33
  class UserActivityLogTable(tables.Table):
33
- user = tables.Column(verbose_name="اسم الدخول")
34
34
  timestamp = tables.DateColumn(
35
35
  format="H:i Y-m-d ", # This is the format you want for the timestamp
36
36
  verbose_name="وقت العملية"
37
37
  )
38
38
  full_name = tables.Column(
39
- verbose_name="الاسم بالكامل",
39
+ verbose_name="الاسم الكامل",
40
40
  accessor='user.full_name',
41
41
  order_by='user__first_name'
42
42
  )
@@ -1,133 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: micro_users
3
- Version: 1.3.1
4
- Summary: Arabic Django user management app with abstract user, permissions, and activity logging
5
- Home-page: https://github.com/debeski/micro-users
6
- Author: DeBeski
7
- Author-email: DeBeski <debeski1@gmail.com>
8
- License: MIT
9
- Keywords: django,users,permissions,authentication
10
- Classifier: Framework :: Django
11
- Classifier: Framework :: Django :: 5
12
- Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.8
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
- Classifier: Programming Language :: Python :: 3.13
19
- Classifier: Programming Language :: Python :: 3.14
20
- Classifier: License :: OSI Approved :: MIT License
21
- Classifier: Operating System :: OS Independent
22
- Requires-Python: >=3.9
23
- Description-Content-Type: text/markdown
24
- License-File: LICENSE
25
- Requires-Dist: Django>=5.1
26
- Requires-Dist: django-crispy-forms>=2.4
27
- Requires-Dist: django-tables2>=2.7
28
- Requires-Dist: django-filter>=24.3
29
- Requires-Dist: pillow>=11.0
30
- Requires-Dist: babel>=2.1
31
-
32
- # Micro Users - Arabic Django User Management App
33
-
34
- [![PyPI version](https://badge.fury.io/py/micro-users.svg)](https://pypi.org/project/micro-users/)
35
-
36
- **Arabic** lightweight, reusable Django app providing user management with abstract user, permissions, localization, and activity logging.
37
-
38
-
39
- ## Requirements
40
- - **Must be installed on a fresh database.**
41
- - Python 3.11+
42
- - Django 5.1+
43
- - django-crispy-forms 2.4+
44
- - django-tables2 2.7+
45
- - django-filter 24.3+
46
- - pillow 11.0+
47
- - babel 2.1+
48
-
49
-
50
- ## Features
51
- - Custom AbstractUser model
52
- - User permissions system
53
- - Activity logging (login/logout, CRUD tracking)
54
- - Specific User detail and log view *new*
55
- - Localization support
56
- - Admin interface integration
57
- - CRUD views and templates
58
- - Filtering and tabulation
59
-
60
- ## Installation
61
-
62
- ```bash
63
- pip install git+https://github.com/debeski/micro-users.git
64
- # OR local
65
- pip install micro-users
66
- ```
67
-
68
- ## Configuration
69
-
70
- 1. Add to `INSTALLED_APPS`:
71
- ```python
72
- INSTALLED_APPS = [
73
- 'users', # Preferably on top
74
- 'django.contrib.admin',
75
- 'django.contrib.auth',
76
- ...
77
- ]
78
- ```
79
-
80
- 2. Set custom user model in settings.py:
81
- ```python
82
- AUTH_USER_MODEL = 'users.CustomUser'
83
- ```
84
-
85
- 3. Include URLs in your main project folder `urls.py`:
86
- ```python
87
- urlpatterns = [
88
- ...
89
- path('manage/', include('users.urls')),
90
- ]
91
- ```
92
-
93
- 4. Run migrations:
94
- ```bash
95
- python manage.py migrate users
96
- ```
97
-
98
-
99
- ## Structure
100
- ```
101
- users/
102
- ├── views.py # CRUD operations
103
- ├── urls.py # URL routing
104
- ├── tables.py # User and Activity Log tables
105
- ├── signals.py # Logging signals
106
- ├── models.py # User model, permissions, activity logs
107
- ├── forms.py # Creation, edit,. etc.
108
- ├── filter.py # Search filters
109
- ├── apps.py # Permissions Localization
110
- ├── admin.py # Admin UI integration
111
- ├── __init__.py # Python init
112
- ├── templates/ # HTML templates
113
- ├── static/ # CSS classes
114
- └── migrations/ # Database migrations
115
- ```
116
-
117
- ## Version History
118
-
119
- | Version | Changes |
120
- |----------|---------|
121
- | v1.0.0 | • Initial release as pip package |
122
- | v1.0.1 | • Fixed a couple of new issues as a pip package |
123
- | v1.0.2 | • Fixed the readme and building files |
124
- | v1.0.3 | • Still getting the hang of this pip publish thing |
125
- | v1.0.4 | • Honestly still messing with and trying settings and stuff out |
126
- | v1.1.0 | • OK, finally a working seamless micro-users app |
127
- | v1.1.1 | • Fixed a bug where a staff member can edit the admin details |
128
- | v1.2.0 | • Added User Details view with specific user activity log |
129
- | v1.2.1 | • Fixed a minor import bug |
130
- | v1.2.3 | • Separated user detail view from table for consistency<br> • Optimized the new detail + log view for optimal compatibiliyy with users |
131
- | v1.2.4 | • Fixed a couple of visual inconsistencies |
132
- | v1.3.0 | • Patched a critical security permission issue<br> • Disabled ADMIN from being viewed/edited from other staff members<br> • Fixed an issue when sorting with full_name<br> • Enabled Logging for all actions |
133
- | v1.3.1 | • replaced a misplaced code that caused a crash when editing profile |
@@ -1,102 +0,0 @@
1
- # Micro Users - Arabic Django User Management App
2
-
3
- [![PyPI version](https://badge.fury.io/py/micro-users.svg)](https://pypi.org/project/micro-users/)
4
-
5
- **Arabic** lightweight, reusable Django app providing user management with abstract user, permissions, localization, and activity logging.
6
-
7
-
8
- ## Requirements
9
- - **Must be installed on a fresh database.**
10
- - Python 3.11+
11
- - Django 5.1+
12
- - django-crispy-forms 2.4+
13
- - django-tables2 2.7+
14
- - django-filter 24.3+
15
- - pillow 11.0+
16
- - babel 2.1+
17
-
18
-
19
- ## Features
20
- - Custom AbstractUser model
21
- - User permissions system
22
- - Activity logging (login/logout, CRUD tracking)
23
- - Specific User detail and log view *new*
24
- - Localization support
25
- - Admin interface integration
26
- - CRUD views and templates
27
- - Filtering and tabulation
28
-
29
- ## Installation
30
-
31
- ```bash
32
- pip install git+https://github.com/debeski/micro-users.git
33
- # OR local
34
- pip install micro-users
35
- ```
36
-
37
- ## Configuration
38
-
39
- 1. Add to `INSTALLED_APPS`:
40
- ```python
41
- INSTALLED_APPS = [
42
- 'users', # Preferably on top
43
- 'django.contrib.admin',
44
- 'django.contrib.auth',
45
- ...
46
- ]
47
- ```
48
-
49
- 2. Set custom user model in settings.py:
50
- ```python
51
- AUTH_USER_MODEL = 'users.CustomUser'
52
- ```
53
-
54
- 3. Include URLs in your main project folder `urls.py`:
55
- ```python
56
- urlpatterns = [
57
- ...
58
- path('manage/', include('users.urls')),
59
- ]
60
- ```
61
-
62
- 4. Run migrations:
63
- ```bash
64
- python manage.py migrate users
65
- ```
66
-
67
-
68
- ## Structure
69
- ```
70
- users/
71
- ├── views.py # CRUD operations
72
- ├── urls.py # URL routing
73
- ├── tables.py # User and Activity Log tables
74
- ├── signals.py # Logging signals
75
- ├── models.py # User model, permissions, activity logs
76
- ├── forms.py # Creation, edit,. etc.
77
- ├── filter.py # Search filters
78
- ├── apps.py # Permissions Localization
79
- ├── admin.py # Admin UI integration
80
- ├── __init__.py # Python init
81
- ├── templates/ # HTML templates
82
- ├── static/ # CSS classes
83
- └── migrations/ # Database migrations
84
- ```
85
-
86
- ## Version History
87
-
88
- | Version | Changes |
89
- |----------|---------|
90
- | v1.0.0 | • Initial release as pip package |
91
- | v1.0.1 | • Fixed a couple of new issues as a pip package |
92
- | v1.0.2 | • Fixed the readme and building files |
93
- | v1.0.3 | • Still getting the hang of this pip publish thing |
94
- | v1.0.4 | • Honestly still messing with and trying settings and stuff out |
95
- | v1.1.0 | • OK, finally a working seamless micro-users app |
96
- | v1.1.1 | • Fixed a bug where a staff member can edit the admin details |
97
- | v1.2.0 | • Added User Details view with specific user activity log |
98
- | v1.2.1 | • Fixed a minor import bug |
99
- | v1.2.3 | • Separated user detail view from table for consistency<br> • Optimized the new detail + log view for optimal compatibiliyy with users |
100
- | v1.2.4 | • Fixed a couple of visual inconsistencies |
101
- | v1.3.0 | • Patched a critical security permission issue<br> • Disabled ADMIN from being viewed/edited from other staff members<br> • Fixed an issue when sorting with full_name<br> • Enabled Logging for all actions |
102
- | v1.3.1 | • replaced a misplaced code that caused a crash when editing profile |
@@ -1,133 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: micro-users
3
- Version: 1.3.1
4
- Summary: Arabic Django user management app with abstract user, permissions, and activity logging
5
- Home-page: https://github.com/debeski/micro-users
6
- Author: DeBeski
7
- Author-email: DeBeski <debeski1@gmail.com>
8
- License: MIT
9
- Keywords: django,users,permissions,authentication
10
- Classifier: Framework :: Django
11
- Classifier: Framework :: Django :: 5
12
- Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.8
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
- Classifier: Programming Language :: Python :: 3.13
19
- Classifier: Programming Language :: Python :: 3.14
20
- Classifier: License :: OSI Approved :: MIT License
21
- Classifier: Operating System :: OS Independent
22
- Requires-Python: >=3.9
23
- Description-Content-Type: text/markdown
24
- License-File: LICENSE
25
- Requires-Dist: Django>=5.1
26
- Requires-Dist: django-crispy-forms>=2.4
27
- Requires-Dist: django-tables2>=2.7
28
- Requires-Dist: django-filter>=24.3
29
- Requires-Dist: pillow>=11.0
30
- Requires-Dist: babel>=2.1
31
-
32
- # Micro Users - Arabic Django User Management App
33
-
34
- [![PyPI version](https://badge.fury.io/py/micro-users.svg)](https://pypi.org/project/micro-users/)
35
-
36
- **Arabic** lightweight, reusable Django app providing user management with abstract user, permissions, localization, and activity logging.
37
-
38
-
39
- ## Requirements
40
- - **Must be installed on a fresh database.**
41
- - Python 3.11+
42
- - Django 5.1+
43
- - django-crispy-forms 2.4+
44
- - django-tables2 2.7+
45
- - django-filter 24.3+
46
- - pillow 11.0+
47
- - babel 2.1+
48
-
49
-
50
- ## Features
51
- - Custom AbstractUser model
52
- - User permissions system
53
- - Activity logging (login/logout, CRUD tracking)
54
- - Specific User detail and log view *new*
55
- - Localization support
56
- - Admin interface integration
57
- - CRUD views and templates
58
- - Filtering and tabulation
59
-
60
- ## Installation
61
-
62
- ```bash
63
- pip install git+https://github.com/debeski/micro-users.git
64
- # OR local
65
- pip install micro-users
66
- ```
67
-
68
- ## Configuration
69
-
70
- 1. Add to `INSTALLED_APPS`:
71
- ```python
72
- INSTALLED_APPS = [
73
- 'users', # Preferably on top
74
- 'django.contrib.admin',
75
- 'django.contrib.auth',
76
- ...
77
- ]
78
- ```
79
-
80
- 2. Set custom user model in settings.py:
81
- ```python
82
- AUTH_USER_MODEL = 'users.CustomUser'
83
- ```
84
-
85
- 3. Include URLs in your main project folder `urls.py`:
86
- ```python
87
- urlpatterns = [
88
- ...
89
- path('manage/', include('users.urls')),
90
- ]
91
- ```
92
-
93
- 4. Run migrations:
94
- ```bash
95
- python manage.py migrate users
96
- ```
97
-
98
-
99
- ## Structure
100
- ```
101
- users/
102
- ├── views.py # CRUD operations
103
- ├── urls.py # URL routing
104
- ├── tables.py # User and Activity Log tables
105
- ├── signals.py # Logging signals
106
- ├── models.py # User model, permissions, activity logs
107
- ├── forms.py # Creation, edit,. etc.
108
- ├── filter.py # Search filters
109
- ├── apps.py # Permissions Localization
110
- ├── admin.py # Admin UI integration
111
- ├── __init__.py # Python init
112
- ├── templates/ # HTML templates
113
- ├── static/ # CSS classes
114
- └── migrations/ # Database migrations
115
- ```
116
-
117
- ## Version History
118
-
119
- | Version | Changes |
120
- |----------|---------|
121
- | v1.0.0 | • Initial release as pip package |
122
- | v1.0.1 | • Fixed a couple of new issues as a pip package |
123
- | v1.0.2 | • Fixed the readme and building files |
124
- | v1.0.3 | • Still getting the hang of this pip publish thing |
125
- | v1.0.4 | • Honestly still messing with and trying settings and stuff out |
126
- | v1.1.0 | • OK, finally a working seamless micro-users app |
127
- | v1.1.1 | • Fixed a bug where a staff member can edit the admin details |
128
- | v1.2.0 | • Added User Details view with specific user activity log |
129
- | v1.2.1 | • Fixed a minor import bug |
130
- | v1.2.3 | • Separated user detail view from table for consistency<br> • Optimized the new detail + log view for optimal compatibiliyy with users |
131
- | v1.2.4 | • Fixed a couple of visual inconsistencies |
132
- | v1.3.0 | • Patched a critical security permission issue<br> • Disabled ADMIN from being viewed/edited from other staff members<br> • Fixed an issue when sorting with full_name<br> • Enabled Logging for all actions |
133
- | v1.3.1 | • replaced a misplaced code that caused a crash when editing profile |
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes