├── .python-version ├── .gitignore ├── LICENSE.txt ├── pyproject.toml └── README.md /.python-version: -------------------------------------------------------------------------------- 1 | 3.13 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Python-generated files 2 | __pycache__/ 3 | *.py[oc] 4 | build/ 5 | dist/ 6 | wheels/ 7 | *.egg-info 8 | 9 | # Virtual environments 10 | .venv 11 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2024 Jeff Triplett. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "django-cli-no-admin" 3 | version = "2025.10.1" 4 | description = 'Use the Django CLI using "django" without typing "django-admin"' 5 | authors = [ 6 | { name = "Jeff Triplett", email = "jeff.triplett@gmail.com" } 7 | ] 8 | requires-python = ">=3.10" 9 | license = "BSD-3-Clause" 10 | dependencies = [ 11 | "django" 12 | ] 13 | classifiers = [ 14 | "Development Status :: 5 - Production/Stable", 15 | "Framework :: Django :: 4.2", 16 | "Framework :: Django :: 5.0", 17 | "Framework :: Django :: 5.1", 18 | "Framework :: Django :: 5.2", 19 | "Framework :: Django :: 6.0", 20 | "Intended Audience :: Developers", 21 | "Programming Language :: Python :: 3 :: Only", 22 | "Programming Language :: Python :: 3.10", 23 | "Programming Language :: Python :: 3.11", 24 | "Programming Language :: Python :: 3.12", 25 | "Programming Language :: Python :: 3.13", 26 | "Programming Language :: Python :: 3.14", 27 | "Programming Language :: Python :: 3.15", 28 | ] 29 | readme = { file = "README.md", content-type="text/markdown" } 30 | 31 | [project.scripts] 32 | django = "django.core.management:execute_from_command_line" 33 | 34 | [project.urls] 35 | Changelog = "https://github.com/jefftriplett/django-cli-no-admin/releases" 36 | Documentation = "https://github.com/jefftriplett/django-cli-no-admin" 37 | "Fiscal support" = "https://github.com/sponsors/jefftriplett/" 38 | Homepage = "https://jefftriplett.com" 39 | Source = "https://github.com/jefftriplett/django-cli-no-admin" 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # django-cli-no-admin 2 | 3 | > Use the Django CLI using "django" without typing "django-admin". 4 | 5 | django-cli-no-admin is a config-only project that creates a `django` command and nothing more. With this package, you can use the `django` command instead of `django-admin` to execute management commands in your Django project. 6 | 7 | > [!NOTE] 8 | > This package will eventually become unnecessary once [DEP 16](https://github.com/django/deps/blob/main/accepted/0016-name-main-command-django.rst) is fully implemented in Django core. DEP 16 proposes renaming the main Django command from `django-admin` to `django`. Track the implementation progress in [django/deps#100](https://github.com/django/deps/pull/100). 9 | 10 | See the blog post: https://micro.webology.dev/2024/12/14/new-project-to.html 11 | 12 | ## Installation 13 | 14 | You can install django-cli-no-admin using pip: 15 | 16 | ```shell 17 | pip install django-cli-no-admin 18 | ``` 19 | 20 | Or, if you prefer uv: 21 | 22 | ```shell 23 | uv pip install django-cli-no-admin 24 | ``` 25 | 26 | ## Usage 27 | 28 | Once installed, you can use `django` from the command line in place of `django-admin`: 29 | 30 | ```shell 31 | django startproject myproject 32 | ``` 33 | 34 | Or any other Django admin command: 35 | 36 | ```shell 37 | django startapp myapp 38 | ``` 39 | 40 | ### Running Project-Specific Commands 41 | 42 | By default, the `django` command works with Django's built-in admin commands (like `startproject`, `startapp`, etc.). To run project-specific management commands from your `manage.py` (like `runserver`, `migrate`, `makemigrations`, etc.), you'll need to set the `DJANGO_SETTINGS_MODULE` environment variable: 43 | 44 | ```shell 45 | export DJANGO_SETTINGS_MODULE=myproject.settings 46 | django runserver 47 | ``` 48 | 49 | Or set it inline: 50 | 51 | ```shell 52 | DJANGO_SETTINGS_MODULE=myproject.settings django migrate 53 | ``` 54 | 55 | This tells Django where to find your project's settings, allowing you to access all the commands that would normally be available through `manage.py`. 56 | 57 | ## No Additional Setup Required 58 | 59 | There are no additional dependencies or configurations needed. Simply install the package, and you're ready to go. If you need to run project-specific commands, just remember to set `DJANGO_SETTINGS_MODULE` as shown above. 60 | 61 | ## License 62 | 63 | django-cli-no-admin is licensed under the BSD License. See the LICENSE.txt file for details. 64 | --------------------------------------------------------------------------------