Browse Source

Move venv and db.sqlite3 outside git repo

Mathieu 6 years ago
parent
commit
531b2d7220
3 changed files with 27 additions and 21 deletions
  1. 4 3
      .gitignore
  2. 22 17
      README.md
  3. 1 1
      wifiwithme/settings/base.py

+ 4 - 3
.gitignore

@@ -1,9 +1,10 @@
 *.pyc
 __pycache__/
 *~
-*.sqlite3
 wifiwithme/settings/local.py
 var/media/*
 var/static/*
-venv
-.idea
+.idea
+# Virtual environment folder and database file shouldn't be inside git repo.
+#venv
+#*.sqlite3

+ 22 - 17
README.md

@@ -13,8 +13,10 @@ sudo apt-get install python3-pip python3-virtualenv virtualenv libyaml-dev
 Retrieve the repository:
 
 ```bash
+# Create the base directory:
+mkdir wwm
+# Clone the repo:
 git clone https://code.ffdn.org/FFDN/wifi-with-me.git
-cd wifi-with-me
 ```
 
 Create and activate the virtualenv with:
@@ -27,20 +29,21 @@ source venv/bin/activate
 We use django framework.  Install it from requirements with pip:
 
 ```bash
-pip install -r requirements/base.txt
+pip install -r wifi-with-me/requirements/base.txt
 ```
 
 For development, install `dev.txt` instead:
 
 ```bash
-pip install -r requirements/dev.txt
+pip install -r wifi-with-me/requirements/dev.txt
 ```
 
 Set up configuration
 ====================
 
-Then create and edit the configuration file `wifiwithme/settings/local.py`
-according to following instructions:
+Then create and edit the configuration file
+`wifi-with-me/wifiwithme/settings/local.py` according to following
+instructions:
 
 Mandatory settings
 ------------------
@@ -66,16 +69,18 @@ ISP={
 }
 ```
 
-The wifi-with-me website URL, for links included in emails (Defaults to
-`http://localhost:8000`):
+The wifi-with-me website URL (for links included in emails) defaults to
+`http://localhost:8000`, so it must be customized:
 
 ```python
 SITE_URL='https://wifi.faimaison.net'
 ```
 
-If the website is accessible under several hostnames, list these here:
+List of domain name(s) under wich the website is accessible:
 
 ```python
+ALLOWED_HOSTS=['wifi.faimaison.net']
+# Or, for several domains:
 ALLOWED_HOSTS=['wifi.faimaison.net', 'faimaison.net']
 ```
 
@@ -132,32 +137,32 @@ If you used the (old) bottle version of wifi-with-me and want to migrate your
 data follow this extra step :
 
 ```bash
-./manage.py migrate auth
-./manage.py migrate contribmap 0001 --fake
+./wifi-with-me/manage.py migrate auth
+./wifi-with-me/manage.py migrate contribmap 0001 --fake
 ```
 
 Run development server
 ======================
 
-NOTE: For prod environment, replace `./manage.py` by
-`DJANGO_SETTINGS_MODULE=wifiwithme.settings.prod ./manage.py`.
+NOTE: For prod environment, replace `./wifi-with-me/manage.py` with
+`DJANGO_SETTINGS_MODULE=wifiwithme.settings.prod ./wifi-with-me/manage.py`.
 
 It is required to initialize database first:
 
 ```bash
-./manage.py migrate
+./wifi-with-me/manage.py migrate
 ```
 
 Create an admin:
 
 ```bash
-./manage.py createsuperuser
+./wifi-with-me/manage.py createsuperuser
 ```
 
 Then launch service with:
 
 ```bash
-./manage.py runserver
+./wifi-with-me/manage.py runserver
 ```
 
 You can visit with your browser at <http://127.0.0.1:8000/map/contribute>
@@ -189,6 +194,6 @@ python -c "import string,random; uni=string.ascii_letters+string.digits+string.p
    handling (run them with `--help` for more information):
 
 ```bash
-./manage.py delete_expired_contribs
-./manage.py send_expiration_reminders
+./wifi-with-me/manage.py delete_expired_contribs
+./wifi-with-me/manage.py send_expiration_reminders
 ```

+ 1 - 1
wifiwithme/settings/base.py

@@ -80,7 +80,7 @@ WSGI_APPLICATION = 'wifiwithme.wsgi.application'
 DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.sqlite3',
-        'NAME': os.path.join(os.path.dirname(BASE_DIR), 'db.sqlite3'),
+        'NAME': os.path.join(os.path.dirname(BASE_DIR), '../db.sqlite3'),
     }
 }