README 3.57 KB
Newer Older
1

chris's avatar
chris committed
2 3
Nuages - Easy poll sharing
==========================
4

chris's avatar
chris committed
5
 Nuages aims to provide a collaborative meeting poll system, similar to doodle or rdvz. It is build in python, using the django framework and a little of javascript. This application was named after Django's famous song. Feedback and collaboration are welcome at nuage@ domainepublic.net
6

7 8
 The project uses the following django applications:
    - django-registration: https://bitbucket.org/ubernostrum/django-registration
chris's avatar
chris committed
9
    - django-request: https://github.com/kylef/django-request
10

chris's avatar
chris committed
11 12 13
 The project uses the following javascripts:
    - jquery, jquery-ui: http://www.jquery.com/
    - jquery-dynamic-formset: http://code.google.com/p/django-dynamic-formset/
chris's avatar
chris committed
14
    - jquery timepicker addon: https://github.com/trentrichardson/jQuery-Timepicker-Addon
15

chris's avatar
chris committed
16 17
Translation
===========
18

19
Create/update a translation file:
20

21
    # django-admin makemessages -l fr
22

23
Edit and translate the translation file:
24

25
    # gedit locale/fr/LC_MESSAGES/django.po
26

27
Compile translated messages:
28

29
    # django-admin compilemessages
30

chris's avatar
chris committed
31 32
Fast installation
=================
33

34 35 36 37 38 39 40
Install python-django package (>=1.3)
Clone nuages archive somewhere in your home folder

    # cd
    # git clone http://git.domainepublic.net/git/nuages.git

Optionally edit project setings
41

42
    # vi settings.py
43

chris's avatar
chris committed
44
Build nuages database
45

46
    # ./manage.py syncdb
47

48
Start the python webserver
49

50
    # ./manage.py runserver
51

52
You should have the application running at http://127.0.0.1:8000
53

chris's avatar
chris committed
54 55
Apache installation
===================
56

57 58 59 60 61 62 63
Install python-django package (>=1.3)
Copy nuages to /usr/local/lib/nuages

    # cd /usr/local/lib
    # git clone http://git.domainepublic.net/git/nuages.git 

Optionally edit project setings and set DEBUG option to False
64

65
    # cd /usr/local/lib/nuages
66
    # vi settings.py
67

chris's avatar
chris committed
68
Build nuages database
69

70
    # cd /usr/local/lib/nuages
71
    # ./manage.py syncdb
72
    # ./manage.py collectstatic
73

74
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
75

76
    <VirtualHost *:80>
77
      
78 79 80
      ServerName localhost.locadomain
      Alias /static/ /usr/local/lib/nuages/staticroot/
      WSGIScriptAlias / /usr/local/lib/nuages/apache/django.wsgi
81

82 83 84 85
      <Directory /usr/local/lib/nuages/apache>
              Order allow,deny
              Allow from all
      </Directory>
chris's avatar
chris committed
86

87 88 89 90
      <Directory /usr/local/lib/nuages/staticroot>
        Order deny,allow
        Allow from all
      </Directory>
chris's avatar
chris committed
91

92
    </VirtualHost>
93

94
Adapt the path in file apache/django.wsgi
95

96
Fix permission for apache user
97

98
    sudo chown -R www-data /usr/local/lib/nuages
99

100
Set domain name: login to /admin/sites/site/1/ and modify the entry from "example.com" to your domain name.
Christophe Siraut's avatar
Christophe Siraut committed
101

102 103 104 105 106 107 108 109 110 111 112 113 114 115
Email Service
=============

Django is expecting a working SMTP server listening at localhost, sendmail for instance.

Another option is to add attributes in settings.py, this make email work only when there is a localhost server accepting all the email. To change this and make it configurable, we only have to add these lines:

  # Email attributes
  EMAIL_HOST = 'mail.example.com'
  EMAIL_PORT = '25'
  EMAIL_HOST_USER = 'username@example.com'
  EMAIL_HOST_PASSWORD = 'password'
  EMAIL_USE_TLS = False

116 117 118 119 120 121 122 123 124 125 126 127
Migrations
==========

When models change, we need to perform some manual steps to keep existing data:

  # mkdir fixture
  # ./manage.py dumpdata sondage --indent=2 > fixture/sondage.json
  # ./manage.py dumpdata accounts --indent=2 > fixture/accounts.json
  # git pull
  # ./manage.py reset sondage accounts
  # ./manage.py syncdb
  # ./manage.py loaddata < fixture/*.json