How to make django task.py code editable in admin panel?
As Peter was saying it is definitely a bad idea. If you must do it, then below one might be little better:
Create a view to render a form, where user can choose the task name, class name, and then a text area to write his function or task (or) totally new task.py itself (as per your requirement). 
Once submitted, in the backend check for pep8 code formatting and (having a copy of your entire source code in your server/somewhere) and copy this new file there and run python manage.py shell to just basic sanitize the code.
Restrict the access to this form based on users model (users).
Again as Peter was saying this is totally spectacular security hole.
I have some functions as tasks in my tasks.py file in django and I want to be able to edit the code of each task in my administration panel. Is there any way of doing this. If possible, I would also like to be able to add more tasks in my tasks.py file directly through administration panel without having to go into tasks.py file to add a new task function. If anyone can point me in the right direction, that would be really appreciated.