liveBook · Manning

Django-admin

As explained in Django in Action

django-admin is Django's command-line utility for creating projects and running configuration or management actions.

django-admin is Django’s command-line management script for creating a new project. It is not Django Admin: lowercase, hyphenated django-admin runs in a terminal; Django Admin is the browser-based interface for managing database objects. section 2.2 section 5.1

After installing Django in an activated Python virtual environment, run django-admin startproject with a project name. Django creates the minimum project structure: a package containing settings, URL configuration, ASGI and WSGI entry points, plus manage.py at the project root. The generated WSGI application is the bridge a production web server uses to invoke Django. section 2.2

Create RiffMates in the current directory

Create and enter a RiffMates directory, activate its virtual environment, install Django, then run: django-admin startproject RiffMates . The final dot puts the generated project files in the current directory rather than adding another enclosing directory. Use python manage.py runserver afterward to start the development server; manage.py is generated by startproject and runs project-local management commands. section 2.2 section 2.2

Keep Django’s similar admin terms straight:

  • django-admin — the terminal management script used to create Django projects. section 5.1
  • Django Admin — the web interface where authorized users manage registered Model objects. section 5.0
  • Admin or superuser — a user with unrestricted Django Admin access; createsuperuser creates such an account. section 5.1

django-admin gets a project started; it does not itself provide the web administration screens. Those screens are enabled by Django’s default admin app and admin URL route, require a staff or admin login, and can list, add, edit, and delete registered Model objects. section 5.1.2 section 5.0

How Django in Action covers it

How deep it goes
Demonstrates installation and startproject output, while deferring production web-server configuration details.
Examples
Creates the RiffMates project with django-admin startproject RiffMates .
What it assumes
Assumes a Python environment and teaches Django installation inside a virtual environment.
What you can do after
Operate/configure it to generate a Django project skeleton in a chosen directory.
How it connects
Distinguishes Django Admin and connects generated projects to virtual environments, WSGI, and manage.py.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Django in Action. The section links point to the parts of the book it draws on.