Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

About django-admin commands

Lino applications are Django projects. Here is some more Django know-how you should know as a Lino developer.

The manage.py file in every demo project is the standard Django interface for running a so-called django-admin command.

django-admin command

A command-line tool to be used for executing diverse tasks on a Lino site. On a Lino site we usually say use the pm alias.

See also the Django docs about django-admin and manage.py and Writing custom django-admin commands

Here are some standard django-admin commands you should know.

shell

Start an interactive Python session on this site.

See the Django documentation

runserver

Start a web server that runs the application defined by this site.

See the Django documentation

dumpdata

Output all data in the database (or some tables) to a serialized stream. Serialization formats include json or xml. The default will write to stdout, but you usually redirect this into a file. See the Django documentation

With a Lino application you will probably prefer pm dump2py.

flush

Removes all data from the database and re-executes any post-synchronization handlers. The migrations history is not cleared. If you would rather start from an empty database and re-run all migrations, you should drop and recreate the database and then run migrate instead. See the Django documentation

With a Lino application you will probably prefer initdb or pm prep.

loaddata

Loads the contents of the named fixtures into the database. See the Django documentation.

With a Lino application you will probably prefer initdb or pm prep.

migrate

Updates the database schema.

With a Lino application you will probably prefer pm dump2py as explained in Data migrations à la Lino.