|
@@ -37,44 +37,49 @@ Mandatory settings
|
|
|
|
|
|
You **must** Define some details about your ISP in the ISP variable, eg:
|
|
|
|
|
|
- ISP={
|
|
|
- 'NAME':'FAIMAISON',
|
|
|
- 'TITLE':'Réseau wifi expérimental',
|
|
|
- 'SITE':'//www.faimaison.net',
|
|
|
- 'EMAIL':'bureau (at) faimaison.net',
|
|
|
- 'ZONE':'Nantes et environs',
|
|
|
- 'ADDRESS_EXAMPLE': 'rue du calvaire, nantes',
|
|
|
- 'URL_CONTACT':'//www.faimaison.net/pages/contact.html',
|
|
|
- 'LATITUDE':47.218371,
|
|
|
- 'LONGITUDE':-1.553621,
|
|
|
- 'ZOOM':13,
|
|
|
- 'CNIL':{
|
|
|
- 'LINK':'//www.faimaison.net/files/cnil-faimaison-1819684-withwithme.pdf',
|
|
|
- 'NUMBER':1819684
|
|
|
- }
|
|
|
+```python
|
|
|
+ISP={
|
|
|
+ 'NAME':'FAIMAISON',
|
|
|
+ 'TITLE':'Réseau wifi expérimental',
|
|
|
+ 'SITE':'//www.faimaison.net',
|
|
|
+ 'EMAIL':'bureau (at) faimaison.net',
|
|
|
+ 'ZONE':'Nantes et environs',
|
|
|
+ 'ADDRESS_EXAMPLE': 'rue du calvaire, nantes',
|
|
|
+ 'URL_CONTACT':'//www.faimaison.net/pages/contact.html',
|
|
|
+ 'LATITUDE':47.218371,
|
|
|
+ 'LONGITUDE':-1.553621,
|
|
|
+ 'ZOOM':13,
|
|
|
+ 'CNIL':{
|
|
|
+ 'LINK':'//www.faimaison.net/files/cnil-faimaison-1819684-withwithme.pdf',
|
|
|
+ 'NUMBER':1819684
|
|
|
}
|
|
|
+}
|
|
|
+```
|
|
|
|
|
|
- SITE_URL='https://wifi.faimaison.net'
|
|
|
- ALLOWED_HOST=['wifi.faimaison.net']
|
|
|
+The wifi-with-me website URL, for links included in emails (Defaults to
|
|
|
+`http://localhost:8000`):
|
|
|
+
|
|
|
+```python
|
|
|
+SITE_URL='https://wifi.faimaison.net'
|
|
|
+```
|
|
|
+
|
|
|
+If the website is accessible under several hostnames, list these here:
|
|
|
+
|
|
|
+```python
|
|
|
+ALLOWED_HOSTS=['wifi.faimaison.net', 'faimaison.net']
|
|
|
+```
|
|
|
|
|
|
Optional settings
|
|
|
-----------------
|
|
|
|
|
|
### Website URL
|
|
|
|
|
|
-The wifi-with-me website URL, for links included in emails (Defaults to
|
|
|
-`http://localhost:8000`):
|
|
|
-
|
|
|
- SITE_URL="https://example.com"
|
|
|
-
|
|
|
Optionaly, you can define an url prefix (ex: `/foo/`) so that wifi-with-me is
|
|
|
accessible under *http://example.com/foo/*:
|
|
|
|
|
|
- URL_PREFIX='foo/'
|
|
|
-
|
|
|
-If the website is accessible under several hostnames, list these here:
|
|
|
-
|
|
|
- ALLOWED_HOST=['example.com', 'wifi.example.com']
|
|
|
+```python
|
|
|
+URL_PREFIX='foo/'
|
|
|
+```
|
|
|
|
|
|
### Notifications
|
|
|
|
|
@@ -82,12 +87,15 @@ If you want to receive notifications on each new contrib, customize those:
|
|
|
|
|
|
List of notification recipients:
|
|
|
|
|
|
- NOTIFICATION_EMAILS=['admin@example.tld']
|
|
|
+```python
|
|
|
+NOTIFICATION_EMAILS=['admin@example.com', 'admin2@example.com']
|
|
|
+```
|
|
|
|
|
|
Notification sender address:
|
|
|
|
|
|
- DEFAULT_FROM_EMAIL='notifier@example.tld'
|
|
|
-
|
|
|
+```python
|
|
|
+DEFAULT_FROM_EMAIL='notifier@example.tld'
|
|
|
+```
|
|
|
|
|
|
### Data expiration
|
|
|
|
|
@@ -97,10 +105,12 @@ its explicit consent to keep it one more year.
|
|
|
Reminders are sent to the contribution author when expiration date gets
|
|
|
close. By default we send two notifications :
|
|
|
|
|
|
- DATA_EXPIRATION_REMINDERS = [
|
|
|
- 30, # 1 month before
|
|
|
- 7, # 1 week before
|
|
|
- ]
|
|
|
+```python
|
|
|
+DATA_EXPIRATION_REMINDERS = [
|
|
|
+ 30, # 1 month before
|
|
|
+ 7, # 1 week before
|
|
|
+]
|
|
|
+```
|
|
|
|
|
|
You can tweak it to your will or decide to send no reminder (with value `[]`).
|
|
|
|
|
@@ -111,23 +121,31 @@ Migrate from bottle version (optional)
|
|
|
If you used the (old) bottle version of wifi-with-me and want to migrate your
|
|
|
data follow this extra step :
|
|
|
|
|
|
- $ ./manage.py migrate auth
|
|
|
- $ ./manage.py migrate contribmap 0001 --fake
|
|
|
+```bash
|
|
|
+./manage.py migrate auth
|
|
|
+./manage.py migrate contribmap 0001 --fake
|
|
|
+```
|
|
|
|
|
|
Run development server
|
|
|
======================
|
|
|
|
|
|
It is required to initialize database first:
|
|
|
|
|
|
- $ ./manage.py migrate
|
|
|
+```bash
|
|
|
+./manage.py migrate
|
|
|
+```
|
|
|
|
|
|
Create an admin:
|
|
|
|
|
|
- $ ./manage.py createsuperuser
|
|
|
+```bash
|
|
|
+./manage.py createsuperuser
|
|
|
+```
|
|
|
|
|
|
Then launch service with:
|
|
|
|
|
|
- $ ./manage.py runserver
|
|
|
+```bash
|
|
|
+./manage.py runserver
|
|
|
+```
|
|
|
|
|
|
You can visit with your browser at <http://127.0.0.1:8000/map/contribute>
|
|
|
|
|
@@ -136,7 +154,9 @@ Drop the database
|
|
|
|
|
|
If you want to **reset all your data**.
|
|
|
|
|
|
- $ rm db.sqlite3
|
|
|
+```bash
|
|
|
+rm db.sqlite3
|
|
|
+```
|
|
|
|
|
|
|
|
|
Run production server
|
|
@@ -146,8 +166,16 @@ Run production server
|
|
|
|
|
|
1. Deploy it [like any django site](https://docs.djangoproject.com/en/1.11/howto/deployment/)
|
|
|
2. Customize [mandatory and optional settings](#set-up-configuration)
|
|
|
-3. Customize `SECRET_KEY` to something really random. Hint: `python -c "import string,random; uni=string.ascii_letters+string.digits+string.punctuation; print(repr(''.join([random.SystemRandom().choice(uni) for i in range(random.randint(45,50))])))"`
|
|
|
+3. Customize `SECRET_KEY` to something really random. Hint:
|
|
|
+
|
|
|
+```bash
|
|
|
+python -c "import string,random; uni=string.ascii_letters+string.digits+string.punctuation; print(repr(''.join([random.SystemRandom().choice(uni) for i in range(random.randint(45,50))])))"`
|
|
|
+```
|
|
|
+
|
|
|
4. Set *daily* crons for the two commands that take care of data expiration
|
|
|
handling (run them with `--help` for more information):
|
|
|
- - `./manage.py delete_expired_contribs`
|
|
|
- - `./manage.py send_expiration_reminders`
|
|
|
+
|
|
|
+```bash
|
|
|
+./manage.py delete_expired_contribs
|
|
|
+./manage.py send_expiration_reminders
|
|
|
+```
|