summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--papillon/locale/fr/LC_MESSAGES/django.po2
-rwxr-xr-xpapillon/manage.py27
-rw-r--r--papillon/papillon/settings.py24
-rw-r--r--papillon/polls/feeds.py2
-rw-r--r--papillon/polls/templates/polls/editChoicesAdmin.html2
-rw-r--r--papillon/polls/templates/polls/editChoicesUser.html2
-rw-r--r--papillon/polls/views.py14
-rw-r--r--requirements.txt4
8 files changed, 47 insertions, 30 deletions
diff --git a/papillon/locale/fr/LC_MESSAGES/django.po b/papillon/locale/fr/LC_MESSAGES/django.po
index 003dfc1..740018c 100644
--- a/papillon/locale/fr/LC_MESSAGES/django.po
+++ b/papillon/locale/fr/LC_MESSAGES/django.po
@@ -345,7 +345,7 @@ msgstr "Créer un sondage"
#: templates/main.html:7
msgid ""
-"Create a new sondage for take a decision, find a date for a meeting, etc."
+"Create a new poll for having a decision, find a date for a meeting, etc."
msgstr ""
"Créer un nouveau sondage pour prendre une décision, trouver une date pour "
"une réunion, etc."
diff --git a/papillon/manage.py b/papillon/manage.py
index bcdd55e..3bd32f1 100755
--- a/papillon/manage.py
+++ b/papillon/manage.py
@@ -1,11 +1,22 @@
#!/usr/bin/python
-from django.core.management import execute_manager
-try:
- import settings # Assumed to be in the same directory.
-except ImportError:
- import sys
- sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
- sys.exit(1)
+import os
+import sys
+# from django.core.management import execute_manager
+# try:
+ # import settings # Assumed to be in the same directory.
+# except ImportError:
+
+ # import sys
+ # sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
+ # sys.exit(1)
+
+# if __name__ == "__main__":
+ # execute_manager(settings)
if __name__ == "__main__":
- execute_manager(settings)
+
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "papillon.settings")
+
+ from django.core.management import execute_from_command_line
+
+ execute_from_command_line(sys.argv) \ No newline at end of file
diff --git a/papillon/papillon/settings.py b/papillon/papillon/settings.py
index ff043c0..559501c 100644
--- a/papillon/papillon/settings.py
+++ b/papillon/papillon/settings.py
@@ -19,10 +19,10 @@ SECRET_KEY = 'lpmtkrbugm0=t*kgl94-!pm38ua925o0yvzjc!=*mct-1r(io+'
# SECURITY WARNING: don't run with debug turned on in production!
-DEBUG = False
+DEBUG = True
TEMPLATE_DEBUG = DEBUG
-
-ALLOWED_HOSTS = []
+
+ALLOWED_HOSTS = ['localhost', '127.0.0.1']
# Application definition
@@ -45,6 +45,10 @@ TEMPLATES = [
],
},
},
+]
+
+
+
INSTALLED_APPS = (
# contribs
'django.contrib.staticfiles',
@@ -113,11 +117,14 @@ USE_TZ = True
LANGUAGES = (
('fr', 'Français'),
('en', 'English'),
+)
+
+
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.i18n",
)
-)
+
# Local time zone for this installation. Choices can be found here:
# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html
@@ -135,7 +142,6 @@ TIME_ZONE = 'Europe/Paris'
STATIC_URL = '/static/'
LOCALE_PATHS = (
-
os.path.join(BASE_DIR, 'locale/'),
)
@@ -163,7 +169,7 @@ MANAGERS = ADMINS
SITE_ID = 1
-try:
- from local_settings import *
-except ImportError, e:
- print 'Unable to load local_settings.py:', e
+# try:
+ # from local_settings import *
+# except ImportError as e:
+ # print ('Unable to load local_settings.py:', e)
diff --git a/papillon/polls/feeds.py b/papillon/polls/feeds.py
index d5fc515..34b9be1 100644
--- a/papillon/polls/feeds.py
+++ b/papillon/polls/feeds.py
@@ -26,7 +26,7 @@ from django.utils.translation import gettext_lazy as _
from django.utils.safestring import mark_safe
from django.contrib.syndication.views import FeedDoesNotExist
-from papillon.polls.models import Poll, Voter
+from polls.models import Poll, Voter
class PollLatestEntries(Feed):
diff --git a/papillon/polls/templates/polls/editChoicesAdmin.html b/papillon/polls/templates/polls/editChoicesAdmin.html
index dc0c4bd..68eb1fb 100644
--- a/papillon/polls/templates/polls/editChoicesAdmin.html
+++ b/papillon/polls/templates/polls/editChoicesAdmin.html
@@ -19,7 +19,7 @@
<a href="{% url 'edit' poll.admin_url %}"><button>{% trans "Next"%}</button></a></p>
{% endif %}
-{% include 'editChoices.html' %}
+{% include 'polls/editChoices.html' %}
{% if choices %}
<div class="new_poll" style="margin-top:20px;">
diff --git a/papillon/polls/templates/polls/editChoicesUser.html b/papillon/polls/templates/polls/editChoicesUser.html
index 88cd4fd..69a8da0 100644
--- a/papillon/polls/templates/polls/editChoicesUser.html
+++ b/papillon/polls/templates/polls/editChoicesUser.html
@@ -27,5 +27,5 @@
</table>
</div>
{% endif %}
-{% include 'editChoices.html' %}
+{% include 'polls/editChoices.html' %}
{% endblock %}
diff --git a/papillon/polls/views.py b/papillon/polls/views.py
index 990c217..88d1f8c 100644
--- a/papillon/polls/views.py
+++ b/papillon/polls/views.py
@@ -67,7 +67,7 @@ def index(request):
response_dct['categories'] = Category.objects.all()
if 'bad_poll' in request.GET:
response_dct['error'] = _("The poll requested doesn't exist (anymore?)")
- return render(request, 'main.html', response_dct,
+ return render(request, 'polls/main.html', response_dct,
context_instance=RequestContext(request))
@@ -79,7 +79,7 @@ def category(request, category_id):
category = Category.objects.get(id=int(category_id))
response_dct['category'] = category
response_dct['polls'] = Poll.objects.filter(public=True, category=category)
- return render(request, 'category.html', response_dct)
+ return render(request, 'polls/category.html', response_dct)
def create(request):
@@ -113,7 +113,7 @@ def create(request):
else:
form = CreatePollForm()
response_dct['form'] = form
- return render(request, 'create.html', response_dct)
+ return render(request, 'polls/create.html', response_dct)
def edit(request, admin_url):
@@ -145,7 +145,7 @@ def edit(request, admin_url):
reverse('edit', args=[poll.admin_url]))
response_dct['choices_url'] = request.build_absolute_uri(
reverse('edit_choices_admin', args=[poll.admin_url]))
- return render(request, 'edit.html', response_dct)
+ return render(request, 'polls/edit.html', response_dct)
def editChoicesAdmin(request, admin_url):
@@ -180,9 +180,9 @@ def editChoices(request, response_dct, admin=False):
'''Edition of choices.
'''
poll = response_dct['poll']
- tpl = 'editChoicesAdmin.html'
+ tpl = 'polls/editChoicesAdmin.html'
if not admin:
- tpl = 'editChoicesUser.html'
+ tpl = 'polls/editChoicesUser.html'
Form = ChoiceForm
if poll.dated_choices:
Form = DatedChoiceForm
@@ -509,4 +509,4 @@ def poll(request, poll_url):
response_dct['hide_vote'] = False
response_dct['form_comment'] = CommentForm()
response_dct['max_comment_nb'] = settings.MAX_COMMENT_NB
- return render(request, 'vote.html', response_dct) \ No newline at end of file
+ return render(request, 'polls/vote.html', response_dct) \ No newline at end of file
diff --git a/requirements.txt b/requirements.txt
index ffd7dbe..1de37d5 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
-django>=1.5,<1.5.99
-south>=0.7.3,<0.7.99
+django>=1.7
+
markdown==2.1