Skip to content

Contributing

Install uv

git clone ..
uv venv .venv --python 3.12
source .venv/bin/activate
uv sync --all-extras
pre-commit install --hook-type pre-commit --hook-type pre-push

PyMiniRacer on Apple Silicon

  1. Found your site-packages

    python -m site
    >>> /opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages
    
  2. Download the Dylib file

    wget https://github.com/sqreen/PyMiniRacer/files/7575004/libmini_racer.dylib.zip
    
  3. Unzip The Dylib file

    unzip libmini_racer.dylib.zip

  4. MV Dylib file to your site-packages

    mv libmini_racer.dylib /opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/py_mini_racer/.

  5. Import Success.

    >>> from py_mini_racer import MiniRacer
    

Tailwind CSS

This project uses django-tailwind to manage CSS. CSS sources are located in the country_workspace/workspaces/theme/static_src/src/. If you need to edit the CSS follow the below steps:

  1. Install node dependencies

    ./manage.py tailwind install
    
  2. Configure the enviroment

    export EXTRA_APPS="country_workspace.contrib.hope,django_browser_reload"
    export EXTRA_MIDDLEWARES="django_browser_reload.middleware.BrowserReloadMiddleware,"
    
  3. Build the final CSS

    ./manage.py tailwind build
    

    Or you can run the development mode

    ./manage.py tailwind start
    

Run tests

pytests tests

Run Selenium tests (ONLY)

pytests tests -m selenium

Run Selenium any tests

pytests tests --selenium

Note

You can disable selenium headless mode (show the browser activity on the screen) using --show-browser flag

Run local server

./manage.py runserver

Note

To facililate developing you can use:

export AUTHENTICATION_BACKENDS="country_workspace.security.backends.AnyUserAuthBackend"

It works only if DEBUG=True

Docker compose

Alternatively you can use provided docker compose for development

docker compose up

Alternatively you can use provided docker compose for development

docker compose up