django-my-lib 🚀
This project is a test for creating a Django library. 🧩
Installation 📦
You can install the library using pip or poetry:
pip install django-my-lib
# or
poetry add django-my-lib
Configuration ⚙️
Add django_my_lib to the INSTALLED_APPS list in your settings.py:
INSTALLED_APPS = [
# ... other apps ...
'django_my_lib',
]
Migrations 🗄️
After installing and configuring, run the following commands:
python manage.py makemigrations
python manage.py migrate
🎉 Done! Your Django library is installed and ready to use.
Running locally as a developer 🖥️
To run the Django project locally during development, follow the steps below:
git clone https://github.com/GustavoRizzo/django-my-lib.git
cd django-my-lib
poetry install
poetry run task run-demo
For a more complete setup, you can run the comands:
poetry run task migrate
poetry run task createsuperuser
# or
poetry run task setup # that will do the same as above
Tests 🧪
To run the tests, use the command below inside the demo_project directory:
poetry run task test
Linting 🧹
To check for linting issues, use the command below:
poetry run task lint
poetry run task lint-fix # to fix issues automatically
If using pyenv
To manage Python versions, you can use pyenv. To install pyenv, follow the instructions in the pyenv GitHub repository.
pyenv update
pyenv install 3.12.0
# Activete the virtual environment with the correct Python version
python -m venv venv
source venv/bin/activate
pip install pip --upgrade
pip install poetry
poetry install
poetry run task run-demo
Updating and publishing the library 🚢
To update the version, build, and publish your library, use the commands below:
poetry version patch # to bump the version (e.g.: 0.1.0 → 0.1.1)
poetry build
tar -tzf dist/*.tar.gz | head -20 # to see the files inside the package
poetry publish
Use this project as a template for your own Django library! 🌟
Rename the project and package
To rename the project and package, follow these steps:
-
On github click on the "Use this template" button to create a new repository based on this template. Give it a new name (e.g.,
django-awesome-lib). -
Inside the project folder, rename the package folder from
django_my_libto your desired name (e.g.,django_awesome_lib).
mv django_my_lib django_awesome_lib
-
Make CTRL+F and replace all occurrences of
django_my_libwithdjango_awesome_libin the codebase. -
Rename template folder: On django_awesome_lib/templates, rename the folder from
demo_projectto your desired name (e.g.,demo_awesome_project).
mv django_awesome_lib/templates/django_my_lib django_awesome_lib/templates/django_awesome_lib
-
Make CTRL+F and replace all occurrences of
django-my-libwithdjango-awesome-libin the codebase. -
Ajdust the project name in the
pyproject.tomlfile.
[tool.poetry]
name = "django-awesome-lib"
version = "0.1.0"
description = "This project is a test for creating a Django library."
authors = [
"Your Name <your.email@example.com>"
]
- Adjust README.md to reflect the new project name and package name.
# django-awesome-lib 🚀
[](https://pypi.org/project/django-awesome-lib/)
> This my brand new project is a test for creating a Django library. 🧩
- Now you are free to start developing your new Django library! 🎉
Metadata
Release files for django-my-lib 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_my_lib-0.1.7.tar.gz | 4.5 kB | Without provenance | Details for django_my_lib-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_my_lib-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for django_my_lib-0.1.7-py3-none-any.whl |
Total release size: 10.9 kB
Release files / django_my_lib-0.1.7.tar.gz
| Download URL | django_my_lib-0.1.7.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27b33ecb8639cee1cb623206d80c74307a5063d444e4d80bf182e16dd787e88d
|
|
BLAKE2b-256 checksum How to use checksums |
008858793c61ba6f5e9662bcaf1a4930859051a5a1d3d90ac7827525ea53c3d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.10.12 Linux/6.6.87.2-microsoft-standard-WSL2
|
Release files / django_my_lib-0.1.7-py3-none-any.whl
| Download URL | django_my_lib-0.1.7-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
11905aa75a1d59338ed13491089e9099565922421d54bafb662ea109ec670acb
|
|
BLAKE2b-256 checksum How to use checksums |
7c9ae570d02d848b40b8507d04f2a6da5c757ae321983f36ae2fa8c5bbdfad1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.10.12 Linux/6.6.87.2-microsoft-standard-WSL2
|
Security for django-my-lib 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.