Skip to content

Latest commit

 

History

History
94 lines (58 loc) · 2.51 KB

code.md

File metadata and controls

94 lines (58 loc) · 2.51 KB

Overview

You will need to set up a Python environment to develop ReactPy-Django.

!!! abstract "Note"

Looking to contribute features that are not Django specific?

Everything within the `reactpy-django` repository must be specific to Django integration. Check out the [ReactPy Core documentation](https://reactpy.dev/docs/about/contributor-guide.html) to contribute general features such as components, hooks, and events.

Creating an environment

If you plan to make code changes to this repository, you will need to install the following dependencies first:

Once done, you should clone this repository:

git clone https://github.com/reactive-python/reactpy-django.git
cd reactpy-django

Then, by running the command below you can:

  • Install an editable version of the Python code
  • Download, build, and install Javascript dependencies
pip install -e . -r requirements.txt --verbose --upgrade

!!! warning "Pitfall"

Some of our development dependencies require a C++ compiler, which is not installed by default on Windows.

If you receive errors related to this during installation, follow the instructions in your console errors.

Finally, to verify that everything is working properly, you can manually run the test web server.

cd tests
python manage.py runserver

Navigate to http://127.0.0.1:8000 to see if the tests are rendering correctly.

Creating a pull request

{% include-markdown "../../includes/pr.md" %}

Running the full test suite

!!! abstract "Note"

This repository uses [Nox](https://nox.thea.codes/en/stable/) to run tests. For a full test of available scripts run `nox -l`.

By running the command below you can run the full test suite:

nox -s test

Or, if you want to run the tests in the background:

nox -s test -- --headless

Running Django tests

If you want to only run our Django tests in your current environment, you can use the following command:

cd tests
python manage.py test

Running Django test web server

If you want to manually run the Django test application, you can use the following command:

cd tests
python manage.py runserver