Commit f7a77ac9 authored by Christophe Siraut's avatar Christophe Siraut

Documentation. Remove SITE variable

parent da5947b8
*.sqlite
*.pyc
*~
fixture
fixtures
staticroot
local_settings.py
......@@ -31,8 +31,8 @@ Compile translated messages/update a translation file:
# make translation
Fast installation
=================
Dev installation
================
Install python-django package (>=1.3)
Clone nuages archive somewhere in your home folder
......@@ -65,25 +65,22 @@ Copy nuages to /usr/local/lib/nuages
You can have local customizations in the local_settings.py file. Optionally set DEBUG option to False.
# vi local_settings.py
Build nuages database
# cd /usr/local/lib/nuages
# ./manage.py syncdb
# ./manage.py collectstatic
# vi /usr/local/lib/nuages/nuages/local_settings.py
There are several ways to configure Apache and python, we recommend wsgi, simply install libapache2-mod-wsgi, and add the following to /etc/apache2/sites-available/nuages
There are several ways to configure Apache and python, we recommend wsgi, simply install libapache2-mod-wsgi, and add the following to /etc/apache2/sites-available/nuages, replacing ServerName accordingly.
<VirtualHost *:80>
ServerName localhost.locadomain
Alias /static/ /usr/local/lib/nuages/staticroot/
WSGIScriptAlias / /usr/local/lib/nuages/apache/django.wsgi
WSGIScriptAlias / /usr/local/lib/nuages/nuages/wsgi.py
WSGIPythonPath /usr/local/lib/nuages
<Directory /usr/local/lib/nuages/apache>
Order allow,deny
Allow from all
<Directory /usr/local/lib/nuages/nuages>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
<Directory /usr/local/lib/nuages/staticroot>
......@@ -93,13 +90,11 @@ There are several ways to configure Apache and python, we recommend wsgi, simply
</VirtualHost>
Adapt the path in file apache/django.wsgi
Set permission for apache user
Build database, collect static files and set permissions:
sudo chown -R www-data /usr/local/lib/nuages
# make update
Set domain name: login to /admin/sites/site/1/ and modify the entry from "example.com" to your domain name.
Set domain name: Point your browser to /admin/sites/site/1/ and modify the entry from "example.com" to your domain name.
Email Service
=============
......@@ -118,20 +113,19 @@ Another option is to add attributes in settings.py, this make email work only wh
Update
======
In order to update your nuages installation, you can issue:
In order to update your nuages installation:
# make update
Migration
=========
When models change, we need to perform some manual steps to keep existing data:
When models change, we need to perform some manual steps to keep existing data. The following example backups all databases to json files, and resets only the poll table.
# mkdir fixture
# ./manage.py dumpdata meetingpoll --indent=2 > fixture/meetingpoll.json
# ./manage.py dumpdata accounts --indent=2 > fixture/accounts.json
# mkdir fixtures
# APPS="account auth meetingpoll poll"
# for APP in $APPS; do ./manage.py dumpdata $APP --indent=2 > fixtures/$APP.json; done
# git pull
# ./manage.py reset meetingpoll accounts
# ./manage.py syncdb
# ./manage.py loaddata < fixture/*.json
# ./manage.py reset poll
# ./manage.py loaddata fixtures/*.json
......@@ -9,6 +9,7 @@ from django.core.exceptions import ObjectDoesNotExist
from django.views.generic.create_update import update_object
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext_lazy as _
from django.contrib.sites.models import get_current_site
from django.conf import settings
from meetingpoll.models import Poll, Choice, Vote, Bulletin
from meetingpoll.forms import PollForm, ChoiceForm, VoteForm, BulletinForm
......@@ -272,8 +273,7 @@ def vote(request, poll_id):
form = BulletinForm(instance=poll,initial={'voter': voter})
#form = BulletinForm(instance=poll)
current_site = settings.SITE + poll.id
return render_to_response('meetingpoll/poll_detail.html', {'object': poll, 'form': form, 'vforms':vforms, 'error_message':error_message, 'has_voted': has_voted, 'current_site': current_site}, context_instance=RequestContext(request))
return render_to_response('meetingpoll/poll_detail.html', {'object': poll, 'form': form, 'vforms':vforms, 'error_message':error_message, 'has_voted': has_voted}, context_instance=RequestContext(request))
def exp_csv(request, poll_id):
import csv
......
......@@ -12,7 +12,6 @@ ADMINS = (
)
MANAGERS = ADMINS
DEFAULT_FROM_EMAIL = 'nuages@domainepublic.net'
SITE = 'http://nuages.domainepublic.net/'
LOGIN_REDIRECT_URL = '/'
......@@ -136,3 +135,4 @@ try:
from local_settings import *
except ImportError, e:
pass
......@@ -13,7 +13,7 @@
{% block chapeau %}
<h1>{{object}}</h1>
<p class="info">
{{object.description}} <br /> {% trans "Posted by" %} <code> {% if object.user %}{{object.user}}{% else %}{% trans 'Anonymous' %}{% endif %} </code> {% trans "on" %} <code> {{object.pub_date|date:"d F"}}. </code><br /> {% trans "Shared address" %}: <input type="text" name="link" style="border:0;" value="{{ current_site }}/" readonly="readonly" class='adresse' />
{{object.description}} <br /> {% trans "Posted by" %} <code> {% if object.user %}{{object.user}}{% else %}{% trans 'Anonymous' %}{% endif %} </code> {% trans "on" %} <code> {{object.pub_date|date:"d F"}}. </code><br /> {% trans "Shared address" %}: <input type="text" name="link" style="border:0;" value="{{ object.link }}" readonly="readonly" class='adresse' />
</p>
{% endblock %}
......
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