Web app for finding hygiene resources in Portland, OR
- Fork this repository
- Clone to your local files
- Checkout to a new branch
- Make your changes
- ACP and submit a Pull Request
Uncomment PostgreSQL database settings in settings.py
and comment out sqlite3 settings above.
In the root folder run:
$ [sudo] docker compose up --build -d
Open http://localhost:8000 in your browser to view the list of available endpoints (you might need to wait around 30 seconds until all management commands inside the Django container are complete). To stop and remove the containers, use:
$ [sudo] docker compose down
- Django requires Python to run. Download Python3 at https://www.python.org/downloads/ or with your operating system's package manager.
- You may need to install
pip
(Python package manager) if you don't have it already. Follow pip installation. - Install
virtualenv
withpip
(pip is already installed if you're using the latest version of Python).virtualenv
is a tool to create isolated Python environments.$ [sudo] pip install virtualenv
- Create and activate your virtual environment.
$ virtualenv env --no-site-packages $ source env/bin/activate
- After you’ve created and activated a virtual environment, Navigate to the Django project directory
latrine_django
. Install Django and other dependences:$ [sudo] pip install -r requirements.txt
- Apply migrations:
$ python manage.py makemigrations $ python manage.py migrate
- Apply fixtures to populate the database with sample data:
$ python manage.py loaddata fixturefile.json
- Populate the database with the RefugeRestrooms public data:
$ python manage.py get_restrooms
- To have access to the Django admin site, run:
$ python manage.py createsuperuser
Follow the prompts to set up your login and password.
10. To start the development server, run:
sh $ python manage.py runserver
11. Open http://localhost:8000 in your browser to view the list of available endpoints.
The React app will live in the /frontend
folder and talk to Django over an API.
- You’ll need to have Node.js on your local development machine. The Node.js package comes with
npm
, the package manager for JavaScript. cd
into the/frontend
directory and install the existing setup:$ cd ./frontend $ npm install
- To start the development server, run:
$ npm start
- Open http://localhost:3000 in your browser to view the app.
Cd into /latrine_django
and run:
$ python manage.py test
If you use Docker and Docker Compose, spin up containers and run:
[sudo] docker-compose run latrine-django python manage.py test
Check out CONTRIBUTING.md for details.