1. Alexandre Macabies
  2. sadm

Commits

Alexandre Macabies  committed 29353e0 Merge

Merged prologin/sadm into master

  • Participants
  • Parent commits 95475ac, 0ffc4f3
  • Branches master

Comments (0)

Files changed (24)

File config/homepage.yml

View file
  • Ignore whitespace
 db:
     default:
         ENGINE: django.db.backends.sqlite3
-        NAME: /var/prologin/home/home.db
+        NAME: /var/prologin/homepage/home.db
         USER:
         PASSWORD:
         HOST:

File dhcp/dhcpd.conf

View file
  • Ignore whitespace
 
     # Services subnet. No dynamic allocation there, no PXE (machines have a
     # local hard drive).
-    subnet 192.168.1.0 netmask 255.255.255.0 {
+    # The service subnet is split into 2 /25 in order to have 2 RFS/HFS on the
+    # same machine (Linux has trouble with 2 NICs on the same /24).
+    subnet 192.168.1.0 netmask 255.255.255.128 {
+        option routers 192.168.1.126;
+        option domain-name-servers 192.168.1.126;
+
+        deny unknown-clients;
+    }
+    subnet 192.168.1.128 netmask 255.255.255.128 {
         option routers 192.168.1.254;
         option domain-name-servers 192.168.1.254;
 

File homepage/home/__init__.py

  • Ignore whitespace
Empty file removed.

File homepage/home/models.py

  • Ignore whitespace
-# -*- encoding: utf-8 -*-
-# Copyright (c) 2013 Pierre Bourdon <pierre.bourdon@prologin.org>
-# Copyright (c) 2013 Association Prologin <info@prologin.org>
-#
-# Prologin-SADM is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Prologin-SADM is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Prologin-SADM.  If not, see <http://www.gnu.org/licenses/>.
-
-from django.db import models
-
-
-class Link(models.Model):
-    name = models.CharField(max_length=64)
-    url = models.CharField(max_length=128)
-    contest_only = models.BooleanField(verbose_name='Contest restricted')
-    display_order = models.IntegerField()
-
-    def __str__(self):
-        return self.name
-
-    class Meta:
-        ordering = ('display_order', 'name')

File homepage/home/settings.py

  • Ignore whitespace
-# -*- encoding: utf-8 -*-
-# Copyright (c) 2013 Pierre Bourdon <pierre.bourdon@prologin.org>
-# Copyright (c) 2013 Association Prologin <info@prologin.org>
-#
-# Prologin-SADM is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Prologin-SADM is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Prologin-SADM.  If not, see <http://www.gnu.org/licenses/>.
-
-from prologin.djangoconf import use_profile_config
-cfg = use_profile_config('homepage')
-
-ADMINS = (
-    # ('Your Name', 'your_email@example.com'),
-)
-
-MANAGERS = ADMINS
-
-# Hosts/domain names that are valid for this site; required if DEBUG is False
-# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
-ALLOWED_HOSTS = ['*']
-
-SITE_ID = 1
-
-# If you set this to False, Django will make some optimizations so as not
-# to load the internationalization machinery.
-USE_I18N = True
-
-# If you set this to False, Django will not format dates, numbers and
-# calendars according to the current locale.
-USE_L10N = True
-
-# If you set this to False, Django will not use timezone-aware datetimes.
-USE_TZ = True
-
-# Absolute filesystem path to the directory that will hold user-uploaded files.
-# Example: "/var/www/example.com/media/"
-MEDIA_ROOT = ''
-
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash.
-# Examples: "http://example.com/media/", "http://media.example.com/"
-MEDIA_URL = ''
-
-# Absolute path to the directory static files should be collected to.
-# Don't put anything in this directory yourself; store your static files
-# in apps' "static/" subdirectories and in STATICFILES_DIRS.
-# Example: "/var/www/example.com/static/"
-STATIC_ROOT = ''
-
-# URL prefix for static files.
-# Example: "http://example.com/static/", "http://static.example.com/"
-STATIC_URL = '/static/'
-
-# Additional locations of static files
-STATICFILES_DIRS = (
-    # Put strings here, like "/home/html/static" or "C:/www/django/static".
-    # Always use forward slashes, even on Windows.
-    # Don't forget to use absolute paths, not relative paths.
-)
-
-# List of finder classes that know how to find static files in
-# various locations.
-STATICFILES_FINDERS = (
-    'django.contrib.staticfiles.finders.FileSystemFinder',
-    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
-#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
-)
-
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.Loader',
-    'django.template.loaders.app_directories.Loader',
-#     'django.template.loaders.eggs.Loader',
-)
-
-MIDDLEWARE_CLASSES = (
-    'django.middleware.common.CommonMiddleware',
-    'django.contrib.sessions.middleware.SessionMiddleware',
-    'django.middleware.csrf.CsrfViewMiddleware',
-    'django.contrib.auth.middleware.AuthenticationMiddleware',
-    'django.contrib.messages.middleware.MessageMiddleware',
-)
-
-ROOT_URLCONF = 'home.urls'
-
-# Python dotted path to the WSGI application used by Django's runserver.
-WSGI_APPLICATION = 'home.wsgi.application'
-
-TEMPLATE_DIRS = (
-    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
-    # Always use forward slashes, even on Windows.
-    # Don't forget to use absolute paths, not relative paths.
-)
-
-INSTALLED_APPS = (
-    'django.contrib.auth',
-    'django.contrib.contenttypes',
-    'django.contrib.sessions',
-    'django.contrib.sites',
-    'django.contrib.messages',
-    'django.contrib.staticfiles',
-    'django.contrib.admin',
-    'home',
-)
-
-# 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,
-    'formatters': {
-        'verbose': {
-            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
-        },
-    },
-    'handlers': {
-        'console': {
-            'level': 'INFO',
-            'class': 'logging.StreamHandler',
-            'formatter': 'verbose',
-        }
-    },
-    'loggers': {
-        'django.request': {
-            'handlers': ['console'],
-            'level': 'INFO',
-            'propagate': True,
-        },
-    }
-}
-
-CONTEST_MODE = cfg['contest_mode']

File homepage/home/static/design.css

  • Ignore whitespace
-body{
-    margin: auto;
-    background: #fbfbfb;
-    font-family: Arial,sans-serif;
-}
-h1{
-    font-weight: bold;
-    margin: auto;
-    text-align: center;
-    font-size: 3em;
-    vertical-align: middle;
-}
-h2{
-    font-weight: bold;
-    margin: auto;
-    text-align: center;
-}
-a,a:active,a:hover,a:visited{
-    color: black;
-    font-size: 1.9em;
-}
-img{
-    margin-right: 10px;
-    vertical-align: middle;
-}
-
-ul{
-    margin: auto;
-    width: 600px;
-    margin-top: 40px;
-}
-
-li{
-    margin-bottom: 10px;
-}

File homepage/home/static/logo.png

  • Ignore whitespace
Removed
Old image

File homepage/home/templates/home.html

  • Ignore whitespace
-<!DOCTYPE html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>Bienvenue à Prologin !</title>
-    <link type="text/css" rel="stylesheet" media="all" href="/static/design.css" />
-  </head>
-  <body>
-    <h1><img src="/static/logo.png" alt="" />Finale Prologin</h1>
-    <h2>Liens pratiques</h2>
-    <ul>
-      {% for link in links %}
-      <li><a href="{{ link.url }}">{{ link.name }}</a></li>
-      {% endfor %}
-    </ul>
-  </body>
-</html>
-

File homepage/home/urls.py

  • Ignore whitespace
-# -*- encoding: utf-8 -*-
-# Copyright (c) 2013 Pierre Bourdon <pierre.bourdon@prologin.org>
-# Copyright (c) 2013 Association Prologin <info@prologin.org>
-#
-# Prologin-SADM is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Prologin-SADM is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Prologin-SADM.  If not, see <http://www.gnu.org/licenses/>.
-
-from django.conf.urls import patterns, include, url
-from django.contrib import admin
-
-admin.autodiscover()
-
-urlpatterns = patterns('',
-    url(r'^$', 'home.views.home', name='home'),
-    url(r'^admin/', include(admin.site.urls)),
-)

File homepage/home/views.py

  • Ignore whitespace
-# -*- encoding: utf-8 -*-
-# Copyright (c) 2013 Pierre Bourdon <pierre.bourdon@prologin.org>
-# Copyright (c) 2013 Association Prologin <info@prologin.org>
-#
-# Prologin-SADM is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Prologin-SADM is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Prologin-SADM.  If not, see <http://www.gnu.org/licenses/>.
-
-from django.conf import settings
-from django.shortcuts import render_to_response
-from home.models import Link
-
-def home(request):
-    links = Link.objects.filter(contest_only=settings.CONTEST_MODE)
-    links = links.order_by('display_order', 'name')
-    return render_to_response('home.html', { 'links': links })

File homepage/home/wsgi.py

  • Ignore whitespace
-"""
-WSGI config for home 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
-
-# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
-# if running multiple sites in the same mod_wsgi process. To fix this, use
-# mod_wsgi daemon mode with each site in its own daemon process, or use
-# os.environ["DJANGO_SETTINGS_MODULE"] = "home.settings"
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "home.settings")
-
-# 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()
-
-from django.contrib.staticfiles.handlers import StaticFilesHandler
-application = StaticFilesHandler(application)
-
-# Apply WSGI middleware here.
-# from helloworld.wsgi import HelloWorldApplication
-# application = HelloWorldApplication(application)

File homepage/homepage/__init__.py

  • Ignore whitespace
Empty file added.

File homepage/homepage/admin.py

View file
  • Ignore whitespace
+# -*- encoding: utf-8 -*-
+# Copyright (c) 2013 Pierre Bourdon <pierre.bourdon@prologin.org>
+# Copyright (c) 2013 Association Prologin <info@prologin.org>
+#
+# Prologin-SADM is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Prologin-SADM is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Prologin-SADM.  If not, see <http://www.gnu.org/licenses/>.
+
+from django.contrib import admin
+from homepage import models
+
+admin.site.register(models.Link)

File homepage/homepage/models.py

View file
  • Ignore whitespace
+# -*- encoding: utf-8 -*-
+# Copyright (c) 2013 Pierre Bourdon <pierre.bourdon@prologin.org>
+# Copyright (c) 2013 Association Prologin <info@prologin.org>
+#
+# Prologin-SADM is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Prologin-SADM is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Prologin-SADM.  If not, see <http://www.gnu.org/licenses/>.
+
+from django.db import models
+
+
+class Link(models.Model):
+    name = models.CharField(max_length=64)
+    url = models.CharField(max_length=128)
+    contest_only = models.BooleanField(verbose_name='Contest restricted')
+    display_order = models.IntegerField()
+
+    def __str__(self):
+        return self.name
+
+    class Meta:
+        ordering = ('display_order', 'name')

File homepage/homepage/settings.py

View file
  • Ignore whitespace
+# -*- encoding: utf-8 -*-
+# Copyright (c) 2013 Pierre Bourdon <pierre.bourdon@prologin.org>
+# Copyright (c) 2013 Association Prologin <info@prologin.org>
+#
+# Prologin-SADM is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Prologin-SADM is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Prologin-SADM.  If not, see <http://www.gnu.org/licenses/>.
+
+from prologin.djangoconf import use_profile_config
+cfg = use_profile_config('homepage')
+
+ADMINS = (
+    # ('Your Name', 'your_email@example.com'),
+)
+
+MANAGERS = ADMINS
+
+# Hosts/domain names that are valid for this site; required if DEBUG is False
+# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
+ALLOWED_HOSTS = ['*']
+
+SITE_ID = 1
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = True
+
+# If you set this to False, Django will not format dates, numbers and
+# calendars according to the current locale.
+USE_L10N = True
+
+# If you set this to False, Django will not use timezone-aware datetimes.
+USE_TZ = True
+
+# Absolute filesystem path to the directory that will hold user-uploaded files.
+# Example: "/var/www/example.com/media/"
+MEDIA_ROOT = ''
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash.
+# Examples: "http://example.com/media/", "http://media.example.com/"
+MEDIA_URL = ''
+
+# Absolute path to the directory static files should be collected to.
+# Don't put anything in this directory yourself; store your static files
+# in apps' "static/" subdirectories and in STATICFILES_DIRS.
+# Example: "/var/www/example.com/static/"
+STATIC_ROOT = ''
+
+# URL prefix for static files.
+# Example: "http://example.com/static/", "http://static.example.com/"
+STATIC_URL = '/static/'
+
+# Additional locations of static files
+STATICFILES_DIRS = (
+    # Put strings here, like "/home/html/static" or "C:/www/django/static".
+    # Always use forward slashes, even on Windows.
+    # Don't forget to use absolute paths, not relative paths.
+)
+
+# List of finder classes that know how to find static files in
+# various locations.
+STATICFILES_FINDERS = (
+    'django.contrib.staticfiles.finders.FileSystemFinder',
+    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
+#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
+)
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+    'django.template.loaders.filesystem.Loader',
+    'django.template.loaders.app_directories.Loader',
+#     'django.template.loaders.eggs.Loader',
+)
+
+MIDDLEWARE_CLASSES = (
+    'django.middleware.common.CommonMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.middleware.csrf.CsrfViewMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.messages.middleware.MessageMiddleware',
+)
+
+ROOT_URLCONF = 'homepage.urls'
+
+# Python dotted path to the WSGI application used by Django's runserver.
+WSGI_APPLICATION = 'homepage.wsgi.application'
+
+TEMPLATE_DIRS = (
+    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
+    # Always use forward slashes, even on Windows.
+    # Don't forget to use absolute paths, not relative paths.
+)
+
+INSTALLED_APPS = (
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.sites',
+    'django.contrib.messages',
+    'django.contrib.staticfiles',
+    'django.contrib.admin',
+    'homepage',
+)
+
+# 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,
+    'formatters': {
+        'verbose': {
+            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
+        },
+    },
+    'handlers': {
+        'console': {
+            'level': 'INFO',
+            'class': 'logging.StreamHandler',
+            'formatter': 'verbose',
+        }
+    },
+    'loggers': {
+        'django.request': {
+            'handlers': ['console'],
+            'level': 'INFO',
+            'propagate': True,
+        },
+    }
+}
+
+CONTEST_MODE = cfg['contest_mode']

File homepage/homepage/static/design.css

View file
  • Ignore whitespace
+body{
+    margin: auto;
+    background: #fbfbfb;
+    font-family: Arial,sans-serif;
+}
+h1{
+    font-weight: bold;
+    margin: auto;
+    text-align: center;
+    font-size: 3em;
+    vertical-align: middle;
+}
+h2{
+    font-weight: bold;
+    margin: auto;
+    text-align: center;
+}
+a,a:active,a:hover,a:visited{
+    color: black;
+    font-size: 1.9em;
+}
+img{
+    margin-right: 10px;
+    vertical-align: middle;
+}
+
+ul{
+    margin: auto;
+    width: 600px;
+    margin-top: 40px;
+}
+
+li{
+    margin-bottom: 10px;
+}

File homepage/homepage/static/logo.png

  • Ignore whitespace
Added
New image

File homepage/homepage/templates/home.html

View file
  • Ignore whitespace
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>Bienvenue à Prologin !</title>
+    <link type="text/css" rel="stylesheet" media="all" href="/static/design.css" />
+  </head>
+  <body>
+    <h1><img src="/static/logo.png" alt="" />Finale Prologin</h1>
+    <h2>Liens pratiques</h2>
+    <ul>
+      {% for link in links %}
+      <li><a href="{{ link.url }}">{{ link.name }}</a></li>
+      {% endfor %}
+    </ul>
+  </body>
+</html>
+

File homepage/homepage/urls.py

View file
  • Ignore whitespace
+# -*- encoding: utf-8 -*-
+# Copyright (c) 2013 Pierre Bourdon <pierre.bourdon@prologin.org>
+# Copyright (c) 2013 Association Prologin <info@prologin.org>
+#
+# Prologin-SADM is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Prologin-SADM is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Prologin-SADM.  If not, see <http://www.gnu.org/licenses/>.
+
+from django.conf.urls import patterns, include, url
+from django.contrib import admin
+
+admin.autodiscover()
+
+urlpatterns = patterns('',
+    url(r'^$', 'homepage.views.home', name='home'),
+    url(r'^admin/', include(admin.site.urls)),
+)

File homepage/homepage/views.py

View file
  • Ignore whitespace
+# -*- encoding: utf-8 -*-
+# Copyright (c) 2013 Pierre Bourdon <pierre.bourdon@prologin.org>
+# Copyright (c) 2013 Association Prologin <info@prologin.org>
+#
+# Prologin-SADM is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Prologin-SADM is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Prologin-SADM.  If not, see <http://www.gnu.org/licenses/>.
+
+from django.conf import settings
+from django.shortcuts import render_to_response
+from homepage.models import Link
+
+def home(request):
+    links = Link.objects.filter(contest_only=settings.CONTEST_MODE)
+    links = links.order_by('display_order', 'name')
+    return render_to_response('home.html', { 'links': links })

File homepage/homepage/wsgi.py

View file
  • Ignore whitespace
+"""
+WSGI config for homepage 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
+
+# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
+# if running multiple sites in the same mod_wsgi process. To fix this, use
+# mod_wsgi daemon mode with each site in its own daemon process, or use
+# os.environ["DJANGO_SETTINGS_MODULE"] = "home.settings"
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "homepage.settings")
+
+# 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()
+
+from django.contrib.staticfiles.handlers import StaticFilesHandler
+application = StaticFilesHandler(application)
+
+# Apply WSGI middleware here.
+# from helloworld.wsgi import HelloWorldApplication
+# application = HelloWorldApplication(application)

File homepage/manage.py

View file
  • Ignore whitespace
 import sys
 
 if __name__ == "__main__":
-    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "home.settings")
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "homepage.settings")
 
     from django.core.management import execute_from_command_line
 

File install.py

View file
  • Ignore whitespace
     'udbsync': { 'uid': 20090, 'groups': ('udbsync', 'udbsync_public',
                                           'udb', 'udb_public') },
     'hfs': { 'uid': 20100, 'groups': ('hfs', 'hfs_public') },
-    'homepage': { 'uid': 20110, 'groups': ('homepage',) },
+    'homepage': { 'uid': 20110, 'groups': ('homepage', 'udbsync_public') },
     'redmine': { 'uid': 20120, 'groups': ('redmine',) },
     'presencesync_usermap': { 'uid': 20130,
                               'groups': ('presencesync_usermap',
     install_nginx_service('homepage')
     install_systemd_unit('homepage')
 
+    install_cfg_profile('homepage', group='homepage')
     install_cfg_profile('homepage-udbsync', group='homepage')
 
     if first_time:

File systemd/homepage.service

View file
  • Ignore whitespace
 Type=simple
 User=homepage
 WorkingDirectory=/var/prologin/homepage
-ExecStart=/var/prologin/venv/bin/gunicorn -b 127.0.0.1:20110 home.wsgi
+ExecStart=/var/prologin/venv/bin/gunicorn -b 127.0.0.1:20110 homepage.wsgi
 
 [Install]
 WantedBy=multi-user.target