python3
,pip
,venv
- Clone the repository
git clone git@github.com:ygpedroso/rideco-grocery.git
- Enter to the project folder
cd rideco-grocery/
- Create your virtualenv
python3 -m venv venv
, and activate itsource venv/bin/activate
- Install dependencies
pip install -r requirements.txt
- Run application migrations
python3 manage.py migrate
- [OPTIONAL] Create a super user
python3 manage.py createsuperuser
- Run the application server
python3 manage.py runserver
- Test the GraphQL api in the
/api
endpoint
By default the application will use an sqlite3
database, but if the DATABASE_URL
environment variable is provided then
it will connect to this one instead. The DATABASE_URL
environment variable must have this format:
postgres://USER:PASSWORD@HOST:PORT/NAME
. Currently it only supports postgres
database. For using mongodb
or mysql
databases installing the pip
packages for each driver is required.
- Run application Tests + coverage
python3 manage.py test
By default the application will obtain the DEBUG
variable value from an environment variable. If it is not defined it
will fallback to False
by default. To run the server with DEBUG
enabled, provide the DEBUG
environment variable with
True
.
By default the server will not allow requests from different domain(only from localhost:3000
), in order to override
this behavior the CORS_ORIGIN_ALLOW_ALL
environment variable needs to be set to True
before running the server. Or
setting the CORS_ORIGIN_ALLOWED_APP
to your app domain.
- Base Url: https://grocery-api.herokuapp.com/
- GraphQL API(Enable endpoint and simple view for testing api): https://grocery-api.herokuapp.com/api