summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks2011-10-25 03:27:35 +0200
committerÉtienne Loks2011-10-25 03:27:35 +0200
commit0d930f95701fbbc9b5b7fb9bc28c3a664a600f9a (patch)
treea8626b155044fddd21933626b1b6a052e7b9ad48
parent023f8571e1386a08e25d779252c221ca939d1f1d (diff)
Correct last references to BASE_SITE (refs #309) - Change documentation to ReST - Use Sphinx for documentation
-rw-r--r--.gitignore1
-rw-r--r--docs/Makefile130
-rw-r--r--docs/source/conf.py216
-rw-r--r--docs/source/index.rst22
-rw-r--r--docs/source/install.rst195
-rw-r--r--papillon/polls/feeds.py13
-rw-r--r--papillon/polls/views.py6
-rw-r--r--papillon/settings.py.tpl8
-rw-r--r--papillon/templates/edit.html6
9 files changed, 586 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index 0363bf8..39de9ea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
*.swp
*.mo
papillon/settings.py
+docs/build/*
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..8b549f5
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,130 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ -rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Papillon.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Papillon.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/Papillon"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Papillon"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ make -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/docs/source/conf.py b/docs/source/conf.py
new file mode 100644
index 0000000..f25e299
--- /dev/null
+++ b/docs/source/conf.py
@@ -0,0 +1,216 @@
+# -*- coding: utf-8 -*-
+#
+# Papillon documentation build configuration file, created by
+# sphinx-quickstart on Tue Oct 25 01:19:41 2011.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = []
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'Papillon'
+copyright = u'2011, Étienne Loks'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.3'
+# The full version, including alpha/beta/rc tags.
+release = '0.3'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = []
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'Papillondoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'Papillon.tex', u'Papillon Documentation',
+ u'Étienne Loks', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'papillon', u'Papillon Documentation',
+ [u'Étienne Loks'], 1)
+]
diff --git a/docs/source/index.rst b/docs/source/index.rst
new file mode 100644
index 0000000..9be220e
--- /dev/null
+++ b/docs/source/index.rst
@@ -0,0 +1,22 @@
+.. Papillon documentation master file, created by
+ sphinx-quickstart on Tue Oct 25 01:19:41 2011.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Welcome to Papillon's documentation!
+====================================
+
+Contents:
+
+.. toctree::
+ :maxdepth: 3
+
+ install
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff --git a/docs/source/install.rst b/docs/source/install.rst
new file mode 100644
index 0000000..5a7ef6f
--- /dev/null
+++ b/docs/source/install.rst
@@ -0,0 +1,195 @@
+.. -*- coding: utf-8 -*-
+
+=====================
+Papillon installation
+=====================
+
+:Author: Étienne Loks
+:Date: 2011-10-25
+:Copyright: CC-BY 3.0
+
+This document presents the installation of Ishtar on a machine with GNU/Linux.
+Instruction are given for Debian but they are easy to adapt to other distribution.
+
+.. contents::
+
+Requirements
+------------
+
+ - `apache <http://www.apache.org/>`_ version 2.x (or another webserver)
+
+ - `python <http://www.python.org/>`_ versions 2.6 or superior
+
+ - `python-markdown <http://sourceforge.net/projects/python-markdown/>`_
+
+ - `django <http://www.djangoproject.com/>`_ version 1.2
+
+ - `django-south <http://south.aeracode.org/>`_ version 0.7
+
+ - `gettext <http://www.gnu.org/software/gettext/>`_
+
+
+
+The simple way to obtain theses elements is to get package from your favourite linux distribution.
+
+For instance the packages for Debian squeeze are get with::
+
+ $ sudo apt-get install python python-django python-django-south
+ $ sudo apt-get install python-markdown gettext apache2 libapache2-mod-python
+
+Otherwise refer to the sites of these applications.
+Optionnal requesite:
+
+ - `tinymce <http://tinymce.moxiecode.com/>`_: Javascript WYSIWYG Editor. If you want to use it don't forget to edit TINYMCE_URL in settings.py.
+
+
+Getting the sources
+-------------------
+
+The last "stable" version is available in this `directory <http://www.peacefrogs.net/download/>`.
+
+Another solution is to get it from the git repository (inside /var/local/django/ if you want to strictly follow this HOWTO)::
+
+ $ git clone git://www.peacefrogs.net/git/papillon
+ $ cd papillon
+ $ git tag -l # list tagged versions
+ $ git checkout v0.3 # checkout the desired version
+
+Install the sources
+-------------------
+
+If necessary unpack then move the sources in a directory readable to the apache user (www-data in Debian)::
+
+ sudo mkdir /var/local/django
+ cd /var/local/django
+ sudo tar xvjf /home/etienne/papillon-last.tar.bz2
+ cd /var/local/django/papillon
+ sudo chown -R etienne:www-data papillon
+
+
+In your Papillon application directory create settings.py to fit to your configuration.
+A base template is provided (settings.py.tpl). The main parameters to change are pointed here::
+
+ $ cd /var/local/papillon/papillon/
+ $ PAPILLON_DIR=`pwd`
+ $ cp settings.py.tpl settings.py
+ $ nano settings.py
+ ####
+ EXTRA_URL = '' # extra_url path
+
+ MAX_COMMENT_NB = 20 # max number of comments by poll - 0 to disable comments
+ ALLOW_FRONTPAGE_POLL = False # disabled is recommanded for public instance
+
+ (...)
+ DATABASES = {
+ 'default': {
+ 'ENGINE': 'sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+ 'NAME': 'papillon', # Or path to database file if using sqlite3.
+ 'USER': '', # Not used with sqlite3.
+ 'PASSWORD': '', # Not used with sqlite3.
+ 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
+ 'PORT': '', # Set to empty string for default. Not used with sqlite3.
+ }
+ }
+ SECRET_KEY = 'replace_this_with_something_else'
+ # if you have set an EXTRA_URL set the full path
+ MEDIA_URL = '/static/'
+ # if you have set an EXTRA_URL set the full path
+ ADMIN_MEDIA_PREFIX = '/media/'
+ (...)
+
+If your papillon is going to be used by many people, it is recommanded to use a "real" database like mysql or postgresql.
+
+In the directory Papillon, put up a symbolic link to the basic styles django (change the path depending on your installation of django)::
+
+ $ ln -s /usr/share/python-support/python-django/django/contrib/admin/media/ .
+
+
+Database initialisation
+-----------------------
+In the directory Papillon simply::
+
+ $ ./manage.py syncdb
+
+Answer the questions to create an administrator (administration pages can be found at: http://where_is_papillon/admin) then::
+
+ $ ./manage.py migrate polls
+
+If you use sqlite (default database) give the write rights on the database file to the apache user::
+
+ $ chmod g+w papillon.db
+ $ chmod g+w .
+
+Compiling languages
+-------------------
+
+If your language is available in the locale directory of Papillon, you will just need to get it compiled. Still being in the papillon directory, this can be done with (here, "de" stands for german. Replace it with the appropriate language code)::
+
+ django-admin compilemessages -l de
+
+If your language is not available, feel free to create the default po files and to submit it, contributions are well appreciated. Procedure is as follows.
+
+You first need to create the default po file (of course, replace "de" according to the language you chose to create)::
+
+ django-admin makemessages -l de
+
+There should now be a django.po file in locale/de/LC_MESSAGES. Complete it with your translation.
+
+Now that the translation file is completed, just compile it the same way you would have if the language file was already available.
+
+Webserver configuration
+-----------------------
+
+Only Apache configuration is given. Papillon can probably be run on other
+webserver feel free to complete this documentation.
+
+Apache mod_python configuration
+*******************************
+
+Create and edit a configuration file for Papillon::
+
+ sudo vim /etc/apache2/sites-available/papillon
+
+
+Insert Apache directives for your installation::
+
+ # part of the address after the root of your site: EXTRA_URL
+ <Location "/papillon/">
+ # directory path to the father of the installation of Papillon
+ PythonPath "['/var/local/django/papillon/'] + sys.path"
+ SetHandler python-program
+ PythonHandler django.core.handlers.modpython
+ SetEnv DJANGO_SETTINGS_MODULE papillon.settings
+ # set it to on or off if in test or production environment
+ PythonDebug On
+ # put differents interpreter names if you deploy several Papillon
+ PythonInterpreter papillon
+ </Location>
+
+Or if you want to use a virtual domain::
+
+ <VirtualHost *:80>
+ ServerName papillon.youdomain.net
+ # directory path to the father of the installation of Papillon
+ PythonPath "['/var/local/django/papillon/'] + sys.path"
+ SetHandler python-program
+ PythonHandler django.core.handlers.modpython
+ SetEnv DJANGO_SETTINGS_MODULE papillon.settings
+ # set it to on or off if in test or production environment
+ PythonDebug On
+ # put differents interpreter names if you deploy several Papillon
+ PythonInterpreter papillon
+ </VirtualHost>
+
+Active this site, reload Apache and now your Papillon "can fly"::
+
+ sudo a2ensite papillon
+ sudo /etc/init.d/apache2 reload
+
+
+Post-installation
+-----------------
+
+To configure categories go to the administration interface at http://where_is_papillon/admin .
+
+
diff --git a/papillon/polls/feeds.py b/papillon/polls/feeds.py
index 5c11b9c..126dbe0 100644
--- a/papillon/polls/feeds.py
+++ b/papillon/polls/feeds.py
@@ -19,11 +19,11 @@
import time
+from django.core.urlresolvers import reverse
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.syndication.feeds import Feed
from django.utils.translation import gettext_lazy as _
-from papillon.settings import BASE_SITE
from papillon.polls.models import Poll, Vote, Voter
@@ -39,14 +39,19 @@ class PollLatestEntries(Feed):
def link(self, obj):
if not obj:
raise FeedDoesNotExist
- return BASE_SITE + "/poll/" + obj.base_url
+ uri = self.request.build_absolute_uri(reverse('poll',
+ args=[obj.base_url]))
+ return uri
def description(self, obj):
return obj.description
def item_link(self, voter):
- url = "%s/poll/%s_%d" % (BASE_SITE, voter.poll.base_url,
- time.mktime(voter.modification_date.timetuple()))
+ url = reverse('poll', args=[voter.poll.base_url])
+ url = self.request.build_absolute_uri(reverse('poll',
+ args=[voter.poll.base_url]))
+ url = "%s_%d" % (url[:-1], # dirty...
+ time.mktime(voter.modification_date.timetuple()))
return url
def items(self, obj):
diff --git a/papillon/polls/views.py b/papillon/polls/views.py
index 26b3b34..43ff37f 100644
--- a/papillon/polls/views.py
+++ b/papillon/polls/views.py
@@ -133,6 +133,12 @@ def edit(request, admin_url):
form = Form(instance=poll)
response_dct['form'] = form
response_dct['poll'] = poll
+ response_dct['base_url'] = request.build_absolute_uri(reverse('poll',
+ args=[poll.base_url]))
+ response_dct['edit_url'] = request.build_absolute_uri(reverse('edit',
+ args=[poll.admin_url]))
+ response_dct['choices_url'] = request.build_absolute_uri(reverse(
+ 'edit_choices_admin', args=[poll.admin_url]))
return render_to_response('edit.html', response_dct)
def editChoicesAdmin(request, admin_url):
diff --git a/papillon/settings.py.tpl b/papillon/settings.py.tpl
index f83dcb2..cecfb45 100644
--- a/papillon/settings.py.tpl
+++ b/papillon/settings.py.tpl
@@ -9,9 +9,7 @@ TEMPLATE_DEBUG = DEBUG
import os.path
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
-SERVER_URL = 'http://localhost/'
EXTRA_URL = 'papillon/'
-BASE_SITE = SERVER_URL + EXTRA_URL
TINYMCE_URL = 'http://localhost/tinymce/'
MAX_COMMENT_NB = 10 # max number of comments by poll - 0 to disable comments
@@ -62,12 +60,14 @@ MEDIA_ROOT = PROJECT_PATH + '/static/'
# URL that handles the media served from MEDIA_ROOT.
# Example: "http://media.lawrence.com"
-MEDIA_URL = BASE_SITE + 'static/'
+# if you have set an EXTRA_URL set the full path
+MEDIA_URL = '/static/'
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
-ADMIN_MEDIA_PREFIX = BASE_SITE + 'media/'
+# if you have set an EXTRA_URL set the full path
+ADMIN_MEDIA_PREFIX = '/media/'
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'replace_this_with_something_else'
diff --git a/papillon/templates/edit.html b/papillon/templates/edit.html
index b2b38a5..2f77a7e 100644
--- a/papillon/templates/edit.html
+++ b/papillon/templates/edit.html
@@ -16,7 +16,7 @@
<tr>
<td><label>{% trans "Poll url" %}</label></td>
<td>
-<a href='{% url poll poll.base_url%}'>{% url poll poll.base_url%}</a>
+<a href='{% url poll poll.base_url%}'>{{ base_url }}</a>
</td>
<td class='form_description'><p>
{% trans "Copy this address and send it to voters who want to participate to this poll" %}
@@ -25,7 +25,7 @@
<tr>
<td><label>{% trans "Administration url" %}</label></td>
<td>
-<a href='{% url edit poll.admin_url %}'>{% url edit poll.admin_url %}</a>
+<a href='{% url edit poll.admin_url %}'>{{ edit_url }}</a>
</td>
<td class='form_description'><p>
{% trans "Address to modify the current poll" %}
@@ -34,7 +34,7 @@
<tr>
<td><label>{% trans "Choices administration url" %}</label></td>
<td>
-<a href='{% url edit_choices_admin poll.admin_url %}'>{% url edit_choices_admin poll.admin_url %}</a>
+<a href='{% url edit_choices_admin poll.admin_url %}'>{{choices_url }}</a>
</td>
<td class='form_description'><p>
{% trans "Address to modify choices of the current poll." %}