diff --git a/dev/community/development/index.html b/dev/community/development/index.html index 92bf9677..0394341e 100644 --- a/dev/community/development/index.html +++ b/dev/community/development/index.html @@ -1,4 +1,4 @@ -
NOTE: See the available environments in tox.ini
.
To check linting rules, run:
To format the code, run:
To validate with Mypy, run:
You can run these through tox
as well:
We use Playwright for end-to-end tests. You will need to install Playwright to run these tests.
Luckily, Playwright makes it very easy:
After Playwright is ready, run the tests the same way as before:
How do you check that your changes to django-components project will work in an actual Django project?
Use the sampleproject demo project to validate the changes:
Navigate to sampleproject directory:
Install dependencies from the requirements.txt file:
Link to your local version of django-components:
Note
The path to the local version (in this case ..
) must point to the directory that has the pyproject.toml
file.
Start Django server:
Once the server is up, it should be available at http://127.0.0.1:8000.
To display individual components, add them to the urls.py
, like in the case of http://127.0.0.1:8000/greeting
django_components uses a bit of JS code to:
When you make changes to this JS code, you also need to compile it:
Navigate to src/django_components_js
:
Install the JS dependencies
Compile the JS/TS code:
The script will combine all JS/TS code into a single .js
file, minify it, and copy it to django_components/static/django_components/django_components.min.js
.
To package the library into a distribution that can be published to PyPI, run:
# Install pypa/build
+python -m pip install build --user
+# Build a binary wheel and a source tarball
+python -m build --sdist --wheel --outdir dist/ .
+
To publish the package to PyPI, use twine
(See Python user guide):
The scripts/supported_versions.py
script can be used to update the supported versions.
This will check the current versions of Django and Python, and will print to the terminal all the places that need updating and what to set them to.
The scripts/validate_links.py
script can be used to update the link references.
When new version of Django is released, you can use the script to update the URLs pointing to the Django documentation.
First, you need to update the URL_REWRITE_MAP
in the script to point to the new version of Django.
Then, you can run the script to update the URLs in the codebase.
Head over to Dev guides for a deep dive into how django_components' features are implemented.