# HG changeset patch # User rougeronj # Date 1424691617 -3600 # Node ID 1ada9d221ba3dfa25b1cb4a998f054184819eff7 # Parent ffb8340ba86fe103346151522e2ff1bd4da6102b init django server diff -r ffb8340ba86f -r 1ada9d221ba3 client/app/gallery/gallery.html --- a/client/app/gallery/gallery.html Mon Oct 06 23:23:37 2014 +0200 +++ b/client/app/gallery/gallery.html Mon Feb 23 12:40:17 2015 +0100 @@ -4,7 +4,7 @@
{{ i.metas_dict.name }}
Nom : {{ h.metas_dict.name }}
diff -r ffb8340ba86f -r 1ada9d221ba3 server/__init__.py diff -r ffb8340ba86f -r 1ada9d221ba3 server/admin.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/admin.py Mon Feb 23 12:40:17 2015 +0100 @@ -0,0 +1,7 @@ +from django.contrib import admin +from models import Record + + +admin.site.register(Record) + + diff -r ffb8340ba86f -r 1ada9d221ba3 server/manage.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/manage.py Mon Feb 23 12:40:17 2015 +0100 @@ -0,0 +1,10 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff -r ffb8340ba86f -r 1ada9d221ba3 server/models.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/models.py Mon Feb 23 12:40:17 2015 +0100 @@ -0,0 +1,26 @@ +''' +Created on Feb 19, 2014 + +@author: jr +''' + +from django.db import models +from taggit.managers import TaggableManager + + +class Record(models.Model): + + title = models.CharField(max_length=512, unique=False, blank=True, null=True) + description = models.CharField(max_length=512, unique=False, blank=True, null=True) + comment = models.CharField(max_length=512, unique=False, blank=True, null=True) + source = models.CharField(max_length=512, unique=False, blank=True, null=True) + url = models.URLField(max_length=2048, unique=True, blank=False, null=False) + url_image = models.URLField(max_length=2048, unique=True, blank=True, null=True) + favorite = models.BooleanField(default=False, db_index=True) + tags = TaggableManager() + + def __unicode__(self): + return unicode(self.title) + + class Meta: + app_label = 'record' \ No newline at end of file diff -r ffb8340ba86f -r 1ada9d221ba3 server/settings.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/settings.py Mon Feb 23 12:40:17 2015 +0100 @@ -0,0 +1,84 @@ +""" +Django settings for ammico project. + +For more information on this file, see +https://docs.djangoproject.com/en/1.7/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.7/ref/settings/ +""" + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +import os +BASE_DIR = os.path.dirname(os.path.dirname(__file__)) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '0v@^(8qtky0yze1)_xrr15p9_lmd0xc@u^t--4_s7d6qlegd-l' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +TEMPLATE_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', +) + +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', +) + +ROOT_URLCONF = 'urls' + +WSGI_APPLICATION = 'wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/1.7/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.7/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.7/howto/static-files/ + +STATIC_URL = '/static/' diff -r ffb8340ba86f -r 1ada9d221ba3 server/urls.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/urls.py Mon Feb 23 12:40:17 2015 +0100 @@ -0,0 +1,16 @@ +from django.conf.urls import patterns, include, url +from django.contrib import admin +from models import Record + +admin.autodiscover() + +admin.site.register(Record) + +urlpatterns = patterns('', + # Examples: + # url(r'^$', 'ammico.views.home', name='home'), + # url(r'^blog/', include('blog.urls')), + + url(r'^admin/', include(admin.site.urls)), + url(r'^tour/', 'views.getTour', name='getTour'), +) diff -r ffb8340ba86f -r 1ada9d221ba3 server/views.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/views.py Mon Feb 23 12:40:17 2015 +0100 @@ -0,0 +1,6 @@ +from django.http import HttpResponse +import json + +def getTour(request): + #request tour from jamespot + return HttpResponse(content=json.dumps("{'test':true}"), content_type='application/json') diff -r ffb8340ba86f -r 1ada9d221ba3 server/wsgi.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/wsgi.py Mon Feb 23 12:40:17 2015 +0100 @@ -0,0 +1,14 @@ +""" +WSGI config for ammico 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.7/howto/deployment/wsgi/ +""" + +import os +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") + +from django.core.wsgi import get_wsgi_application +application = get_wsgi_application()