Code Monkey home page Code Monkey logo

codebehind's Introduction

codebehind

image

image

image

Because i dont want to do the same thing all over again. If you are using Django Rest Framework, then this will might help you.

Features

  • Registration and Login
  • Different Authentication Logic (Basic , Token, HMAC Signature)
  • Basic Helpers
  • Since it use DRF, Browsable Rest API!

Quick start

  1. Add "codebehind" to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'codebehind',
        'rest_framework',
    ]
  2. Run python manage.py migrate to create the useful models.
  3. In your `*settings.py`:

    REST_FRAMEWORK = {
        # Use Django's standard `django.contrib.auth` permissions,
        # or allow read-only access for unauthenticated users.
        'DEFAULT_PERMISSION_CLASSES': (
            'rest_framework.permissions.IsAdminUser',
            'rest_framework.permissions.IsAuthenticated',
        ),
    
        'DEFAULT_AUTHENTICATION_CLASSES': (
           'codebehind.authentication.CodeBehindAuthentication',
           'rest_framework.authentication.BasicAuthentication',
           'rest_framework.authentication.SessionAuthentication',
        ),
    
        'PAGE_SIZE': 20
    }
  4. in `urls.py`:

    from rest_framework import routers
    from django.conf.urls import include, url
    from codebehind.views import UsersViewSet, GroupViewSet
    
    router = routers.DefaultRouter()
    router.register(r'users', UsersViewSet,'users')
    router.register(r'groups', GroupViewSet,'groups')
    
    urlpatterns += [
        # add this
        url(r'^v1/', include(router.urls)),
    ]

codebehind's People

Contributors

michaelhenry avatar

Watchers

 avatar  avatar  avatar

codebehind's Issues

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.