diff --git a/idre/settings.py b/idre/settings.py index 7ebe6e9..7bd816b 100644 --- a/idre/settings.py +++ b/idre/settings.py @@ -8,22 +8,16 @@ 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/ import idre.local_settings -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = idre.local_settings.SECRET_KEY -# SECURITY WARNING: don't run with debug turned on in production! +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(__file__)) + +SECRET_KEY = idre.local_settings.SECRET_KEY DEBUG = idre.local_settings.DEBUG -TEMPLATE_DEBUG = idre.local_settings.TEMPLATE_DEBUG ALLOWED_HOSTS = ["idre.shgck.io", "idre.xyz"] @@ -33,45 +27,46 @@ ADMINS = ( ("Shgck", "shgck@pistache.land"), ) # Application definition INSTALLED_APPS = ( - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', - 'label' + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", + "label" ) 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.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 = 'idre.urls' +ROOT_URLCONF = "idre.urls" -WSGI_APPLICATION = 'idre.wsgi.application' +WSGI_APPLICATION = "idre.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'), + "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 = 'fr-FR' -TIME_ZONE = 'Europe/Paris' +LANGUAGE_CODE = "fr-FR" +TIME_ZONE = "Europe/Paris" USE_I18N = True USE_L10N = True USE_TZ = True @@ -80,13 +75,28 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.6/howto/static-files/ -MEDIA_ROOT = os.path.join(BASE_DIR, 'media') -MEDIA_URL = '/media/' +MEDIA_ROOT = os.path.join(BASE_DIR, "media") +MEDIA_URL = "/media/" -STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static'), ) -STATIC_URL = '/static/' +STATICFILES_DIRS = ( os.path.join(BASE_DIR, "static"), ) +STATIC_URL = "/static/" -TEMPLATE_DIRS = ( os.path.join(BASE_DIR, 'templates'), ) +TEMPLATES = [{ + "APP_DIRS": True, + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [ os.path.join(BASE_DIR, "templates") ], + "OPTIONS": { + "context_processors": [ + "django.contrib.auth.context_processors.auth", + "django.template.context_processors.debug", + "django.template.context_processors.i18n", + "django.template.context_processors.media", + "django.template.context_processors.static", + "django.template.context_processors.tz", + "django.contrib.messages.context_processors.messages" + ] + } +}] # Misc options diff --git a/idre/urls.py b/idre/urls.py index b946bac..3845ae4 100644 --- a/idre/urls.py +++ b/idre/urls.py @@ -1,24 +1,25 @@ -from django.conf.urls import patterns, include, url +from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin -from idre import settings +import idre.settings import label.views admin.autodiscover() -urlpatterns = patterns("", - url(r"^$", label.views.home, name = "home"), - url(r"^artists/$", "label.views.artists", name = "artists"), - url(r"^artists/(?P\S+)$", "label.views.artist", name = "artist"), - url(r"^releases/$", "label.views.releases", name = "releases"), - url(r"^releases/(?P\S+)$", "label.views.release", name = "release"), - url(r"^admin/", include(admin.site.urls)), -) -if settings.DEBUG: +urlpatterns = [ + url(r"^$", label.views.home, name = "home"), + url(r"^artists/$", label.views.artists, name = "artists"), + url(r"^artists/(?P\S+)$", label.views.artist, name = "artist"), + url(r"^releases/$", label.views.releases, name = "releases"), + url(r"^releases/(?P\S+)$", label.views.release, name = "release"), + url(r"^admin/", include(admin.site.urls)), +] + +if idre.settings.DEBUG: urlpatterns += static( - settings.MEDIA_URL, - document_root = settings.MEDIA_ROOT - ) \ No newline at end of file + idre.settings.MEDIA_URL, + document_root = idre.settings.MEDIA_ROOT + ) diff --git a/static/css/base.css b/static/css/base.css index a4d7976..65e06ac 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -2,7 +2,7 @@ body { font-family: 'Lato', sans-serif; color: #393939; background-color: white; - background-image: url("/static/img/background.png"); + background-image: url("/static/img/bg.png"); background-repeat: no-repeat; background-position: top center; background-attachment: fixed; @@ -15,7 +15,6 @@ body { margin-top: 20px; margin-bottom: 20px; padding: 10px 10px 10px 10px; - /* background-color: white; */ box-shadow: h-pos v-pos (blur) (spread) (color) (inset); } diff --git a/static/img/background.png b/static/img/bg.png similarity index 100% rename from static/img/background.png rename to static/img/bg.png diff --git a/static/img/logo.png b/static/img/logo.png index d0b5cc7..58b212e 100644 Binary files a/static/img/logo.png and b/static/img/logo.png differ