Changeset - 42ebbd06a1ea
[Not reviewed]
0 2 1
Nick Seidenman (N6) - 8 years ago 2017-01-11 11:58:09
n6151h@gmail.com
Website is working behind apache2 / mod_wsgi in daemon mode.
Only the homepage loads correctly at the moment. Need to get the
static files thing sorted, still.
3 files changed with 92 insertions and 24 deletions:
0 comments (0 inline, 0 general)
2017.pycon-au.org.conf
Show inline comments
 
new file 100644
 
WSGIPythonPath /srv/http/uat.2017.pycon-au.org/symposion/website:/srv/http/uat.2017.pycon-au.org/symposion/lib/python2.7/site-packages
 

	
 
<VirtualHost 192.55.98.190:80>
 
	ServerAdmin webmaster@pycon-au.org
 
	ServerName uat2017.pycon-au.org
 
	ServerAlias uat2017.pycon-au.org
 

	
 
	Alias /favicon.ico /srv/http/uat.2017.pycon-au.org/symposion/website/static/dist/pyconau2017/images/favicon.ico
 
	Alias /site_media/static/pyconau2017/ /srv/http/uat.2017.pycon-au.org/symposion/website/static/dist/pyconau2017/
 
	
 
	<Directory /srv/http/uat.2017.pycon-au.org/symposion/website/static/dist/pyconau2017>
 
		Order allow,deny
 
		Allow from all
 
		# Require all granted
 
	</Directory>
 

	
 
	WSGIDaemonProcess uat2017.pycon-au.org python-path="/srv/http/uat.2017.pycon-au.org/symposion/website:/srv/http/uat.2017.pycon-au.org/symposion/lib/python2.7/site-packages" home=/srv/http/uat.2017.pycon-au.org/symposion/website user=nicks group=www-data
 
	WSGIProcessGroup uat2017.pycon-au.org
 

	
 
	<Directory /srv/http/uat.2017.pycon-au.org/symposion/website>
 
		Order allow,deny
 
		Allow from all
 
		# Require all granted
 
	</Directory>
 

	
 
	WSGIScriptAlias / /srv/http/uat.2017.pycon-au.org/symposion/website/pinaxcon/wsgi.py
 

	
 
	ErrorLog /srv/http/uat.2017.pycon-au.org/log/error.log
 

	
 
	# Possible values include: debug, info, notice, warn, error, crit,
 
	# alert, emerg.
 
	LogLevel debug
 

	
 
	CustomLog /srv/http/uat.2017.pycon-au.org/log/access.log combined
 
	ServerSignature On
 
</VirtualHost>
 

	
pinaxcon/settings.py
Show inline comments
...
 
@@ -22,7 +22,7 @@ CACHES = {
 
}
 

	
 

	
 
ALLOWED_HOSTS = []
 
ALLOWED_HOSTS = ['uat2017.pycon-au.org']
 

	
 
# Local time zone for this installation. Choices can be found here:
 
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
...
 
@@ -218,35 +218,66 @@ INSTALLED_APPS = [
 
    "django_nose",
 
]
 

	
 
# A sample logging configuration. The only tangible logging
 
# performed by this configuration is to send an email to
 
# the site admins on every HTTP 500 error when DEBUG=False.
 
# See http://docs.djangoproject.com/en/dev/topics/logging for
 
# more details on how to customize your logging configuration.
 

	
 
LOGGING = {
 
    "version": 1,
 
    "disable_existing_loggers": False,
 
    "filters": {
 
        "require_debug_false": {
 
            "()": "django.utils.log.RequireDebugFalse"
 
    'version': 1,
 
    'disable_existing_loggers': False,
 
    'formatters': {
 
        'verbose': {
 
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
 
        },
 
        'simple': {
 
            'format': '%(levelname)s %(message)s'
 
        },
 
    },
 
    'filters': {
 
        'require_debug_false': {
 
            '()': 'django.utils.log.RequireDebugFalse'
 
        }
 
    },
 
    "handlers": {
 
        "mail_admins": {
 
            "level": "ERROR",
 
            "filters": ["require_debug_false"],
 
            "class": "django.utils.log.AdminEmailHandler"
 
    'handlers': {
 
        # 'null': {
 
        #     'level':'DEBUG',
 
        #     'class':'django.utils.log.NullHandler',
 
        # },
 
         'console':{
 
            'level': 'DEBUG',
 
            'class': 'logging.StreamHandler',
 
            'formatter': 'simple'
 
        },
 
        # I always add this handler to facilitate separating loggings
 
         'log_file':{
 
             'level': 'DEBUG',
 
             'class': 'logging.handlers.RotatingFileHandler',
 
             'filename': os.path.join('/srv/http/uat.2017.pycon-au.org', 'log/django.log'),
 
             'maxBytes': '16777216', # 16megabytes
 
             'formatter': 'verbose'
 
         },
 
        'mail_admins': {
 
            'level': 'ERROR',
 
            'filters': ['require_debug_false'],
 
            'class': 'django.utils.log.AdminEmailHandler',
 
            'include_html': True,
 
        }
 
    },
 
    "loggers": {
 
        "django.request": {
 
            "handlers": ["mail_admins"],
 
            "level": "ERROR",
 
            "propagate": True,
 
    'loggers': {
 
        'django.request': {
 
            'handlers': ['mail_admins'],
 
            'level': 'DEBUG',
 
            'propagate': True,
 
        },
 
    }
 
        'apps': { # I keep all my of apps under 'apps' folder, but you can also add them one by one, and this depends on how your virtualenv/paths are set
 
            'handlers': ['log_file'],
 
            'level': 'DEBUG',
 
            'propagate': True,
 
        },
 
    },
 
    # you can also shortcut 'loggers' and just configure logging for EVERYTHING at once
 
    'root': {
 
        'handlers': ['console', 'mail_admins'],
 
        'level': 'DEBUG'
 
    },
 
}
 

	
 
FIXTURE_DIRS = [
 
    os.path.join(PROJECT_ROOT, "fixtures"),
 
]
pinaxcon/urls.py
Show inline comments
...
 
@@ -15,7 +15,7 @@ import symposion.views
 

	
 

	
 
urlpatterns = [
 
    #url(r"^$", TemplateView.as_view(template_name="homepage.html"), name="home"),
 
    url(r"^$", TemplateView.as_view(template_name="pyconau2017-homepage.html"), name="home"),
 
    url(r"^admin/", include(admin.site.urls)),
 

	
 
    url(r"^account/", include("account.urls")),
0 comments (0 inline, 0 general)