Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8a5375b
basic installation
sadrakhamoshi Mar 23, 2021
7a1945d
add basic user authentication
sadrakhamoshi Mar 24, 2021
503a61d
create class for register api
sadrakhamoshi Mar 24, 2021
60b252a
create schedule app and model
sadrakhamoshi Mar 24, 2021
eea5a42
add celery into setting and __init__.py
sadrakhamoshi Mar 25, 2021
c426b19
add host email into setting and send_mail task
sadrakhamoshi Mar 25, 2021
021935c
setup celery in project
sadrakhamoshi Mar 28, 2021
1b98b71
add field is_admin in account/models.py
sadrakhamoshi Mar 29, 2021
4d80a96
customize admin_panel for manage accounts
sadrakhamoshi Mar 29, 2021
901c2a9
add celery_task_id field into Task Model
sadrakhamoshi Mar 29, 2021
2981ac9
customize task_admin_panel for manage Tasks
sadrakhamoshi Mar 29, 2021
456e474
gitignore
sadrakhamoshi Mar 29, 2021
285d620
add list_display link_owner_tasks
sadrakhamoshi Mar 30, 2021
6daeed1
change queryset of schedule/task model
sadrakhamoshi Mar 30, 2021
94e7d90
change schedule\admin.py
sadrakhamoshi Mar 30, 2021
6b31fff
write test for authentication
sadrakhamoshi Mar 30, 2021
8b2dfb5
add new policy for create task in schedule/admin
sadrakhamoshi Mar 30, 2021
ca19cd6
task pictures
sadrakhamoshi Mar 30, 2021
7c247bb
Update README.md
sadrakhamoshi Mar 30, 2021
5e2dc07
Update README.md
sadrakhamoshi Mar 30, 2021
797caac
Update README.md
sadrakhamoshi Mar 30, 2021
585bdaf
Update README.md
sadrakhamoshi Mar 30, 2021
90cf4b1
nothing
sadrakhamoshi Mar 30, 2021
8aa95a7
Update README.md
sadrakhamoshi Mar 30, 2021
a67b269
Update README.md
sadrakhamoshi Mar 30, 2021
2e50d58
nothing2 :))
sadrakhamoshi Mar 30, 2021
70b1bf2
Merge branch 'feature_custom_task_admin' of https://github.com/sadrak…
sadrakhamoshi Mar 30, 2021
cb1fa50
Merge pull request #1 from sadrakhamoshi/feature_custom_task_admin
sadrakhamoshi Mar 30, 2021
bf75228
Update README.md
sadrakhamoshi Mar 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# In name of Allah

## Trello Tasks
![alt text](https://github.com/sadrakhamoshi/Django-Schedular/blob/develope/ch_nilva/pic/SharedScreenshot.jpg)

![alt text](https://github.com/sadrakhamoshi/Django-Schedular/blob/develope/ch_nilva/pic/SharedScreenshot2.jpg)

![alt text](https://github.com/sadrakhamoshi/Django-Schedular/blob/develope/ch_nilva/pic/SharedScreenshot3.jpg)

## Introduction
We want a simple app to schedule tasks for users. It should be possible to use django admin as interface for this application.

Expand All @@ -11,6 +18,108 @@ normal users can only see, filter & add to their own tasks. These tasks will hav

admin users have the permission to manage users, add to them and delete them. Also they can manage all tasks of users, add task for them and edit their tasks. When created or edited, scheduled tasks should be added or edited.

**note** totaly we have 3 type of users in the whole of the project:
- superuser
- admin
- normal
each type of this users can log in into the admin interface of Django with different policies.

Account & Authentication
------------------------
superusers have all permissions. they can change, create and etc the other users.
admin can create normal user and admin user and change some parts of their information ( e.g admin can not change the user's role into the superuser)
normal users can only see their information and can not edit it.

Tasks
----------------
- superusers again have all permissions. they can create, edit, delete tasks for theirselves or others\
- admins can do same as superusers but just for normal users or admin users. they can not edit or create new task for superusers\
- normals can only see or create or filter tasks for themselves.

Road Map
===================

Authenticationt & Account-admin
---------------
First of all i started with creating login/ signup APIs for users. For that i used JWT from rest-framework. For users i inherited AbstractUser from django.
i Created 3 kind of API for :
- login
- signup
- refresh token

After that i tryed to customize the admin pannel for the different users. For that i used admin.ModelAdmin class from django and override some of methods.

Tasks
---------------
Next i went for Tasks in schedule app. i built Task model and created Api for geting the list of the Tasks base on the users permission (as it mentioned)

Celery
---------------
After task i went into the celery lib and read about and did some resarch. we need that to do some tasks asynchronous. If you want to use celery you need
broker, which i used redis.\

celery doc : (https://docs.celeryproject.org/en/stable/index.html)

Customize Tasks Admin
--------------
Finally I customized the admin panel for managing the tasks and again I used admin.ModelAdmin and override some of its base methods.

-------------------------------------------------

Run
==================


### install postgres

Download Link: https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
- Create a Database (Check ch_nilva/ch_nilva/settings.py for database name)
- create a Login/Group Roles (Check ch_nilva/ch_nilva/settings.py for user and password)

--------------------------------

1.clone the porject :

````
git clone https://github.com/sadrakhamoshi/Django-Schedular.git
````
----------------------------

2.Install pip and python3.7 and virtualenv if you don't have them\
pip install link : https://pip.pypa.io/en/stable/installing/

````
pip install virtualenv
````
------------------------------
3.create virtual environment for python3.7 base on you os (UNIX/Mac or windows)\

venv link : https://docs.python.org/3/library/venv.html

-----------------------------

4.Install requirements ( **note** remmeber to active your virtual environment)
> $ pip install -r requirements.txt

-------------------
5.Migrate your project
> $ python manage.py migrate

--------------------
6.Create your super user

> $ python manage.py createsuperuser

----------------------
7.Start project
> $ python manage.py runserver

----------------------
## Login with your created super http://localhost:8000/api/admin/

## check for documentation http://localhost:8000/redoc/

--------------------------------------------
**note** that each user must have below fields:
- email
- username
Expand Down
Loading