Install |
---|
Add PO Projects to your installed apps in settings : : |
|
|
|
|
|
Then import its default settings : : |
|
If needed you can override some of its settings, see the original file to watch about available settings. |
Finally mount its urls in your main |
|
|
|
|
|
Use messages |
Some forms supports optional usage of Django's messages framework if it's enabled in your settings, defaut settings file created by Django's commandline tool startproject
allready do it for you, see the Django's documentation for more details.
To enable the rest API you will have to install djangorestframework in your settings : :
INSTALLED_APPS = (
...
'rest_framework'
...
)
REST_FRAMEWORK = {
'PAGINATE_BY': 10,
# Use hyperlinked styles by default.
# Only used if the `serializer_class` attribute is not set on a view.
'DEFAULT_MODEL_SERIALIZER_CLASS': (
'rest_framework.serializers.HyperlinkedModelSerializer',
),
# 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.DjangoModelPermissionsOrAnonReadOnly',
),
}
And mount it in your urls.py
: :
urlpatterns = patterns('',
...
(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
...
)
And so a rest API will be available on : :
/po/rest/
It is browsable for authenticated users with admin rights (is_staff
on True), also the client will need to access to the API with an user accounts with the admin rights.
PO-Projects-client is the client to use the API from your project.