Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Absolute Path for Odt Models, not only from template folder. #2

Open
dudanogueira opened this issue Jul 27, 2016 · 2 comments
Open

Comments

@dudanogueira
Copy link
Contributor

Not really a Issue, but more a feature: Allow absolute path for template odt, as I would like to not use a template from template folder.

One might be able to get a file from a Model FileField and use it as the odt model. This may be accomplished by trying to get the template from the provided path first, if it fails, try loading from the template folder (or vice versa).

I'll try to implement this on my fork and pull request it later.

Thanks for this awesome project, by the way. Also saw a nice jabber related project of yours. I am also interested on that one as I have some solution that sends. I'll test it later against the latest Spark Server.

@alexmorozov
Copy link
Owner

alexmorozov commented Aug 13, 2016

The idea is quite reasonable, but it's achievable right now without altering the code. If you want to serve templates outside your Django installation path (which can be the epic security hole btw), you can just configure the filesystem loader's DIRS setting appropriately:

TEMPLATES = [{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [MEDIA_ROOT], # allow templates to be found among the uploaded files
}]

Please let me know what do you think about this way of tackling the problem. Does it work for you?

@alexmorozov
Copy link
Owner

alexmorozov commented Aug 13, 2016

In regard to django-jabber - sure, give it a go, I'd be happy to hear some suggestions from you. We have it running in production against the Openfire for several years, so far so good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants