mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-27 03:05:39 +01:00
Django plugin. Fix in functionality to dynamically generate a list of commands manage.py for versions django < 1.7.
This commit is contained in:
parent
c24f949394
commit
6fa73abaf7
1 changed files with 4 additions and 1 deletions
|
|
@ -181,7 +181,10 @@ import sys;import os;import logging;
|
||||||
logging.disable(logging.INFO)
|
logging.disable(logging.INFO)
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
import django
|
import django
|
||||||
django.setup()
|
django_version = django.get_version()
|
||||||
|
if float('.'.join(django_version.split('.', 2)[:2])) >= 1.7:
|
||||||
|
django.setup()
|
||||||
|
|
||||||
from django.core.management import get_commands, load_command_class;
|
from django.core.management import get_commands, load_command_class;
|
||||||
rs = ''
|
rs = ''
|
||||||
for command, app in sorted(get_commands().items(), key=lambda e: (e[1], e[0])):
|
for command, app in sorted(get_commands().items(), key=lambda e: (e[1], e[0])):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue