Ticket #18716: ticket_18716.patch

File ticket_18716.patch, 2.3 KB (added by Roman Gladkov, 11 years ago)

added command and docs

  • AUTHORS

    diff --git a/AUTHORS b/AUTHORS
    index 6e79bef..ccb2a8a 100644
    a b answer newbie questions, and generally made Django that much better:  
    595595    Jarek Zgoda <jarek.zgoda@gmail.com>
    596596    Cheng Zhang
    597597    Hannes Struß <x@hannesstruss.de>
     598    Roman Gladkov <d1fffuz0r@gmail.com>
    598599
    599600A big THANK YOU goes to:
    600601
  • new file django/core/management/commands/docs.py

    diff --git a/django/core/management/commands/docs.py b/django/core/management/commands/docs.py
    new file mode 100644
    index 0000000..fa6aa60
    - +  
     1import webbrowser
     2
     3from django.core.management.base import NoArgsCommand
     4
     5
     6class Command(NoArgsCommand):
     7    help = """Opening the documentation for your version of Django"""
     8    url = 'https://docs.djangoproject.com/en/{ver}/'
     9
     10    can_import_settings = False
     11    requires_model_validation = False
     12    leave_locale_alone = True
     13
     14    def handle_noargs(self, *args, **options):
     15        from django import VERSION
     16
     17        version = 'dev'
     18
     19        if 'final' in VERSION:
     20            version = '.'.join(map(str, VERSION[:2]))
     21
     22        url = self.url.format(ver=version)
     23
     24        webbrowser.open(url)
     25
     26        return 'Opening the documentation by link: {url}'.format(url=url)
  • docs/ref/django-admin.txt

    diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
    index bde4ec6..9eb4228 100644
    a b example, the default settings don't define :setting:`ROOT_URLCONF`, so  
    171171Note that Django's default settings live in ``django/conf/global_settings.py``,
    172172if you're ever curious to see the full list of defaults.
    173173
     174.. versionchanged:: 1.6
     175
     176docs
     177----
     178
     179.. django-admin:: docs
     180
     181Opening the documentation page for your version of Django in the webbrowser.
     182
    174183dumpdata <appname appname appname.Model ...>
    175184--------------------------------------------
    176185
  • docs/releases/1.6.txt

    diff --git a/docs/releases/1.6.txt b/docs/releases/1.6.txt
    index f53fa8a..6f8f3d8 100644
    a b Minor features  
    6464  :attr:`~django.core.management.BaseCommand.leave_locale_alone` internal
    6565  option. See :ref:`management-commands-and-locales` for more details.
    6666
     67* Added :djadmin:`docs` command for opening the documentation website.
     68
    6769Backwards incompatible changes in 1.6
    6870=====================================
    6971
Back to Top