Re: [mezzanine-users] wrong base.html

2016-08-12 Thread dznektra
Hi again,

I have a question regarding your answer. It's all within the context of 
multi tenancy, which I forgot to tell before. I have the following folder 
structure (see screeshot), according to your last answer, where 
A/templates/index.html extends B/A/templates/base.html. This might be 
counterintuitive for maintainers and I'd like to have all files of A in one 
folder (A/..) and all files of B in another folder (B/..).

Is this somehow possible?

Thank you very much!

David

On Monday, August 1, 2016 at 8:56:35 PM UTC-3, Eduardo Rivas wrote:
>
> Django templates don't work with absolute paths (or if they do, it's not 
> a good idea for portability). The templates you want to refer to in {% 
> extends %} are relative to the templates/ directory in each installed app. 
>
> Since all templates/ directories from all apps are combined into one 
> "pool", you should always reuse the application name inside the 
> templates/ folder. For example, for your nektra template, the base.html 
> file should be at nektra/templates/nektra/base.html. And then you can 
> extend it with {% extends "nektra/base.html" %}. 
>
> The same goes for your coinfabrik application. The base template should 
> be in coinfabrik/templates/coinfabrik/base.html, and you can then 
> reference it in templates as "coinfabrik/base.html". 
>
> This is a common pattern in Django, but I couldn't find any 
> documentation that supports it. Hopefully someone else can reference a 
> reputable source that explains it. 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] wrong base.html

2016-08-02 Thread dznektra
Thanks, this was helpful! 



On Monday, August 1, 2016 at 8:56:35 PM UTC-3, Eduardo Rivas wrote:
>
> Django templates don't work with absolute paths (or if they do, it's not 
> a good idea for portability). The templates you want to refer to in {% 
> extends %} are relative to the templates/ directory in each installed app. 
>
> Since all templates/ directories from all apps are combined into one 
> "pool", you should always reuse the application name inside the 
> templates/ folder. For example, for your nektra template, the base.html 
> file should be at nektra/templates/nektra/base.html. And then you can 
> extend it with {% extends "nektra/base.html" %}. 
>
> The same goes for your coinfabrik application. The base template should 
> be in coinfabrik/templates/coinfabrik/base.html, and you can then 
> reference it in templates as "coinfabrik/base.html". 
>
> This is a common pattern in Django, but I couldn't find any 
> documentation that supports it. Hopefully someone else can reference a 
> reputable source that explains it. 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] wrong base.html

2016-08-01 Thread Ryne Everett
>
> This is a common pattern in Django, but I couldn't find any documentation
> that supports it. Hopefully someone else can reference a reputable source
> that explains it.


The django tutorial
 has a section
on "Template namespacing". There's a similar section on "Static file
namespacing" in part 6.

On Mon, Aug 1, 2016 at 7:56 PM, Eduardo Rivas 
wrote:

> Django templates don't work with absolute paths (or if they do, it's not a
> good idea for portability). The templates you want to refer to in {%
> extends %} are relative to the templates/ directory in each installed app.
>
> Since all templates/ directories from all apps are combined into one
> "pool", you should always reuse the application name inside the templates/
> folder. For example, for your nektra template, the base.html file should be
> at nektra/templates/nektra/base.html. And then you can extend it with {%
> extends "nektra/base.html" %}.
>
> The same goes for your coinfabrik application. The base template should be
> in coinfabrik/templates/coinfabrik/base.html, and you can then reference it
> in templates as "coinfabrik/base.html".
>
> This is a common pattern in Django, but I couldn't find any documentation
> that supports it. Hopefully someone else can reference a reputable source
> that explains it.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] wrong base.html

2016-08-01 Thread Eduardo Rivas
Django templates don't work with absolute paths (or if they do, it's not 
a good idea for portability). The templates you want to refer to in {% 
extends %} are relative to the templates/ directory in each installed app.


Since all templates/ directories from all apps are combined into one 
"pool", you should always reuse the application name inside the 
templates/ folder. For example, for your nektra template, the base.html 
file should be at nektra/templates/nektra/base.html. And then you can 
extend it with {% extends "nektra/base.html" %}.


The same goes for your coinfabrik application. The base template should 
be in coinfabrik/templates/coinfabrik/base.html, and you can then 
reference it in templates as "coinfabrik/base.html".


This is a common pattern in Django, but I couldn't find any 
documentation that supports it. Hopefully someone else can reference a 
reputable source that explains it.



--
You received this message because you are subscribed to the Google Groups "Mezzanine 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] wrong base.html

2016-08-01 Thread dznektra
I have to themes (nektra and coinfabrik). {% extends "base.html" %} in 
coinfabrik/templates/index.html renders nektra/templates/base.html but I'd 
like to make it render coinfabrik/templates/base.html. 

How can I do that?

Thank you very much!


-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

from __future__ import absolute_import, unicode_literals
import os
from django.utils.translation import ugettext_lazy as _


##
# MEZZANINE SETTINGS #
##

# The following settings are already defined with default values in
# the ``defaults.py`` module within each of Mezzanine's apps, but are
# common enough to be put here, commented out, for conveniently
# overriding. Please consult the settings documentation for a full list
# of settings Mezzanine implements:
# http://mezzanine.jupo.org/docs/configuration.html#default-settings

# Controls the ordering and grouping of the admin menu.
#
# ADMIN_MENU_ORDER = (
# ("Content", ("pages.Page", "blog.BlogPost",
#"generic.ThreadedComment", (_("Media Library"), "fb_browse"),)),
# ("Site", ("sites.Site", "redirects.Redirect", "conf.Setting")),
# ("Users", ("auth.User", "auth.Group",)),
# )

# A three item sequence, each containing a sequence of template tags
# used to render the admin dashboard.
#
# DASHBOARD_TAGS = (
# ("blog_tags.quick_blog", "mezzanine_tags.app_list"),
# ("comment_tags.recent_comments",),
# ("mezzanine_tags.recent_actions",),
# )

# A sequence of templates used by the ``page_menu`` template tag. Each
# item in the sequence is a three item sequence, containing a unique ID
# for the template, a label for the template, and the template path.
# These templates are then available for selection when editing which
# menus a page should appear in. Note that if a menu template is used
# that doesn't appear in this setting, all pages will appear in it.

# PAGE_MENU_TEMPLATES = (
# (1, _("Top navigation bar"), "pages/menus/dropdown.html"),
# (2, _("Left-hand tree"), "pages/menus/tree.html"),
# (3, _("Footer"), "pages/menus/footer.html"),
# )

# A sequence of fields that will be injected into Mezzanine's (or any
# library's) models. Each item in the sequence is a four item sequence.
# The first two items are the dotted path to the model and its field
# name to be added, and the dotted path to the field class to use for
# the field. The third and fourth items are a sequence of positional
# args and a dictionary of keyword args, to use when creating the
# field instance. When specifying the field class, the path
# ``django.models.db.`` can be omitted for regular Django model fields.
#
# EXTRA_MODEL_FIELDS = (
# (
# # Dotted path to field.
# "mezzanine.blog.models.BlogPost.image",
# # Dotted path to field class.
# "somelib.fields.ImageField",
# # Positional args for field class.
# (_("Image"),),
# # Keyword args for field class.
# {"blank": True, "upload_to": "blog"},
# ),
# # Example of adding a field to *all* of Mezzanine's content types:
# (
# "mezzanine.pages.models.Page.another_field",
# "IntegerField", # 'django.db.models.' is implied if path is omitted.
# (_("Another name"),),
# {"blank": True, "default": 1},
# ),
# )

# Setting to turn on featured images for blog posts. Defaults to False.
#
# BLOG_USE_FEATURED_IMAGE = True

# If True, the django-modeltranslation will be added to the
# INSTALLED_APPS setting.
USE_MODELTRANSLATION = False



# MAIN DJANGO SETTINGS #


# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED_HOSTS = [
	'nektra.com',  # Allow domain and subdomains
	'coinfabrik.com.', # Also allow FQDN and subdomains
]

# HOST_THEMES = [
# 	('nektra.com', 'nektra'), 
# 	('coinfabrik.com', 'coinfabrik')
# ]

HOST_THEMES = [
	('localhost:8000', 'nektra'), 
	('127.0.0.1:8000', 'coinfabrik')
]

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Argentina/Buenos_Aires'

# If you set this to True, Django will use timezone-aware datetimes.
USE_TZ = True

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = "en"

# Supported