Giter VIP home page Giter VIP logo

django-mobile-app's Introduction

Django Mobile App

An easy to use project template in Django 1.11, focused on a custom backend for a mobile app.

General

This repo acts as a decent starting point for those who are looking for a custom backend deployment for their mobile app. It includes a full-serving django project which exposes a RESTful API, manages user instances and is highly configurable.

In fact, this project is not a package that you can include in your project and use right-away, but it's a project template that you can download, extend and keep working on it as a base for your new project.

3rd-party apps it includes:

  • django-storages, to store files in AWS S3 (the most commonly used block storage)
  • django-allauth, for social media authentication
  • django-anymail[mailgun], to send transactional emails using Mailgun (first 10k messages/month are free)
  • djangorestframework, for the RESTful API
  • django-rest-swagger, to automatically generate documentation for your RESTful API endpoints
  • django-rest-auth, to provide social media authentication over the API
  • django-filters, which provides filtering capabilities in the DRF API views
  • django-guardian, for custom object or model level permissions
  • celery, for background tasks handling. By default, it's expected to be used for device registration on the AWS SNS service.
  • django-extensions, offering a collection of custom extensions for Django

Prerequisites

  • Python3
  • Git
  • pip
  • virtualenv (recommended)

How to use

  1. Clone this repo on your local machine:
git clone https://github.com/intelligems/django-mobile-app
  1. We strongly advise to create a Python virtual environment and install the project requirements in there:
mkvirtualenv <env-name> --python=`which python3`
  1. Install project requirements inside your newly created local virtual environment:
pip install -r requirements.txt
  1. It's time to perform your first database migrations - no worries, we have included them too:
python manage.py migrate
  1. Run the server!
python manage.py runserver 0.0.0.0:80

Registering Push Devices

For the push_devices app usage, you are expected to use the AbstractMobileDevice abstract model. You can extend it and add any fields you wish, but you are not allowed (by Django) to override the same fields that the AbstractMobileDevice model uses.

In order to create a push device, inside the create view of your devices' API, import the sns registration method

from core.mobile_devices.tasks import register_device_on_sns

and use the delay method to register the newly created device on SNS. This will assign the ARN endpoint on the device model, so that you will be able to publish push notifications to your registered push device.

For example:

device = Device.object.create(**data)
register_device_on_sns.delay(device)

django-mobile-app's People

Watchers

 avatar  avatar

Forkers

yomravi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.