Commit 5c4f5d5b authored by Christophe Siraut's avatar Christophe Siraut

Migrate to Django 1.4

parent 137ecc74
......@@ -3,7 +3,7 @@
{% block content %}
<h1>{% trans "Change email" %}</h1>
<form method="post" action="{% url auth_email_change %}">
<form method="post" action="{% url auth_email_change %}">{% csrf_token %}
<div class="wide">{{ form.as_p }}</div>
<p><input type="submit" value="{% trans "Save" %}" /></p>
</form>
......
......@@ -5,7 +5,7 @@
<h1>{% trans "Authorization" %}</h1>
<p>{% trans "You should login to gain access to all site features. If you have not account" %} <a href="{% url registration_register %}">{% trans "register" %}</a> {% trans "please" %}</p>
<br />
<form class="login-form" method="post">
<form class="login-form" method="post">{% csrf_token %}
<div class="wide">{{ form.as_p }}
<br />
<p><label for="nothing"> &nbsp; </label> <input type="submit" value=" {% trans 'Login' %} " /></p>
......
......@@ -3,7 +3,7 @@
{% block content %}
<h1>{% trans "New password" %}</h1>
<form method="post" action="{% url auth_password_change %}">
<form method="post" action="{% url auth_password_change %}"> {% csrf_token %}
<div class="wide">{{ form.as_p }}</div>
<p><input type="submit" value="{% trans "Save" %}" /></p>
</form>
......
......@@ -3,7 +3,7 @@
{% block content %}
<h1>{% trans "Password restore" %}</h1>
<form method="post">
<form method="post"> {% csrf_token %}
<div class="wide">{{ form.as_p }}</div>
<p><input type="submit" value="{% trans "Continue" %}"/></p>
</form>
......
......@@ -3,7 +3,7 @@
{% block content %}
<h1>{% trans "Registration" %}</h1>
<form method="post">
<form method="post"> {% csrf_token %}
<div class="wide">{{ form.as_p }}</div>
<p><input type="submit" value="{% trans "Continue" %}" /></p>
</form>
......
......@@ -18,12 +18,16 @@ SITE = 'http://nuages.domainepublic.net/'
#if DEBUG:
# SITE = 'http://127.0.0.1:8000/'
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = os.path.join(PROJECT_DIR, 'nuages.sqlite') # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': os.path.join(PROJECT_DIR, 'nuages.sqlite'), # 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.
},
}
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
......@@ -48,39 +52,59 @@ SITE_ID = 1
# to load the internationalization machinery.
USE_I18N = True
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
# Change this for production
MEDIA_ROOT = '/var/www/nuages/static/'
if DEBUG:
MEDIA_ROOT = os.path.join(PROJECT_DIR, 'static')
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
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 = '/media/'
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = ''
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(PROJECT_DIR, 'static'),
)
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'yt$kh#^*y6p4&7_+3940u4j(91abrdko7hvtwc*)1w8f29+p&9'
SECRET_KEY = 'secret'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.load_template_source',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'request.middleware.RequestMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
#'request.middleware.RequestMiddleware',
'urlauth.middleware.AuthKeyMiddleware'
)
......@@ -98,6 +122,8 @@ INSTALLED_APPS = (
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'sondage',
......
......@@ -91,10 +91,12 @@ form label {
width: 150px;
}
/*
input, textarea {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
*/
input:focus, textarea:focus {
background-color: #c3d4e3; /* #f2f1f0 */
......
......@@ -8,8 +8,8 @@
{% block head %}{% endblock %}
<!-- Django stylesheet -->
<link rel="stylesheet" type="text/css" href="/media/css/base.css"/>
<link rel="stylesheet" type="text/css" href="/media/css/forms.css"/>
<link rel="stylesheet" type="text/css" href="/static/admin/css/base.css"/>
<link rel="stylesheet" type="text/css" href="/static/admin/css/forms.css"/>
<!-- Nuages stylesheet -->
<link rel="stylesheet" href="/static/css/nuages.css" />
......@@ -33,7 +33,7 @@
<!--img src="/static/images/info.png" alt="info" "-->&nbsp; {{ error_message }}
{% endif %}
<form style="display:inline" name="langForm" action="/i18n/setlang/" method="post">
<form style="display:inline" name="langForm" action="/i18n/setlang/" method="post">{% csrf_token %}
<input name="next" type="hidden" value="" />
<select name="language" onChange="langForm.submit()" />
<option value="#" />{{ LANGUAGE_CODE }}</option>
......
......@@ -15,7 +15,7 @@
<ul>
<li>Provide username and password:
<form action="" method="post">
<form action="" method="post"> {% csrf_token %}
<label for="username"></label>
<input type="text" name="username" value="" id="username">
<label for="password"></label>
......
......@@ -13,7 +13,7 @@
<div id="subcontent">
<form action="" method="post">
<form action="" method="post"> {% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Create the account">
</form>
......
......@@ -112,7 +112,7 @@
<br />
<div class="indent">
<form method="post" action="">
<form method="post" action=""> {% csrf_token %}
<table id="dateChoice" class="form-container">
<tbody>
<thead>
......
......@@ -47,7 +47,7 @@
</tr>
<tr>
<form action="/{{ object.id }}/vote/" method="post">
<form action="/{{ object.id }}/vote/" method="post"> {% csrf_token %}
<td class='names' title=" Fill in your name ">
<div class="blue">{% trans "Your name:" %}</div>
{{ form.as_p }}
......
......@@ -18,7 +18,7 @@
{% block content %}
<br />
<form action="" method="post">
<form action="" method="post"> {% csrf_token %}
<table>
{{ form.as_table }}
......
......@@ -7,7 +7,7 @@
<h3>Sondage: {{object}}</h3>
<p class="info">{{object.description}}</p>
<form method="post" action="">
<form method="post" action=""> {% csrf_token %}
<table id="dateChoice" class="form-container">
<tbody>
<thead>
......
......@@ -46,6 +46,7 @@ urlpatterns = patterns('',
(r'^(?P<poll_id>\w{4})/clear/', 'sondage.userviews.clear_cookie'),
)
'''
from django.conf import settings
if settings.DEBUG:
......@@ -54,4 +55,4 @@ if settings.DEBUG:
'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': False}),
)
'''
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment