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.12.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 2

File details

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

File metadata

  • Download URL: codebehind-1.4.12.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for codebehind-1.4.12.tar.gz
Algorithm Hash digest
SHA256 494d4d475166cfa1d6489a03353d6b58a3b2816b2f3fe30a10b6c4089784a8c7
MD5 a1939362149447db190a4d9a5629c476
BLAKE2b-256 85691410075c0e2380d228e1c14752505fb7aaaa3a88bd8ee712be9721f6d74b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codebehind-1.4.12-py2-none-any.whl
Algorithm Hash digest
SHA256 9964d8ea66f098c79cf7d8f2d1cf65cd8a152e33c4c6aa73a83a3d39f6a7a4dc
MD5 d0b4540edbca84ce4571916a0b31ae1d
BLAKE2b-256 fa440e961102f528054b06d34712ea7c810eb86718aa64ec363f9f0c58f349f8

See more details on using hashes here.

Supported by

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