Browse Source

Merge branch 'django' of Bertrand/wifi-with-me into django

jocelyn 9 years ago
parent
commit
13147b414b
1 changed files with 33 additions and 45 deletions
  1. 33 45
      README.md

+ 33 - 45
README.md

@@ -1,50 +1,58 @@
 Dependencies
 ============
-We use bottle micro-framework.
 
+In order to facilitate dependency management, you can use a pip and
+a virtual environment (like virtualenv).
 
-     # apt-get install python-bottle
+Install packages:
 
-(current code works with debian-stable version of bottle)
+     # apt-get install python3-pip python3-virtualenv
 
-or
+Create and activate the virtualenv with:
 
-    $ pip install bottle
+     $ virtualenv -p $(which python3) venv
+     $ source venv/bin/activate
 
-Running
-=======
+We use django framework.  Install it from requirements with pip:
 
-    $ ./backend.py
+     $ pip install -r requirements/base.txt
 
+For development, install `dev.txt` requirements too:
 
-Then hit *http://localhost:8080*
+     $ pip install -r requirements/base.txt -r requirements/dev.txt
 
-To run in debug mode (auto-reload)
+Set up configuration
+====================
 
-    $ DEBUG=1 ./backend.py
+Create and edit configuration file `wifiwithme/settings/local.py`
+following this example:
 
-Bottle will reload on source change, but not on template change if you're using
-an old version of bottle.
+    NOTIFICATION_EMAILS=['admin@example.tld']
 
-You can specify listening port and address by setting `BIND_PORT` and
-`BIND_ADDR` env vars, ex:
+    DEFAULT_FROM_EMAIL='notifier@example.tld'
 
-    BIND_ADDR='0.0.0.0' BIND_PORT=8081 ./backend.py
+    SITE_URL="http://example.tld"
 
-Default is to listen on `127.0.0.0`, port `8080`.
+But theses are optional settings for testing.
+That needs to be set only if someone wants to receive notifications on each new contrib.
 
-You can also pass a `URL_PREFIX='/some_folder/'` if you don't want the app to be
-served at the root of the domain.
+Run development server
+======================
+
+It is required to initialize database first:
+
+    $ ./manage.py migrate
 
-Create the DataBase
-===================
+Then launch service with:
 
-    $ python backend.py createdb
+    $ ./manage.py runserver
 
-Build GeoJSON files
-===================
+You can visit your browser at <http://127.0.0.1:8000/map/contribute>
 
-    $ python backend.py buildgeojson
+Run production server
+=====================
+
+To be done
 
 Drop the database
 =================
@@ -52,23 +60,3 @@ Drop the database
     $ rm db.sqlite3
 
 What else ?
-
-Customizing appearance
-======================
-
-Wether you like or not balloons, you may want to override some templates and/or
-static files.
-
-You can mention a `CUSTOMIZATION_DIR` as environ variable. In that dir, you can
-create *assets* and *views* subdirs, containing files with the name of the
-original files you want to override from default *assets* and *views*.
-
-For example to override only *main.css* and *base.tpl*, you would set
-`CUSTOMIZATION_DIR=/home/alice/my-fancy-isp-theme` and use the following directory
-layout :
-
-    /home/alice/my-fancy-isp-theme/
-    ├── assets
-    │   └── main.css
-    └── views
-        └── base.tpl