Browse Source

Actualize README for Django startup

Bertrand 9 years ago
parent
commit
e40408dd03
1 changed files with 28 additions and 25 deletions
  1. 28 25
      README.md

+ 28 - 25
README.md

@@ -1,50 +1,53 @@
 Dependencies
 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
+    SITE_URL="http://example.tld"
-an old version of bottle.
 
 
-You can specify listening port and address by setting `BIND_PORT` and
+But theses are optional settings for testing.
-`BIND_ADDR` env vars, ex:
 
 
-    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
+Then launch service with:
-served at the root of the domain.
 
 
-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
 Drop the database
 =================
 =================