mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-03-20 09:54:15 +03:00
Added a fixture so that the users default have a user to login with and play with permissions.
This commit is contained in:
parent
409ee533fd
commit
ddd36206bc
12
examples/permissionsexample/fixtures/initial_data.yaml
Normal file
12
examples/permissionsexample/fixtures/initial_data.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
- fields:
|
||||
first_name: ''
|
||||
groups: []
|
||||
is_active: true
|
||||
is_staff: true
|
||||
is_superuser: true
|
||||
last_name: ''
|
||||
password: sha1$b3dff$671b4ab97f2714446da32670d27576614e176758
|
||||
user_permissions: []
|
||||
username: test
|
||||
model: auth.user
|
||||
pk: 2
|
1
examples/permissionsexample/models.py
Normal file
1
examples/permissionsexample/models.py
Normal file
|
@ -0,0 +1 @@
|
|||
#for fixture loading
|
|
@ -2,5 +2,5 @@ from django.conf.urls.defaults import patterns, url
|
|||
from permissionsexample.views import ThrottlingExampleView
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^$', ThrottlingExampleView.as_view(), name='throttled-resource'),
|
||||
url(r'^$', ThrottlingExampleView.as_view(), name='throttled-resource'),
|
||||
)
|
||||
|
|
|
@ -5,4 +5,5 @@ wsgiref==0.1.2
|
|||
Pygments==1.4
|
||||
httplib2==0.6.0
|
||||
Markdown==2.0.3
|
||||
Pyyaml
|
||||
|
||||
|
|
|
@ -89,6 +89,12 @@ TEMPLATE_DIRS = (
|
|||
# Don't forget to use absolute paths, not relative paths.
|
||||
)
|
||||
|
||||
# for loading initial data
|
||||
##SERIALIZATION_MODULES = {
|
||||
# 'yml': "django.core.serializers.pyyaml"
|
||||
|
||||
#}
|
||||
|
||||
|
||||
INSTALLED_APPS = (
|
||||
'django.contrib.auth',
|
||||
|
@ -104,6 +110,7 @@ INSTALLED_APPS = (
|
|||
'objectstore',
|
||||
'pygments_api',
|
||||
'blogpost',
|
||||
'permissionsexample',
|
||||
)
|
||||
|
||||
import os
|
||||
|
|
Loading…
Reference in New Issue
Block a user