Commits

Yann Malet committed 33c1f03

Added a dummy settings for dev.py and prod.py

  • Participants
  • Parent commits 2024a8d

Comments (0)

Files changed (4)

django_tutorial/conf/dev.py

 DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.postgresql_psycopg2',
-        'NAME': 'django_tutorial',
-#        'USER': 'dbuser',
-#        'PASSWORD': 'dbpassword',
+        'NAME': 'django_tutorial1',
+        'USER': 'dbuser1',
+        'PASSWORD': 'dbuser1',
     }
 }
 

django_tutorial/conf/prod.py

+from django_tutorial.settings import *   # pylint: disable=W0614,W0401
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.postgresql_psycopg2',
+        'NAME': 'django_tutorial2',
+        'USER': 'dbuser2',
+        'PASSWORD': 'dbuser2',
+    }
+}
+
+WSGI_APPLICATION = 'django_tutorial.wsgi.dev.application'

django_tutorial/wsgi/dev.py

 """
 import os
 
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_tutorial.conf.dev.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_tutorial.conf.dev")
 
 # This application object is used by any WSGI server configured to use this
 # file. This includes Django's development server, if the WSGI_APPLICATION

django_tutorial/wsgi/prod.py

+"""
+WSGI config for django_tutorial project.
+
+This module contains the WSGI application used by Django's development server
+and any production WSGI deployments. It should expose a module-level variable
+named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
+this application via the ``WSGI_APPLICATION`` setting.
+
+Usually you will have the standard Django WSGI application here, but it also
+might make sense to replace the whole Django WSGI application with a custom one
+that later delegates to the Django one. For example, you could introduce WSGI
+middleware here, or combine a Django application with an application of another
+framework.
+
+"""
+import os
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_tutorial.conf.prod")
+
+# This application object is used by any WSGI server configured to use this
+# file. This includes Django's development server, if the WSGI_APPLICATION
+# setting points here.
+from django.core.wsgi import get_wsgi_application
+application = get_wsgi_application()
+
+# Apply WSGI middleware here.
+# from helloworld.wsgi import HelloWorldApplication
+# application = HelloWorldApplication(application)