From 629f2f85327e190bd295520ab47b3dc619e21a29 Mon Sep 17 00:00:00 2001
From: Andrew <andrew.waterhouse@unibas.ch>
Date: Wed, 24 Jun 2015 09:38:03 +0200
Subject: [PATCH] Step-1, App created and models ready to be activated

---
 LigandWorld/LigandWorld/__init__.py          |   0
 LigandWorld/LigandWorld/settings.py          | 112 +++++++++++++++++++
 LigandWorld/LigandWorld/urls.py              |  21 ++++
 LigandWorld/LigandWorld/wsgi.py              |  16 +++
 LigandWorld/annotator/__init__.py            |   0
 LigandWorld/annotator/admin.py               |   3 +
 LigandWorld/annotator/migrations/__init__.py |   0
 LigandWorld/annotator/models.py              |  33 ++++++
 LigandWorld/annotator/tests.py               |   3 +
 LigandWorld/annotator/views.py               |   3 +
 LigandWorld/db.sqlite3                       | Bin 0 -> 3072 bytes
 LigandWorld/manage.py                        |  10 ++
 pip_freeze.txt                               |   1 +
 13 files changed, 202 insertions(+)
 create mode 100755 LigandWorld/LigandWorld/__init__.py
 create mode 100755 LigandWorld/LigandWorld/settings.py
 create mode 100755 LigandWorld/LigandWorld/urls.py
 create mode 100755 LigandWorld/LigandWorld/wsgi.py
 create mode 100755 LigandWorld/annotator/__init__.py
 create mode 100755 LigandWorld/annotator/admin.py
 create mode 100755 LigandWorld/annotator/migrations/__init__.py
 create mode 100755 LigandWorld/annotator/models.py
 create mode 100755 LigandWorld/annotator/tests.py
 create mode 100755 LigandWorld/annotator/views.py
 create mode 100755 LigandWorld/db.sqlite3
 create mode 100755 LigandWorld/manage.py
 create mode 100755 pip_freeze.txt

diff --git a/LigandWorld/LigandWorld/__init__.py b/LigandWorld/LigandWorld/__init__.py
new file mode 100755
index 0000000..e69de29
diff --git a/LigandWorld/LigandWorld/settings.py b/LigandWorld/LigandWorld/settings.py
new file mode 100755
index 0000000..ffda3be
--- /dev/null
+++ b/LigandWorld/LigandWorld/settings.py
@@ -0,0 +1,112 @@
+"""
+Django settings for LigandWorld project.
+
+Generated by 'django-admin startproject' using Django 1.8.2.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/1.8/topics/settings/
+
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/1.8/ref/settings/
+"""
+
+# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
+import os
+
+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.8/howto/deployment/checklist/
+
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = '#v!-r@6de=w&6*pzb&em(*jvk(c90x=mqlr=(6_6qf3z#^+t#e'
+
+# SECURITY WARNING: don't run with debug turned on in production!
+DEBUG = True
+
+ALLOWED_HOSTS = []
+
+
+# Application definition
+
+INSTALLED_APPS = (
+    'django.contrib.admin',
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.messages',
+    'django.contrib.staticfiles',
+    'annotator'
+)
+
+MIDDLEWARE_CLASSES = (
+    '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',
+    'django.middleware.security.SecurityMiddleware',
+)
+
+ROOT_URLCONF = 'LigandWorld.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 = 'LigandWorld.wsgi.application'
+
+
+# Database
+# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+    }
+}
+
+
+# Internationalization
+# https://docs.djangoproject.com/en/1.8/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.8/howto/static-files/
+
+STATIC_URL = '/static/'
+
+STATICFILES_DIRS = (
+    os.path.join(BASE_DIR, "static"),
+)
+
+try:
+    from local_settings import *
+except ImportError:
+    pass
\ No newline at end of file
diff --git a/LigandWorld/LigandWorld/urls.py b/LigandWorld/LigandWorld/urls.py
new file mode 100755
index 0000000..ab8e0e2
--- /dev/null
+++ b/LigandWorld/LigandWorld/urls.py
@@ -0,0 +1,21 @@
+"""LigandWorld URL Configuration
+
+The `urlpatterns` list routes URLs to views. For more information please see:
+    https://docs.djangoproject.com/en/1.8/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. Add an import:  from blog import urls as blog_urls
+    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
+"""
+from django.conf.urls import include, url
+from django.contrib import admin
+
+urlpatterns = [
+    url(r'^admin/', include(admin.site.urls)),
+]
diff --git a/LigandWorld/LigandWorld/wsgi.py b/LigandWorld/LigandWorld/wsgi.py
new file mode 100755
index 0000000..bd90ab4
--- /dev/null
+++ b/LigandWorld/LigandWorld/wsgi.py
@@ -0,0 +1,16 @@
+"""
+WSGI config for LigandWorld 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.8/howto/deployment/wsgi/
+"""
+
+import os
+
+from django.core.wsgi import get_wsgi_application
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "LigandWorld.settings")
+
+application = get_wsgi_application()
diff --git a/LigandWorld/annotator/__init__.py b/LigandWorld/annotator/__init__.py
new file mode 100755
index 0000000..e69de29
diff --git a/LigandWorld/annotator/admin.py b/LigandWorld/annotator/admin.py
new file mode 100755
index 0000000..8c38f3f
--- /dev/null
+++ b/LigandWorld/annotator/admin.py
@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.
diff --git a/LigandWorld/annotator/migrations/__init__.py b/LigandWorld/annotator/migrations/__init__.py
new file mode 100755
index 0000000..e69de29
diff --git a/LigandWorld/annotator/models.py b/LigandWorld/annotator/models.py
new file mode 100755
index 0000000..804b04b
--- /dev/null
+++ b/LigandWorld/annotator/models.py
@@ -0,0 +1,33 @@
+from django.db import models
+
+# Create your models here.
+
+class Biounit(models.Model):
+	class Meta:					# Optional but
+		db_table = 'biounits'	# Recommended, name your DB table
+
+	smtl_id = models.CharField(max_length=10)
+	title = models.TextField()
+	resolution = models.FloatField()
+
+class Ligand(models.Model):
+	class Meta:					# Optional but
+		db_table = 'ligands'	# Recommended, name your DB table
+
+	biounit = models.ForeignKey(Biounit)
+	shortname = models.CharField(max_length=3)
+	longname = models.TextField()
+	annotation = models.CharField(max_length=128,
+					 			  choices=(
+									('unknown','Unknown'),
+									('irrelevant','Non-functional Binders'),
+									('buffer','Buffer'),
+									('solvent','Solvent'),
+									('impurity','Precipitate/Ion/Organic Non-Binder'),
+									('covalent','Covalent'),
+									('ptm','Post Translational Modification'),
+									('chemically_modified','Chemical modification'),
+									('non-covalent','Non-covalent'),
+									('natural','Natural, non covalently bound'),
+									('synthetic','Synthetic, non covalently bound'))
+                   				 )
diff --git a/LigandWorld/annotator/tests.py b/LigandWorld/annotator/tests.py
new file mode 100755
index 0000000..7ce503c
--- /dev/null
+++ b/LigandWorld/annotator/tests.py
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/LigandWorld/annotator/views.py b/LigandWorld/annotator/views.py
new file mode 100755
index 0000000..91ea44a
--- /dev/null
+++ b/LigandWorld/annotator/views.py
@@ -0,0 +1,3 @@
+from django.shortcuts import render
+
+# Create your views here.
diff --git a/LigandWorld/db.sqlite3 b/LigandWorld/db.sqlite3
new file mode 100755
index 0000000000000000000000000000000000000000..da0ecc634e05edf60fb587e2adb2b694db0e43b2
GIT binary patch
literal 3072
zcmWFz^vNtqRY=P(%1ta$FlJz3U}R))P*7lCU|?iG1t2~M!$gtUFfpt&F9QPu6VoLI
zW)-GOSQU&4j)nl$LLh*NO<Y@>F|s5vDJQkKFekGlHNH5turxI<8J)}Q9OUX4;;Inh
z=;Y(7fTmU>FEKY&r#Q7xvoVs9U0h$Eu_+O3W=d9KUV46fZf1H>Vo7FxUNMFM6N<S?
z81hOA8cLZdN(z~IC8_DDMGAiYAqsw>K0XQoL7u*jL6HjHu8|6kp&|aBe$GLzzOH^D
zItogO1qDh9Wr;<}8Hq(2My95kaBVsYN+7r5mQ5@u$jMAiQBp`rEJ-cN%uR)B)db~D
h1{SIX{-{BtAut*OLns7B^ZyWvtWl?qh5(gA008h(Y3Bd{

literal 0
HcmV?d00001

diff --git a/LigandWorld/manage.py b/LigandWorld/manage.py
new file mode 100755
index 0000000..1fc4bcf
--- /dev/null
+++ b/LigandWorld/manage.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+import os
+import sys
+
+if __name__ == "__main__":
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "LigandWorld.settings")
+
+    from django.core.management import execute_from_command_line
+
+    execute_from_command_line(sys.argv)
diff --git a/pip_freeze.txt b/pip_freeze.txt
new file mode 100755
index 0000000..0498df7
--- /dev/null
+++ b/pip_freeze.txt
@@ -0,0 +1 @@
+Django==1.8.2
-- 
GitLab