Skip to main content

A handy collection of reusable Django UI components, allowing me to share and integrate elements efficiently across various projects.

Project description

django-sample-components 🚀

PyPI

This project is a test for creating a Django library. 🧩

Installation 📦

You can install the library using pip or poetry:

pip install django-sample-components

or

poetry add django-sample-components

Configuration ⚙️

Add django_sample_components to the INSTALLED_APPS list in your settings.py:

INSTALLED_APPS = [
    # ... other apps ...
    'django_sample_components',
]

Usage in Templates 📝

Now you can use sample_tags in your templates as follows (templates/explample.html):

{% load sample_tags %}

<p>{% greeting "Bob" %}</p>
<p>{% shout %}Let's go!{% endshout %}</p>

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-sample-components.git
cd django-sample-components
poetry install
cd demo_project
python -m pip install -e ..
poetry run ./manage.py runserver

Tests 🧪

To run the tests, use the command below inside the demo_project directory:

poetry run ./manage.py test

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_sample_components-0.1.5.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_sample_components-0.1.5-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file django_sample_components-0.1.5.tar.gz.

File metadata

  • Download URL: django_sample_components-0.1.5.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.12 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for django_sample_components-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a5b7ad9f6ed7e70c6b94077b3619845e685ddabea9395f7f4ceeb1f8e5993b1e
MD5 5bd77a44420f11865c0b26ad338d65ad
BLAKE2b-256 e4265491454bed0bf98251da32f972d00b3fddd9f67c7f48a13172dffc58677f

See more details on using hashes here.

File details

Details for the file django_sample_components-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: django_sample_components-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.12 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for django_sample_components-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 83f2bf3f5452adb23c72854ab709cc6cd22235b76206a4ee843d03b6b87d0674
MD5 ef1aec97992651d4968569a9637a60ee
BLAKE2b-256 72f1aefe58878e3e61990d826b2ab7b6c2b1f26deaabef0d1d2d1d061ec01b2b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page