diff options
-rwxr-xr-x | manage.py | 8 | ||||
-rw-r--r-- | setup.py | 5 |
2 files changed, 12 insertions, 1 deletions
@@ -2,7 +2,9 @@ import os import sys -if __name__ == '__main__': + +# Separate definition to ease calling this in other scripts. +def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pysite.settings') try: from django.core.management import execute_from_command_line @@ -13,3 +15,7 @@ if __name__ == '__main__': "forget to activate a virtual environment?" ) from exc execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() @@ -38,5 +38,10 @@ setup( 'test': [ 'coverage>=4.5.1' ] + }, + entry_points={ + 'console_scripts': ( + 'psmgr = manage:main', + ) } ) |