-
Notifications
You must be signed in to change notification settings - Fork 6
Getting Started
Parrot uses React and Django. Before installing the libraries and dependencies, let's first make sure we have the latest tool. The provided commands in the code blocks shall work on Mac and most Linux systems.
Get the latest version of Python at https://www.python.org/downloads/ or with your operating system’s package manager.
We use the latest LTS Version (10.15.1 at this moment), and it comes with npm (the node package manager, version 6.4.1). Get the Installers or Binaries at https://nodejs.org/en/download/.
Now we're ready to install some packages :)
In the project root, let's create a virtual environment for parrot
python3 -m venv penv
The directory penv
is ignored by the Git version control system.
source penv/bin/activate
We need to activate the environment before we use or update the backend
packages. Command deactivate
will deactivate this environment. Read more at
official documentation.
In the activated environment, we can do
pip install -r requirements.txt
To install the frontend packages, It's as simple as
npm install -C frontend
npm run watch -C frontend
This command will let webpack watch files and recompile whenever they change. We should keep the watching process alive during the development.
Before we start our Django server, we need to load the fixtures or the local database will be empty and there's nothing to render.
./scripts/load_fixtures.sh
python manage.py runserver
It should output
Starting development server at http://127.0.0.1:8000/
We can verify it's working by visiting this URL in the browser.
Congrats! Now you're ready to poke around and make your contribution.
Happy coding!
To start developing the project (every time), we must ensure:
- The frontend build watching processing is alive. If not, run
npm run watch -C frontend
- The parrot virtual environment is activated. If not, run
source penv/bin/activate
- The Django development server process is alive. If not, run
python manage.py runserver
Note this command must be run in a terminal which the parrot virtual environment is activated.