openedx.core.djangoapps.util.management.commands package#
Submodules#
openedx.core.djangoapps.util.management.commands.print_setting module#
print_setting#
Django command to output a single Django setting. Useful when paver or a shell script needs such a value.
This handles the one specific use case of the “print_settings” command from django-extensions that we were actually using.
- class openedx.core.djangoapps.util.management.commands.print_setting.Command(stdout=None, stderr=None, no_color=False, force_color=False)#
Bases:
BaseCommandprint_setting command
- add_arguments(parser)#
Entry point for subclassed commands to add custom arguments.
- handle(*args, **options)#
The actual logic of the command. Subclasses must implement this method.
- help = 'Print the value of a single Django setting.'#
openedx.core.djangoapps.util.management.commands.reset_db module#
reset_db#
Django command to drop and recreate a database. Useful when running tests against a database which may previously have had different migrations applied to it.
This handles the one specific use case of the “reset_db” command from django-extensions that we were actually using.
originally from http://www.djangosnippets.org/snippets/828/ by dnordberg
- class openedx.core.djangoapps.util.management.commands.reset_db.Command(stdout=None, stderr=None, no_color=False, force_color=False)#
Bases:
BaseCommand- add_arguments(parser)#
Entry point for subclassed commands to add custom arguments.
- handle(*args, **options)#
Resets the database for this project.
Note: Transaction wrappers are in reverse as a work around for autocommit, anybody know how to do this the right way?
- help = 'Resets the database for this project.'#
- openedx.core.djangoapps.util.management.commands.reset_db.parse_mysql_cnf(dbinfo)#
Attempt to parse mysql database config file for connection settings. Ideally we would hook into django’s code to do this, but read_default_file is handled by the mysql C libs so we have to emulate the behaviour
Settings that are missing will return ‘’ returns (user, password, database_name, database_host, database_port)
openedx.core.djangoapps.util.management.commands.update_fixtures module#
Django management command to update the loaded test fixtures as necessary for the current test environment. Currently just sets an appropriate domain for each Site fixture.
- class openedx.core.djangoapps.util.management.commands.update_fixtures.Command(stdout=None, stderr=None, no_color=False, force_color=False)#
Bases:
BaseCommandupdate_fixtures management command
- handle(*args, **options)#
The actual logic of the command. Subclasses must implement this method.
- help = 'Update fixtures to match the current test environment.'#