- Python 3.10
- PostgreSQL
- Install PostgreSQL
- Start PostgreSQL
brew services start postgresql
- Access the PostgreSQL CLI
psql -U postgres
- Create the database
CREATE DATABASE <database_name>;
- Install Python 3.10
- Clone the project
- Open the project in a terminal and create a Python virtual environment
python -m venv venv
- Activate your virtual environment
source venv/bin/activate
- Install dependencies
pip install -r requirements.txt
- Create your
.env
filecp .env.development .env
- Configure your
.env
variables - Create a super user
python manage.py createsuperuser
- Migrate database models
python manage.py makemigrations
python manage.py migrate
- Run the server
python manage.py runserver
├── app
└── devume
├── authentication
├── models
├── permissions
├── serializers
├── tests
├── utils
└── views
app
- Containssettings.py
andurls.py
devume/authentication
- custom authentication classes for API key authentication and bearer token authenticationdevume/models
- database modelsdevume/permissions
- custom permission classesdevume/serializers
- data serializers for each modelsdevume/tests
- unit tests. Can be run withpython manage.py test
. Tests are run upon opening a PR and coverage is reported to CodeCovdevume/utils
- utility functions. Contains general exception handlerdevume/views
- all application views
Devumé supports Bearer Token authentication, session authentication, and API key authentication. For most requests, you will need to use API key authentication. In order to generate an API key:
- Get the Bearer token for your super user with
POST http://localhost:8000/api/token
with your username and password in the JSON body:
{
'username': <SuperUserUsername>,
'password': <SuperUserPassword>
}
-
Create an API key using your bearer token for authentication with
POST http://localhost:8000/api/key/create
-
The API key can be used within a
x-api-key
header stored in the frontend.env
for authentication or for testing requests
Pre-commit is configured to run Flake8 and Black to ensure code consistency.
Anyone is welcome to contribute to this repository. If you'd like to contribute, please review the open issues and open a corresponding PR for your change. Pre-commit hooks will be run upon opening your PR and will be required to pass before it can be merged.