Skip to main content

Collection of magics.

Project description

https://travis-ci.org/michaelhenry/codebehind.svg?branch=master https://img.shields.io/pypi/v/codebehind.svg https://img.shields.io/badge/contact-@michaelhenry119-blue.svg?style=flat

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)),
    ]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codebehind-1.4.17.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

codebehind-1.4.17-py2-none-any.whl (9.7 kB view details)

Uploaded Python 2

File details

Details for the file codebehind-1.4.17.tar.gz.

File metadata

File hashes

Hashes for codebehind-1.4.17.tar.gz
Algorithm Hash digest
SHA256 bd5bd307c1133e154c44bba68eda9aae188d6e9e06bb8be8e60ee09614c3c035
MD5 1e247b04ca59797093331fef2b099878
BLAKE2b-256 1f51e51f63b29905ea296800c32af995582342f9c05e39f3760adf61f58a6a8a

See more details on using hashes here.

File details

Details for the file codebehind-1.4.17-py2-none-any.whl.

File metadata

File hashes

Hashes for codebehind-1.4.17-py2-none-any.whl
Algorithm Hash digest
SHA256 ed5147c1f377945f2784924fad9cd0794f3932e8246f2ecbcdbcffb6a6c79fd2
MD5 f49540c045a54b2d175cb8f1b9f9510e
BLAKE2b-256 6eb9d8cd5006ae553d216d767b58a20f4aa1749b9bbd21206732b014120eaee4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page