Default ordering of the model

https://docs.djangoproject.com/en/2.0/ref/models/options/

The default ordering for the object, for use when obtaining lists of objects:

class Run(models.Model):
    date = models.DateField()

    class Meta:
        ordering = ['-date']

Creating custom management command

https://docs.djangoproject.com/en/1.5/howto/custom-management-commands/

Place it in management/commands

polls/
    __init__.py
    models.py
    management/
        __init__.py
        commands/
            __init__.py
            _private.py
            closepoll.py
    tests.py
    views.py

The simplest command:

from django.core.management.base import BaseCommand

class Command(BaseCommand):
    help = 'Example command'

    def handle(self, *args, **options):
        print 'Command example'

To see commands that may be used with manage.py

Just run it and it will output the list.

For instance, if you do not remember how to create an admin it will show that it may be created with

./manage.py createsuperuser

Run initial database migration with South when database already exists

http://stackoverflow.com/questions/3090648/django-south-table-already-exists

./manage.py migrate myapp --fake