Browse Source

Use working dev default and improve the documentation for deployment in production

daimrod 8 years ago
parent
commit
0334aadd1d
2 changed files with 12 additions and 5 deletions
  1. 10 3
      DEPLOYMENT.md
  2. 2 2
      coin/settings.py

+ 10 - 3
DEPLOYMENT.md

@@ -1,5 +1,13 @@
-For production deployment, it is recommended to use a reverse proxy
-setup, for instance using gunicorn.
+Before deploying in production, you should read carefully the django
+deployment checklist :
+
+  https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
+
+It is highly recommended to set the TEMPATE_DEBUG and DEBUG variables
+to False when deploying in production.
+
+For production deployment, it is also recommended to use a reverse
+proxy setup, for instance using gunicorn.
 
 This is because the access to invoices (PDF) is a bit special: they
 are served by the web server for efficiency, but django itself handles
@@ -13,7 +21,6 @@ For the complete deployment configuration used by Illyse, see:
 
   https://www.illyse.org/projects/ils-si/wiki/Mise_en_place_production
 
-
 ## Gunicorn configuration
 
 Gunicorn on Debian wheezy is very nice, because it can launch automatically

+ 2 - 2
coin/settings.py

@@ -10,7 +10,7 @@ import ldap
 BASE_DIR = os.path.dirname(os.path.dirname(__file__))
 
 PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
-DEBUG = TEMPLATE_DEBUG = False
+DEBUG = TEMPLATE_DEBUG = True
 
 ADMINS = (
     # ('Your Name', 'your_email@example.com'),
@@ -32,7 +32,7 @@ DATABASES = {
 
 # Hosts/domain names that are valid for this site; required if DEBUG is False
 # See https://docs.djangoproject.com/en/1.7/ref/settings/#allowed-hosts
-ALLOWED_HOSTS = ['127.0.0.1']
+ALLOWED_HOSTS = []
 
 # Local time zone for this installation. Choices can be found here:
 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name