A role based admin UI for Django that produces a user friendly and beautiful UI.
Project description
Django cradmin
Django custom role based admin UI.
Django cradmin is in BETA. The system is fairly stable, but:
- We do not have getting started guides.
- We should have better tests before release. Some parts have been prototyped a lot while we tested out different concepts, and they need a complexity review and better tests.
- Works with Django 4 and python >=3.8,<3.11
Develop
Requires:
- https://docs.astral.sh/uv/ or (deprecated) https://github.com/pyenv/pyenv
Use conventional commits for GIT commit messages
See https://www.conventionalcommits.org/en/v1.0.0/. You can use this git commit message format in many different ways, but the easiest is:
- Use commitizen: https://commitizen-tools.github.io/commitizen/commit/
- Use an editor extension, like https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits for VScode.
- Just learn to write the format by hand (can be error prone to begin with, but it is fairly easy to learn).
Install hatch and commitizen
NOTE: You only need hatch if you need to build releases, and you only need commitizen for releases OR to make it easy to follow conventional commits for your commit messages (see Use conventional commits for GIT commit messages above).
First install pipx with:
# NOTE: Not needed with uv
brew install pipx
pipx ensurepath
Then install hatch and commitizen:
# with uv
uv tool install hatch
uv tool install commitizen
# with pipx
pipx install hatch
pipx install commitizen
See https://github.com/pypa/pipx, https://hatch.pypa.io/latest/install/ and https://commitizen-tools.github.io/commitizen/ for more install alternatives if needed, but we really recommend using pipx since that is isolated.
Install development dependencies
(deprecated - use UV) Install a local python version with pyenv:
pyenv install $(pyenv latest -k 3.12)
pyenv local 3.12
Create virtualenv
With UV
uv venv
(deprecated) with pyenv/pip
./tools/recreate-virtualenv.sh
Alternatively, create virtualenv manually (this does the same as recreate-virtualenv.sh):
python -m venv .venvthe ./tools/recreate-virtualenv.sh script is just here to make creating virtualenvs more uniform across different repos because some repos will require extra setup in the virtualenv for package authentication etc.
Install dependencies
# with uv:
uv pip install -e ".[dev,test]"
# with pip:
source .venv/bin/activate # enable virtualenv
.venv/bin/pip install -e ".[dev,test]"
Run dev server
source .venv/bin/activate # enable virtualenv
ievv devrun
Run tests
source .venv/bin/activate # enable virtualenv
pytest django_cradmin
Build css/javascript:
source .venv/bin/activate # enable virtualenv
nvm use 14 # May need to run "nvm install 14" first
ievv buildstatic
# ... or if you want to watch for changes ...:
ievv buildstatic --watch
Run tests
source .venv/bin/activate # enable virtualenvbash
pytest django_cradmin
Autoformat code with ruff
If you have not configured your editor to autoformat with ruff, you can run the following command to autoformat all code in the repo:
source .venv/bin/activate # enable virtualenvbash
ruff format .
Docs
http://django-cradmin.readthedocs.org
License
3-clause BSD license. See the LICENSE file in the same directory as this readme file.
How to release django_cradmin
First make sure you have NO UNCOMITTED CHANGES!
Buildstatic
Remove the previous built static files:
git rm -r django_cradmin/apps/django_cradmin_js/static/django_cradmin_js/ django_cradmin/apps/django_cradmin_styles/static/django_cradmin_styles/
Bump version and add changelog
cz bump --files-only --changelog
Build static files
Create new production static files
nvm use 14 # May need to run "nvm install 14" first
ievv buildstatic --production
Commit static files
NB: Make sure you also commit pyproject.toml and django_cradmin/__init__.py, as the new version is in these files now.
git add CHANGELOG.md pyproject.toml django_cradmin/__init__.py django_cradmin/apps/django_cradmin_js/static/django_cradmin_js/ django_cradmin/apps/django_cradmin_styles/static/django_cradmin_styles/
git status
# ... make sure there are no more files that need to be added ...
git commit -m "bump: $(cz version --project)"
Make tag and push
Create tag with the current version
git tag $(cz version --project)
git push && git push --tags
What if the release fails?
See How to revert a bump in the commitizen FAQ.
Release to pypi:
hatch build -t sdist
hatch publish
rm dist/* # optional cleanup
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django_cradmin-12.1.0.tar.gz.
File metadata
- Download URL: django_cradmin-12.1.0.tar.gz
- Upload date:
- Size: 3.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.14.3 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
914fc5865f8d6b07400d891ec41e92e5b863aab9138eb402c1fed57bb16db644
|
|
| MD5 |
b4bb834df608e83c8235d9f4e97fb688
|
|
| BLAKE2b-256 |
6fbdfb41c5f70e3406b15f3f39c1535614acf41605ecb28eb94bbb863566df26
|