InstallationΒΆ
Install from PyPI with easy_install
or pip
:
pip install django-private-files
or download the source and do:
python setup.py install
or if you want to hack on the code symlink to it in your site-packages:
python setup.py develop
In your settings.py INSTALLED_APPS
add private_files
.
You must specify a protection method (basic
, nginx
or xsendfile
) in your settings.py
FILE_PROTECTION_METHOD = 'basic'
In your urls.py add the private_files
application urls:
from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^private_files/', include('private_files.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)