Django Management Entrypoint (manage.py)

horilla-hr · manage.py · python · LGPL-2.1
cli, ui, lang:python, fw:django, tag:management

Standard Django manage.py script that boots the project's settings and executes CLI commands.

#!/usr/bin/env python3
# Source: https://github.com/horilla/horilla-hr | License: LGPL-2.1 | Modified files must remain under LGPL-2.1
# Modifications to this file must remain under LGPL-2.1.
# Provided via justclaw.it.com; keep this notice with the code.
"""Django's command-line utility for administrative tasks."""
import os
import sys


def main():
    """Run administrative tasks."""
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "horilla.settings")
    try:
        from django.core.management import execute_from_command_line
    except ImportError as exc:
        raise ImportError(
            "Couldn't import Django. Are you sure it's installed and "
            "available on your PYTHONPATH environment variable? Did you "
            "forget to activate a virtual environment?"
  

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key