Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django REST Framework Security and Customization Set Up Token Auth

setup ath token

im stuck

Django settings for myproject project.

Generated by 'django-admin startproject' using Django 1.8.2.

For more information on this file, see

For the full list of settings and their values, see

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'oucj-v(ep5%p!qk1svb9gsnvd4z#t6cv+bqd+1d#!(!e$23(_3'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True


# Application definition



        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [

WSGI_APPLICATION = 'myproject.wsgi.application'

# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),

# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/



USE_I18N = True

USE_L10N = True

USE_TZ = True

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/
STATIC_URL = '/static/'
    os.path.join(BASE_DIR, 'assets'),

ROOT_URLCONF = 'myproject.urls'


3 Answers

So at the bottom of your settings.py, under DEFAULT_AUTHENTICATION_CLASSES you'll need to change




Sometimes configuration in settings.py can be confusing when you're starting out. Don't be afraid to rewatch videos, or check the documentation!

Hope this helps. Good luck!

i got that one right but the following I need you to add throttling rates for anonymous and authenticated users.

Anonymous users should be able to make 500 requests per day. Authenticated users should get 100 per hour.

Hi, Savious. Could you be more specific with your question so we can help you?

i tried to work it out but i failed