Development

Contributing

Thank you for considering contributing to An Otter Wiki! If you ran into a problem or want to request a feature, please check the existing issues in case someone else had a similar request and support their case or open a new issue. If you want to contribute code, design or documentation directly, please fork the repository on github. Please make sure all tests pass and submit your changes as a pull request.

Setting up a development environment

  1. Install the prerequisites
    • Debian / Ubuntu
    apt install git build-essential python3-dev python3-venv
    
    • RHEL8 / Fedora / Centos8 / Rocky Linux 8
    yum install make python3-devel
    
    • MacOS
    brew install python3
    
  2. Clone the repository (in case you've created a fork, replace the url with your repository) and enter the directory
    git clone https://github.com/redimp/otterwiki.git && cd otterwiki
    
  3. Create and initialize the repository where the data is stored
    mkdir -p app-data/repository
    # initialize the empty repository
    git init app-data/repository
    
  4. Create a minimal configuration file
    echo "REPOSITORY='${PWD}/app-data/repository'" >> settings.cfg
    echo "SQLALCHEMY_DATABASE_URI='sqlite:///${PWD}/app-data/db.sqlite'" >> settings.cfg
    echo "SECRET_KEY='$(echo $RANDOM | md5sum | head -c 16)'" >> settings.cfg
    
  5. Run make to setup a virtual environemnt and run a local server on port 8080
    make debug
    
  6. Open the wiki in your browser http://127.0.0.1:8080. You can create and edit pages as anonymous user without any further configuration. Please note: This setup is not for production use!
  7. While you edit the code, flask will automatically reload the server.
  8. Run tests
    make test
    
  9. Run coverage tests
    make coverage
    
    and check coverage_html/index.html for detailed information.
On this page
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9