https://github.com/clayrisser/drf-imo
IMO the perfect drf (django rest framework) setup
https://github.com/clayrisser/drf-imo
api django docker framework make production rest
Last synced: 9 months ago
JSON representation
IMO the perfect drf (django rest framework) setup
- Host: GitHub
- URL: https://github.com/clayrisser/drf-imo
- Owner: clayrisser
- Created: 2017-04-04T17:04:00.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2023-07-07T11:44:43.000Z (almost 3 years ago)
- Last Synced: 2025-07-24T20:54:18.560Z (9 months ago)
- Topics: api, django, docker, framework, make, production, rest
- Language: Python
- Homepage:
- Size: 1.26 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# drf-imo

## Setup
```
git clone git@github.com:homies-io/realtytopia-backend.git && cd realtytopia-backend
make start
```
## Documentation
You can reference the [test view](http://localhost:8000/api/v1/test) to see how I am
using services and config.
### Services
In order to keep the codebase DRY (don't repeat yourself), I encapsulate the logic
in services.
### Config
Config settings not related to the runtime of the framework go in the api/config.py file.
This would include things like API keys, but would not include settings like database
configuration. Runtime configuration is reserved for realtytopia/settings.py file. Always
make sure config settings can be overridden with environment variables.
## Packages
To install pip packages, run the following
```
env/bin/pip install
make freeze
```
Because it is a localenv, you must run pip from `env/bin/pip`. Running `make freeze` updates
the requirements.txt.
## Production
You can test the platform in production by building a docker container. Run the following
to build the realtytopia/backend:latest docker container.
```
make
```
## Makefile
I've included several helpful make commands to ease the development and testing process.
* `make`: Builds production docker image
* `make start`: Runs development mode
* `make freeze`: Updates requirements.txt (used to know what pip packages to get)
* `make pull`: Pull's docker image from dockerhub (Not setup yet)
* `make push`: Pushes docker image to dockerhub (Not setup yet)
* `make clean`: Cleans the repository