Migrated config app
This commit is contained in:
parent
e0ff2c60dd
commit
d29a7a736d
|
@ -0,0 +1,6 @@
|
|||
from django.contrib import admin
|
||||
from solo.admin import SingletonModelAdmin
|
||||
from .models import SiteConfiguration
|
||||
|
||||
|
||||
admin.site.register(SiteConfiguration, SingletonModelAdmin)
|
|
@ -0,0 +1,7 @@
|
|||
from .models import SiteConfiguration
|
||||
|
||||
|
||||
def config(request):
|
||||
return {
|
||||
'config': SiteConfiguration.objects.get()
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
from django.db import models
|
||||
from solo.models import SingletonModel
|
||||
|
||||
|
||||
class SiteConfiguration(SingletonModel):
|
||||
google_analytics = models.CharField(max_length=128, null=True, blank=True)
|
||||
readmore_tag = models.CharField(max_length=128, default='<!--readmore-->')
|
||||
|
||||
def __unicode__(self):
|
||||
return u'Site configuration'
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Site Configuration"
|
||||
verbose_name_plural = "Site Configuration"
|
||||
|
|
@ -31,6 +31,8 @@ ALLOWED_HOSTS = []
|
|||
# APPLICATIONS
|
||||
#
|
||||
INSTALLED_APPS = (
|
||||
'suit',
|
||||
'solo',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
|
@ -41,6 +43,12 @@ INSTALLED_APPS = (
|
|||
'django_jinja',
|
||||
|
||||
'compressor',
|
||||
|
||||
# Self
|
||||
# 'fmartingrcom.apps._core',
|
||||
# 'fmartingrcom.apps.homepage',
|
||||
'fmartingrcom.apps.config',
|
||||
# 'fmartingrcom.apps.blog',
|
||||
)
|
||||
|
||||
|
||||
|
@ -56,8 +64,6 @@ MIDDLEWARE_CLASSES = (
|
|||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
)
|
||||
|
||||
|
||||
|
||||
ROOT_URLCONF = 'fmartingrcom.urls'
|
||||
|
||||
WSGI_APPLICATION = 'fmartingrcom.wsgi.application'
|
||||
|
@ -128,3 +134,14 @@ TEMPLATE_DIRS = (
|
|||
JINJA2_EXTENSIONS = [
|
||||
'compressor.contrib.jinja2ext.CompressorExtension',
|
||||
]
|
||||
|
||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
"django.core.context_processors.debug",
|
||||
"django.core.context_processors.i18n",
|
||||
"django.core.context_processors.media",
|
||||
"django.core.context_processors.static",
|
||||
"django.core.context_processors.tz",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
"fmartingrcom.apps.config.context_processors.config"
|
||||
)
|
||||
|
|
|
@ -89,7 +89,6 @@
|
|||
</section>
|
||||
{% block footer %}
|
||||
{% endblock %}
|
||||
{# TODO preferences app
|
||||
{% if config.GOOGLE_ANALYTICS %}
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
|
@ -100,6 +99,5 @@
|
|||
ga('send', 'pageview');
|
||||
</script>
|
||||
{% endif %}
|
||||
#}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -9,6 +9,7 @@ dj-database-url==0.3.0
|
|||
|
||||
django-suit==0.2.9
|
||||
django-reversion==1.8.2
|
||||
jango-solo==1.0.5
|
||||
|
||||
pytz==2014.7
|
||||
|
||||
|
|
Loading…
Reference in New Issue