From 3972a6aca30682c7b69bbbf2cb567ef23114d67e Mon Sep 17 00:00:00 2001
From: Tim Fechner <tim.fechner@hs-hannover.de>
Date: Wed, 16 Nov 2016 12:47:13 +0100
Subject: [PATCH] Make it an django-app

---
 README.md                          |   5 ++
 Readme.md                          |   3 -
 hshcdn/apps.py                     |   5 ++
 hshcdn/private_settings.example.py |  16 -----
 hshcdn/settings.py                 | 104 -----------------------------
 hshcdn/urls.py                     |  21 ------
 hshcdn/wsgi.py                     |  16 -----
 manage.py                          |  10 ---
 requirements.txt                   |   0
 setup.py                           |  31 +++++++++
 10 files changed, 41 insertions(+), 170 deletions(-)
 create mode 100644 README.md
 delete mode 100644 Readme.md
 create mode 100644 hshcdn/apps.py
 delete mode 100644 hshcdn/private_settings.example.py
 delete mode 100644 hshcdn/settings.py
 delete mode 100644 hshcdn/urls.py
 delete mode 100644 hshcdn/wsgi.py
 delete mode 100755 manage.py
 delete mode 100644 requirements.txt
 create mode 100644 setup.py

diff --git a/README.md b/README.md
new file mode 100644
index 00000000..2f314cf7
--- /dev/null
+++ b/README.md
@@ -0,0 +1,5 @@
+# hshcdn
+
+This is an django-app which provides styles, fonts, javascript and templates.
+
+Please read the [wiki](https://lab.it.hs-hannover.de/django/hshcdn/wikis/home) for further information and documentation.
diff --git a/Readme.md b/Readme.md
deleted file mode 100644
index b0ba5b64..00000000
--- a/Readme.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# hshcdn
-
-This should become a dedicated django project which manages global styles and contribute this styles via an own CDN
diff --git a/hshcdn/apps.py b/hshcdn/apps.py
new file mode 100644
index 00000000..a86e2e51
--- /dev/null
+++ b/hshcdn/apps.py
@@ -0,0 +1,5 @@
+from django.apps import AppConfig
+
+
+class HshcdnConfig(AppConfig):
+    name = 'hshcdn'
diff --git a/hshcdn/private_settings.example.py b/hshcdn/private_settings.example.py
deleted file mode 100644
index 155ea30d..00000000
--- a/hshcdn/private_settings.example.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# SECURITY WARNING: don't run with debug turned on in production!
-DEBUG = True
-
-# SECURITY WARNING: keep the secret key used in production secret!
-SECRET_KEY = 'vd771!1831r=$n!7xi0?&/(ยง$%)!r=n*-@zg2i$d(%7tn^+wgt0'
-
-ALLOWED_HOSTS = []
-
-# Database
-# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
-DATABASES = {
-    'default': {
-        'ENGINE': 'django.db.backends.sqlite3',
-        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
-    }
-}
diff --git a/hshcdn/settings.py b/hshcdn/settings.py
deleted file mode 100644
index 444a59a7..00000000
--- a/hshcdn/settings.py
+++ /dev/null
@@ -1,104 +0,0 @@
-"""
-Django settings for hshcdn project.
-
-Generated by 'django-admin startproject' using Django 1.9.1.
-
-For more information on this file, see
-https://docs.djangoproject.com/en/1.9/topics/settings/
-
-For the full list of settings and their values, see
-https://docs.djangoproject.com/en/1.9/ref/settings/
-"""
-
-import os
-
-# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
-BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-
-
-# Quick-start development settings - unsuitable for production
-# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
-
-
-# Application definition
-
-INSTALLED_APPS = [
-    'django.contrib.admin',
-    'django.contrib.auth',
-    'django.contrib.contenttypes',
-    'django.contrib.sessions',
-    'django.contrib.messages',
-    'django.contrib.staticfiles',
-]
-
-MIDDLEWARE_CLASSES = [
-    'django.middleware.security.SecurityMiddleware',
-    'django.contrib.sessions.middleware.SessionMiddleware',
-    'django.middleware.common.CommonMiddleware',
-    'django.middleware.csrf.CsrfViewMiddleware',
-    'django.contrib.auth.middleware.AuthenticationMiddleware',
-    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
-    'django.contrib.messages.middleware.MessageMiddleware',
-    'django.middleware.clickjacking.XFrameOptionsMiddleware',
-]
-
-ROOT_URLCONF = 'hshcdn.urls'
-
-TEMPLATES = [
-    {
-        'BACKEND': 'django.template.backends.django.DjangoTemplates',
-        'DIRS': [],
-        'APP_DIRS': True,
-        'OPTIONS': {
-            'context_processors': [
-                'django.template.context_processors.debug',
-                'django.template.context_processors.request',
-                'django.contrib.auth.context_processors.auth',
-                'django.contrib.messages.context_processors.messages',
-            ],
-        },
-    },
-]
-
-WSGI_APPLICATION = 'hshcdn.wsgi.application'
-
-
-# Password validation
-# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
-
-AUTH_PASSWORD_VALIDATORS = [
-    {
-        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
-    },
-    {
-        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
-    },
-    {
-        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
-    },
-    {
-        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
-    },
-]
-
-
-# Internationalization
-# https://docs.djangoproject.com/en/1.9/topics/i18n/
-
-LANGUAGE_CODE = 'en-us'
-
-TIME_ZONE = 'UTC'
-
-USE_I18N = True
-
-USE_L10N = True
-
-USE_TZ = True
-
-
-# Static files (CSS, JavaScript, Images)
-# https://docs.djangoproject.com/en/1.9/howto/static-files/
-
-STATIC_URL = '/static/'
-
-from hshcdn.private_settings import *
diff --git a/hshcdn/urls.py b/hshcdn/urls.py
deleted file mode 100644
index 87e2b32c..00000000
--- a/hshcdn/urls.py
+++ /dev/null
@@ -1,21 +0,0 @@
-"""hshcdn URL Configuration
-
-The `urlpatterns` list routes URLs to views. For more information please see:
-    https://docs.djangoproject.com/en/1.9/topics/http/urls/
-Examples:
-Function views
-    1. Add an import:  from my_app import views
-    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
-Class-based views
-    1. Add an import:  from other_app.views import Home
-    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
-Including another URLconf
-    1. Import the include() function: from django.conf.urls import url, include
-    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
-"""
-from django.conf.urls import url
-from django.contrib import admin
-
-urlpatterns = [
-    url(r'^admin/', admin.site.urls),
-]
diff --git a/hshcdn/wsgi.py b/hshcdn/wsgi.py
deleted file mode 100644
index 52a39ebf..00000000
--- a/hshcdn/wsgi.py
+++ /dev/null
@@ -1,16 +0,0 @@
-"""
-WSGI config for hshcdn project.
-
-It exposes the WSGI callable as a module-level variable named ``application``.
-
-For more information on this file, see
-https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
-"""
-
-import os
-
-from django.core.wsgi import get_wsgi_application
-
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hshcdn.settings")
-
-application = get_wsgi_application()
diff --git a/manage.py b/manage.py
deleted file mode 100755
index 2bc9cbbc..00000000
--- a/manage.py
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env python
-import os
-import sys
-
-if __name__ == "__main__":
-    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hshcdn.settings")
-
-    from django.core.management import execute_from_command_line
-
-    execute_from_command_line(sys.argv)
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index e69de29b..00000000
diff --git a/setup.py b/setup.py
new file mode 100644
index 00000000..8d42e34f
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,31 @@
+from setuptools import setup, find_packages
+import os
+
+# allow setup.py to be run from any path
+os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
+
+setup(
+    name='django-hshcdn',
+    version='0.1',
+    packages=find_packages(),
+    include_package_data=True,
+    license='MIT License',
+    description='Provides styles, fonts, javascript and templates',
+    long_description='Please read the README.md file!',
+    url='http://projects.it.hs-hannover.de/',
+    author='Tim Fechner',
+    author_email='tim.fechner@hs-hannover.de',
+    zip_safe=False,
+    classifiers=[
+        'Environment :: Web Environment',
+        'Framework :: Django',
+        'Intended Audience :: Developers',
+        'License :: OSI Approved :: MIT License',
+        'Operating System :: OS Independent',
+        'Programming Language :: Python',
+        # Replace these appropriately if you are stuck on Python 2.
+        'Programming Language :: Python :: 3.x',
+        'Topic :: Internet :: WWW/HTTP',
+        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
+    ],
+)
-- 
GitLab