mirror of
https://github.com/jazzband/django-downloadview.git
synced 2026-03-16 22:40:25 +00:00
Improved demo project: provided initial data and a simple homepage with some links.
This commit is contained in:
parent
4f29852ddb
commit
0d2d38718e
5 changed files with 36 additions and 4 deletions
9
Makefile
9
Makefile
|
|
@ -65,12 +65,13 @@ sphinx:
|
|||
documentation: apidoc sphinx
|
||||
|
||||
|
||||
runserver:
|
||||
demo: develop
|
||||
mkdir -p var/media/document
|
||||
bin/demo syncdb --noinput
|
||||
cp $(ROOT_DIR)/demo/demoproject/download/fixtures/hello-world.txt var/media/document/
|
||||
bin/demo loaddata $(ROOT_DIR)/demo/demoproject/download/fixtures/demo.json
|
||||
bin/demo runserver
|
||||
|
||||
|
||||
demo: develop runserver
|
||||
|
||||
|
||||
release:
|
||||
bin/fullrelease
|
||||
|
|
|
|||
10
demo/demoproject/download/fixtures/demo.json
Normal file
10
demo/demoproject/download/fixtures/demo.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[
|
||||
{
|
||||
"pk": 1,
|
||||
"model": "download.document",
|
||||
"fields": {
|
||||
"slug": "hello-world",
|
||||
"file": "document/hello-world.txt"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -125,6 +125,7 @@ INSTALLED_APPS = (
|
|||
# 'django.contrib.admin',
|
||||
# Uncomment the next line to enable admin documentation:
|
||||
# 'django.contrib.admindocs',
|
||||
'demoproject',
|
||||
'demoproject.download',
|
||||
'django_nose',
|
||||
)
|
||||
|
|
|
|||
15
demo/demoproject/templates/home.html
Normal file
15
demo/demoproject/templates/home.html
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{% load url from future %}
|
||||
<html>
|
||||
<head>
|
||||
<title>django-downloadview demo</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to django-downloadview demo!</h1>
|
||||
<p>Here are some demo links. Browse the code to see how they are implemented</p>
|
||||
<ul>
|
||||
<li><a href="{% url 'download_hello_world' %}">DownloadView</a></li>
|
||||
<li><a href="{% url 'download_document' 'hello-world' %}">ObjectDownloadView</a></li>
|
||||
<li><a href="{% url 'download_document_nginx' 'hello-world' %}">ObjectDownloadView decorated with nginx X-Accel-Redirect</a> (better if served behind nginx)</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,6 +1,11 @@
|
|||
from django.conf.urls import patterns, include, url
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
|
||||
home = TemplateView.as_view(template_name='home.html')
|
||||
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^download/', include('demoproject.download.urls')),
|
||||
url(r'', home, name='home')
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue