Commit f7a77ac9 authored by Christophe Siraut's avatar Christophe Siraut

Documentation. Remove SITE variable

parent da5947b8
*.sqlite *.sqlite
*.pyc *.pyc
*~ *~
fixture fixtures
staticroot staticroot
local_settings.py local_settings.py
...@@ -31,8 +31,8 @@ Compile translated messages/update a translation file: ...@@ -31,8 +31,8 @@ Compile translated messages/update a translation file:
# make translation # make translation
Fast installation Dev installation
================= ================
Install python-django package (>=1.3) Install python-django package (>=1.3)
Clone nuages archive somewhere in your home folder Clone nuages archive somewhere in your home folder
...@@ -65,25 +65,22 @@ Copy nuages to /usr/local/lib/nuages ...@@ -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. You can have local customizations in the local_settings.py file. Optionally set DEBUG option to False.
# vi local_settings.py # vi /usr/local/lib/nuages/nuages/local_settings.py
Build nuages database
# cd /usr/local/lib/nuages
# ./manage.py syncdb
# ./manage.py collectstatic
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> <VirtualHost *:80>
ServerName localhost.locadomain ServerName localhost.locadomain
Alias /static/ /usr/local/lib/nuages/staticroot/ 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> <Directory /usr/local/lib/nuages/nuages>
Order allow,deny <Files wsgi.py>
Order deny,allow
Allow from all Allow from all
</Files>
</Directory> </Directory>
<Directory /usr/local/lib/nuages/staticroot> <Directory /usr/local/lib/nuages/staticroot>
...@@ -93,13 +90,11 @@ There are several ways to configure Apache and python, we recommend wsgi, simply ...@@ -93,13 +90,11 @@ There are several ways to configure Apache and python, we recommend wsgi, simply
</VirtualHost> </VirtualHost>
Adapt the path in file apache/django.wsgi Build database, collect static files and set permissions:
Set permission for apache user
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 Email Service
============= =============
...@@ -118,20 +113,19 @@ Another option is to add attributes in settings.py, this make email work only wh ...@@ -118,20 +113,19 @@ Another option is to add attributes in settings.py, this make email work only wh
Update Update
====== ======
In order to update your nuages installation, you can issue: In order to update your nuages installation:
# make update # make update
Migration 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 # mkdir fixtures
# ./manage.py dumpdata meetingpoll --indent=2 > fixture/meetingpoll.json # APPS="account auth meetingpoll poll"
# ./manage.py dumpdata accounts --indent=2 > fixture/accounts.json # for APP in $APPS; do ./manage.py dumpdata $APP --indent=2 > fixtures/$APP.json; done
# git pull # git pull
# ./manage.py reset meetingpoll accounts # ./manage.py reset poll
# ./manage.py syncdb # ./manage.py loaddata fixtures/*.json
# ./manage.py loaddata < fixture/*.json
...@@ -9,6 +9,7 @@ from django.core.exceptions import ObjectDoesNotExist ...@@ -9,6 +9,7 @@ from django.core.exceptions import ObjectDoesNotExist
from django.views.generic.create_update import update_object from django.views.generic.create_update import update_object
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.contrib.sites.models import get_current_site
from django.conf import settings from django.conf import settings
from meetingpoll.models import Poll, Choice, Vote, Bulletin from meetingpoll.models import Poll, Choice, Vote, Bulletin
from meetingpoll.forms import PollForm, ChoiceForm, VoteForm, BulletinForm from meetingpoll.forms import PollForm, ChoiceForm, VoteForm, BulletinForm
...@@ -272,8 +273,7 @@ def vote(request, poll_id): ...@@ -272,8 +273,7 @@ def vote(request, poll_id):
form = BulletinForm(instance=poll,initial={'voter': voter}) form = BulletinForm(instance=poll,initial={'voter': voter})
#form = BulletinForm(instance=poll) #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}, 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, 'current_site': current_site}, context_instance=RequestContext(request))
def exp_csv(request, poll_id): def exp_csv(request, poll_id):
import csv import csv
......
...@@ -12,7 +12,6 @@ ADMINS = ( ...@@ -12,7 +12,6 @@ ADMINS = (
) )
MANAGERS = ADMINS MANAGERS = ADMINS
DEFAULT_FROM_EMAIL = 'nuages@domainepublic.net' DEFAULT_FROM_EMAIL = 'nuages@domainepublic.net'
SITE = 'http://nuages.domainepublic.net/'
LOGIN_REDIRECT_URL = '/' LOGIN_REDIRECT_URL = '/'
...@@ -136,3 +135,4 @@ try: ...@@ -136,3 +135,4 @@ try:
from local_settings import * from local_settings import *
except ImportError, e: except ImportError, e:
pass pass
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
{% block chapeau %} {% block chapeau %}
<h1>{{object}}</h1> <h1>{{object}}</h1>
<p class="info"> <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> </p>
{% endblock %} {% 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