Contributing

Contributions to django-controlcenter are welcome. Please follow these guidelines to ensure a smooth process.

Pull Request Guidelines

As the original author has limited time for new features, pull requests are the best way to contribute. A good pull request should:

  1. Branch from master: Create your feature branch from the master branch.
  2. Provide Tests: Add tests for any new features or bug fixes.
  3. Add Documentation: If you add a new feature, please update the documentation.
  4. Update Changelog: Add a note about your change to the changelog in README.rst under the next version.

Development Setup

  1. Clone the repository:

    git clone https://github.com/byashimov/django-controlcenter.git
    cd django-controlcenter
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate
  3. Install in editable mode:

    pip install -e .
    pip install tox

Running Tests

This project uses tox to test against multiple Python and Django versions. This is the preferred way to run tests.

  1. Install tox:

    pip install tox
  2. Run all test environments:

    tox
  3. Run tests for a specific environment:

    To run tests for a single environment defined in tox.ini, use the -e flag. For example, to test with Python 3.8 and Django 4.0:

    # The environment name format is py{python_version}-django{django_version}
    # Example from tox.ini: py{38,39,310}-django{4}
    tox -e py38-django4

You can also run tests directly using the test project's manage.py script for quicker feedback during development:

python test_project/manage.py test

Frontend Development

The project's CSS is compiled from Stylus files using Grunt.

  1. Install Node.js dependencies:

    npm install
  2. Compile styles:

    If you make changes to the .styl files in controlcenter/stylus/, you need to recompile them.

    # Run a one-time build
    grunt
    
    # Watch for changes and rebuild automatically
    grunt watch