|
@@ -1,50 +1,53 @@
|
|
|
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
|
|
|
|
|
|
+Set up configuration
|
|
|
+====================
|
|
|
|
|
|
-Then hit *http://localhost:8080*
|
|
|
+Create and edit configuration file `wifiwithme/settings/local.py`
|
|
|
+following this example:
|
|
|
|
|
|
-To run in debug mode (auto-reload)
|
|
|
+ NOTIFICATION_EMAILS=['admin@example.tld']
|
|
|
|
|
|
- $ DEBUG=1 ./backend.py
|
|
|
+ DEFAULT_FROM_EMAIL='notifier@example.tld'
|
|
|
|
|
|
-Bottle will reload on source change, but not on template change if you're using
|
|
|
-an old version of bottle.
|
|
|
+ SITE_URL="http://example.tld"
|
|
|
|
|
|
-You can specify listening port and address by setting `BIND_PORT` and
|
|
|
-`BIND_ADDR` env vars, ex:
|
|
|
+But theses are optional settings for testing.
|
|
|
|
|
|
- BIND_ADDR='0.0.0.0' BIND_PORT=8081 ./backend.py
|
|
|
+Run development server
|
|
|
+======================
|
|
|
+
|
|
|
+It is required to initialize database first:
|
|
|
|
|
|
-Default is to listen on `127.0.0.0`, port `8080`.
|
|
|
+ $ ./manage.py migrate
|
|
|
|
|
|
-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.
|
|
|
+Then launch service with:
|
|
|
|
|
|
-Create the DataBase
|
|
|
-===================
|
|
|
+ $ ./manage.py runserver
|
|
|
|
|
|
- $ python backend.py createdb
|
|
|
+You can visit your browser at <http://127.0.0.1:8000/map/contribute>
|
|
|
|
|
|
-Build GeoJSON files
|
|
|
-===================
|
|
|
+Run production server
|
|
|
+=====================
|
|
|
|
|
|
- $ python backend.py buildgeojson
|
|
|
+To be done
|
|
|
|
|
|
Drop the database
|
|
|
=================
|