Skip to content

A terminal in the browser for lazy django devops

License

Notifications You must be signed in to change notification settings

assem-ch/django-admin-terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django_admin_terminal


A terminal in the browser for lazy django devops! It works only in debug mode -by default-.

Important! Please use it at your own risk.

django admin terminal

Installation

Step 1

pip install git+https://github.com/assem-ch/django-admin-terminal/

Step 2

include django_admin_terminal into INSTALLED_APPS settings.py

INSTALLED_APPS = (
    # add to the existing apps
    'django_admin_terminal'
)

Step 3

run

python manage.py collectstatic

Done!

in your browser, goto http://127.0.0.1:8000/admin/terminal/ to access the web terminal.

note: make sure you got superuser privileges.

Configuration

Include those variables to settings.py

TERMINAL_SECURE = True  # False to allow http 
TERMINAL_DEBUG_ONLY = True # False to allow in prod
TERMINAL_WHITELIST = [
                "127.0.0.1"
]  # List of IPs to be allowed - NB: All allowed by default

Tip to run sudo

To run sudo tasks, you can use

echo mypassword | sudo -S command

Example commands

$ echo pa$$w0rD | sudo -S service nginx restart

$ git pull origin master

$ ls -al

Caveats

all the django superusers can access this portal, so make sure only the right guys have got access before deploying django_admin_terminal to live.

long running tasks and interactive commands won't probably work.

License

BSD License - checkout LICENSE file for the complete license document

Author

About

A terminal in the browser for lazy django devops

Resources

License

Stars

Watchers

Forks

Packages

No packages published