Skip to content

rnovec/petgram-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Petgram Django REST API

This a Django 3.0+ project for Software House Mérida Development Challenge.

Features

  • Django 3.0+
  • Uses Virtualenv - Tool to create isolated Python environments.
  • Django REST Framework - Powerful and flexible toolkit for building Web APIs.
  • Django REST Registration - User registration REST API, based on Django-REST-Framework.
  • Boto3 - The Amazon Web Services (AWS) SDK for Python.
  • Simple JWT - A JSON Web Token authentication plugin for the Django REST Framework.
  • Procfile for running gunicorn with New Relic's Python agent.
  • PostgreSQL database support with psycopg2.

Prerequisites

  • Python 3.5>
  • Virtualenv

How to install

$ virtualenv python=python3 venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Environment variables

These settings are used on development and production environments.

DJANGO_SECRET_KEY=your-django-secret-key
DJANGO_ALLOWED_HOSTS='localhost 0.0.0.0 127.0.0.1 [::1]'
DJANGO_ALLOWED_ORIGINS='http://localhost:3000'
DJANGO_DEBUG=1
ADMIN_ENABLED=1
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-access-key
AWS_STORAGE_BUCKET_NAME=your-bucket-name
DATABASE_URL=postgres://postgres:s3cr3t@localhost:5432/mydb

See .env.example

Deployment

Database setup

$ python manage.py migrate
$ python manage.py createsuperuser

Run project

$ python manage.py runserver

API

License

The MIT License (MIT)

Copyright (c) 2020 Raúl Novelo

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.