django admin templates: filter hides table contents

2012-02-13 Thread Gelonida N
Hi, I wanted to know whether anybody modified the django admin templates such, that the filter div could be hidden. At the moment the containing the filters may hide the contents of the table. As I can imagine, that I'm not the only one who might have large tables and doesn't like,

Re: Generating a list of available templates

2012-02-11 Thread Patrick Wellever
sult = [] > for i in os.listdir(path): > if not os.path.isdir(os.path.join(path, i)): > result.append(i) > else: > result.extend(recursive_search(os.path.join(path, i))) > return result > > def myview(request): > templates = [] > # the next 2 lines handles templa

Re: Generating a list of available templates

2012-02-11 Thread bb6xt
xtend(recursive_search(os.path.join(path, i))) return result def myview(request): templates = [] # the next 2 lines handles templates in explicit template directories for path in TEMPLATE_DIRS: templates.extend(recursive_search(path)) # the next 2 will handle template dir gene

Re: Generating a list of available templates

2012-02-10 Thread Patrick Wellever
Thanks for the reply. Yes, this wouldn't be too tough if the directories in TEMPLATE_DIRS were all I had to worry about, but the glitch I mentioned earlier is that Django can also look for templates in places other than those listed explicitly in that setting. For example, the template l

Re: Generating a list of available templates

2012-02-10 Thread Bill Beal
I know nothing, but here's what I did: python manage.py shell import os from settings import TEMPLATE_DIRS for x in TEMPLATE_DIRS: print x os.listdir(x) It gave me a list of the files in the (each) template directory. It looks like you already have a list of template directories in settings.

Re: Generating a list of available templates

2012-02-10 Thread Patrick Wellever
pages/custom_template.html'. I want the exact same functionality, but I just want the admin site to display a select list of all templates in a given directory instead of a blank text field. So within my templates directory I'd make a directory at "flatpages/templ

Re: Generating a list of available templates

2012-02-10 Thread Python_Junkie
I think I just figured out what you want to do. You want one drop down list with all of the templates listed regardless of which folder the template lives in. So, as describe above you would create a dictionary of template_names by walking through the directories where the templates live and

Re: Generating a list of available templates

2012-02-10 Thread Patrick Wellever
Thanks -- you must be on your way out the door now so I won't call, but according to your area code it looks like we might be neighbors. ;) So following the syntax I wrote out, what I still need to know is how do I get to EVERY_DIRECTORY_DJANGO_LOOKS_FOR_TEMPLATES_IN. That's a variable that represe

Re: Generating a list of available templates

2012-02-10 Thread Python_Junkie
ks for bearing with me. ;) > > You definitely have the right idea of what I'm trying to do -- the only > problem with this method is that Django looks for templates in multiple > places, so I don't actually know the absolute path to the directory the > templates are in. You q

Re: Generating a list of available templates

2012-02-10 Thread Patrick Wellever
Sorry, this question is turning out to be much more difficult to articulate than I originally expected. Thanks for bearing with me. ;) You definitely have the right idea of what I'm trying to do -- the only problem with this method is that Django looks for templates in multiple places, so I

Re: Generating a list of available templates

2012-02-10 Thread Python_Junkie
The internet is a wonderful invention, but sometimes the interchange of the spoken word is more efficient. Let's see if I have this straight. You know which directory the templates are in. 'templates/flatpages/page_templates/ for example. Is that correct? Then when you pass from

Re: Generating a list of available templates

2012-02-10 Thread Demetrio Girardi
On 10 Feb 2012 at 14:50, Patrick Wellever wrote: > I want to make it a choice field that justs lists all the files in, for > example, > 'templates/flatpages/page_templates/', so the user can see what templates are > available and just > choose one from a selec

Re: Generating a list of available templates

2012-02-10 Thread Patrick Wellever
ser has to know which templates are available, then enter something like 'flatpages/some_template.hrml' in the field. I want to make it a choice field that justs lists all the files in, for example, 'templates/flatpages/page_templates/', so the user can see what templates are

Re: Generating a list of available templates

2012-02-10 Thread Python_Junkie
I am not sure that I follow you. When you mention creating new templates (you would be creating these dynamically?) and have them show up in your database (model?) Please explain or provide an example On Feb 10, 1:45 pm, Patrick Wellever wrote: > Right, I understand the loader works this

Re: Generating a list of available templates

2012-02-10 Thread Patrick Wellever
Right, I understand the loader works this way… What I'm trying to do is generate a list of 'choices' for a model field that populates itself automatically with available templates in a given directory, that works regardless of whether the specified directory is on a template pat

Re: Generating a list of available templates

2012-02-10 Thread Python_Junkie
https://docs.djangoproject.com/en/dev/ref/templates/api/ Search on template loaders and this url will explain it. The following is from this url django.template.loaders.app_directories.Loader Loads templates from Django apps on the filesystem. For each app in INSTALLED_APPS, the

Re: Generating a list of available templates

2012-02-10 Thread Patrick Wellever
file is a python module. > > See page > https://docs.djangoproject.com/en/dev/topics/settings/ > > Since the path is set for the templates. > *** > frrom the example > > TEMPLATE_DIRS = ('/home/templates/mike') > > in the view > &g

Re: Generating a list of available templates

2012-02-10 Thread Python_Junkie
The setttings file is a python module. See page https://docs.djangoproject.com/en/dev/topics/settings/ Since the path is set for the templates. *** frrom the example TEMPLATE_DIRS = ('/home/templates/mike') in the view templates=os.listdir(TEMPLATE_DIRS) ###template

Re: Generating a list of available templates

2012-02-10 Thread Micky Hulse
s to choose from a list of files rather than have to remember what's there on the file system. I suppose one way to do it would be to create an FK to another model what someone has entered the paths to available templates... But, I do like the idea of reading the contents of a folder and having

Generating a list of available templates

2012-02-10 Thread Patrick Wellever
s dynamically from a directory on the template path. So for example, I can create a directory like "templates/myapp/entry_detail/" and have the choice field simply look into that directory and list its contents as options. I could figure it out using an absolute filesystem path, but I&

Re: Django (or other) templates for untrusted users?

2012-02-09 Thread graeme
so does not seem to have a solution. > > Bill > > On 1/26/12, graeme wrote: > > > > > > > > > Are Django templates safe enough to use templates provided by > > untrusted users? Is it possible to limit functionality? I am not only > > concerned with w

Re: How to check the HTTP_HOST from templates/404.html when using flat pages

2012-02-06 Thread tiff
I must have been tired! Simply added code to existing context processor to provide request.META['HTTP_HOST'] as a variable in the returned dictionary. Doh! -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

How to check the HTTP_HOST from templates/404.html when using flat pages

2012-02-06 Thread tiff
Hi, I am using flatpages and I have a 404.html in my templates directory. I need the 404 page to extend different templates depending on the HTTP_HOST (the same app is delivering pages for multiple domains). What's the easiest way to achieve this from the 404 page without overriding th

Re: passing context data to inherited templates

2012-01-29 Thread Daniel Roseman
template. The base template is imported to all of templates using the > 'extends' template tag. Now the base template needs a dictionary of data. > My question is, how do I pass this data to the base template? I'm passing > it in the context data of every view that re

passing context data to inherited templates

2012-01-28 Thread Mike
In a project I'm working on I have a status bar at the top of the webpage that will render data using template tags. The status bar will be displayed on all of my views, so I want to put the html code in my base template. The base template is imported to all of templates using the &#x

Re: Django (or other) templates for untrusted users?

2012-01-26 Thread Bill Freeman
> Are Django templates safe enough to use templates provided by > untrusted users? Is it possible to limit functionality? I am not only > concerned with what the templates can access, but also things like > being able to consume excessive resources with, for example, deeply > nest

Django (or other) templates for untrusted users?

2012-01-26 Thread graeme
Are Django templates safe enough to use templates provided by untrusted users? Is it possible to limit functionality? I am not only concerned with what the templates can access, but also things like being able to consume excessive resources with, for example, deeply nested loops. If not Django

Re: render_to_response pointing to multiple templates

2011-12-27 Thread laras126
mes > > I got another one, if you dont mind > > how can I retrieve information on a template, such as name and url inside > a view? I'd like to use it to differentiate between templates and > use logic to pick the template I want to render > > again, Tom, thanks for yo

Possible issue with admindoc templates

2011-12-19 Thread James Pic
Hello everybody, Consider such a setup: templates/base.html: loads jquery in {% block jquery %} templates/admin/base_site.html: extends base.html, sets {% block jquery %}{% endblock %} so that the parent template doesn't interfere with django admin's loading of jquery That worked p

Re: Translating templates

2011-12-14 Thread Karen Tracey
On Wed, Dec 14, 2011 at 3:13 PM, Demetrio Girardi < demetrio.gira...@gmail.com> wrote: > My project has a bunch of text embedded deep within the html markup in > templates that I need to translate. The text, imo, belongs to templates > and it > has no place in the application lo

Translating templates

2011-12-14 Thread Demetrio Girardi
My project has a bunch of text embedded deep within the html markup in templates that I need to translate. The text, imo, belongs to templates and it has no place in the application logic. >From what I understand, localization in templates is limited to variables, which is not useful to

Re: What's the django convention for templates?

2011-12-10 Thread Torsten Bronger
Hallöchen! Torsten Bronger writes: > [...] If someone wants to create a local variation of a template, > he simply creates > > my_app_local/templates/my_app/my_view.html > > and puts my_app_local instead of my_app into INSTALLED_APPS. Sorry, this was rubbish. It must r

Re: What's the django convention for templates?

2011-12-10 Thread Torsten Bronger
.py > | urls.py > > | app folder | > -- >| many files >

Re: What's the django convention for templates?

2011-12-10 Thread Mauro
Thank you :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/LCxQRS7kTnkJ. To post to this group, send email to django-users@googlegroups.com. To unsubscrib

Re: What's the django convention for templates?

2011-12-09 Thread Vovk Donets
> > > As you can see the templates directory is stored inside the app directory. > > Reading the django documentation instead they says that the templates dir > should live inside the root directory of the projects. > > I'm wondering, what's is the common con

What's the django convention for templates?

2011-12-09 Thread Mauro
Hello, I'm totally new in the django universe and I'm trying out to build a little project. There are many days who I'm following many tutorial on django framework. But it's not clear for me how the convention for templates is. Following the djangobook I've bui

Re: iterating through lists in templates

2011-11-25 Thread Tom Evans
On Fri, Nov 25, 2011 at 1:32 PM, marjenni wrote: > Thank you for the quick reply :) > > What I am currently doing is passing 3 separate lists to the template, > each representing the column of a table so that i can do something > this: > >  {% for i in numberOfImages %} >     >         {{ images.i

Re: iterating through lists in templates

2011-11-25 Thread Sandro Dutra
ribute named 'i' on the >> 'images' variable. >> >> As an earlier poster said, pass a list of images to output, and then >> iterate through that list. If you need the ordinal of where you are in >> the list, that is made available by the for tag: >

Re: iterating through lists in templates

2011-11-25 Thread marjenni
te through that list. If you need the ordinal of where you are in > the list, that is made available by the for tag: > > https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#for > > Cheers > > Tom -- You received this message because you are subscribed to the G

Re: iterating through lists in templates

2011-11-25 Thread Sandro Dutra
Number of Images: {{ imageList.count }} {% for image in imageList %} Image NameImage File {{ image.name }}{{ image.file }} {% endfor %} 2011/11/25 Ivo Brodien : > You should pass a list of images to the template and iterate over this list. > > On Nov 25, 2011, at 14:18, marjenni wrote: > >> Hi al

Re: iterating through lists in templates

2011-11-25 Thread Ivo Brodien
{% for image in images %} {{ image }} If you need numbers there are counters for for-loops On Nov 25, 2011, at 14:18, marjenni wrote: > {% for i in numberOfImages %} -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: iterating through lists in templates

2011-11-25 Thread Tom Evans
ribute named 'i' on the 'images' variable. As an earlier poster said, pass a list of images to output, and then iterate through that list. If you need the ordinal of where you are in the list, that is made available by the for tag: https://docs.djangoproject.com/en/1.3/ref/te

Re: iterating through lists in templates

2011-11-25 Thread Ivo Brodien
You should pass a list of images to the template and iterate over this list. On Nov 25, 2011, at 14:18, marjenni wrote: > Hi all, > Why does this not work? > >{% for i in numberOfImages %} > > {{ images.i}} > > numberOfImages is the number of items in the images list.

iterating through lists in templates

2011-11-25 Thread marjenni
Hi all, Why does this not work? {% for i in numberOfImages %} {{ images.i}} numberOfImages is the number of items in the images list. I have a workaround using images.pop, but ideally i would like to be able to use an array index. all help much appreciated Mark --

Loading django templates/static files from pyrcc4 generated resource file

2011-11-24 Thread bb6xt
would be a lot cooler if I could do the same with my templates/static files in the django app. Is this possible? Which template loaders will allow me use this approach? Thanks in advance! Abraham. -- You received this message because you are subscribed to the Google Groups "Django

Re: key error in templates - solved

2011-11-12 Thread Evan Reiser
I had the same thing happen to me and this was the only post I found on the internet that mentions it. Note to other people who have this problem: *Be careful passing instances of model objects into celery tasks since they get pickled and your FileField fields will probably be removed via pick

Re: render_to_response pointing to multiple templates

2011-11-08 Thread jay K.
template, such as name and url inside a view? I'd like to use it to differentiate between templates and use logic to pick the template I want to render again, Tom, thanks for your assistance On Mon, Nov 7, 2011 at 2:04 PM, Tom Evans wrote: > On Mon, Nov 7, 2011 at 3:59 PM, jay K. > wr

Re: render_to_response pointing to multiple templates

2011-11-07 Thread Joey Espinosa
PM, Tom Evans wrote: > On Mon, Nov 7, 2011 at 3:59 PM, jay K. > wrote: > > hi, Tom > > > > thanks for the reply > > > > what I actually want to do is to > > list several templates in the render_to_response > > function and be able to choose which

Re: render_to_response pointing to multiple templates

2011-11-07 Thread Tom Evans
On Mon, Nov 7, 2011 at 3:59 PM, jay K. wrote: > hi, Tom > > thanks for the reply > > what I actually want to do is to > list several templates in the render_to_response > function and be able to choose which one to use > > can I choose which template to use? > >

Re: render_to_response pointing to multiple templates

2011-11-07 Thread jay K.
hi, Tom thanks for the reply what I actually want to do is to list several templates in the render_to_response function and be able to choose which one to use can I choose which template to use? thanks again, and let me know if my question is clear enough On Mon, Nov 7, 2011 at 12:18 PM, Tom

Re: render_to_response pointing to multiple templates

2011-11-07 Thread Tom Evans
... > > I want the render_to_response to point to more than 1 template. So far > I've tried adding a dictionary of templates but it gives me an error, > maybe I'm > not doing it properly > > If anyone can teach me how to do it I'd really appreciate it > > tha

render_to_response pointing to multiple templates

2011-11-07 Thread jay K.
ed adding a dictionary of templates but it gives me an error, maybe I'm not doing it properly If anyone can teach me how to do it I'd really appreciate it thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To p

one view for multiple templates

2011-11-07 Thread jay K.
Hello, I have a page with a form on it the form is handled by a view I want to create another page and embed the same form on it how can I use the same view on another template? do I have to modify the 'render_to_response' so it points to the other template (besides the current template)? tha

Re: How to do string operations in Templates?

2011-10-23 Thread Russell Keith-Magee
On Sun, Oct 23, 2011 at 10:18 AM, Lee wrote: > New to template language. I've perused the docs but can't find how to > do basic string operations like regex match/replace on {{ string > variables }} within a template. Can someone please steer me to the > right docs? The reason you haven't found a

How to do string operations in Templates?

2011-10-22 Thread Lee
New to template language. I've perused the docs but can't find how to do basic string operations like regex match/replace on {{ string variables }} within a template. Can someone please steer me to the right docs? Thanks much- Lee -- You received this message because you are subscribed to the G

Re: Templates available to a cluster

2011-10-20 Thread Konstantinos Pachnis
om this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > ---- > > Donald Stufft <mailto:donald.stu

Re: Templates available to a cluster

2011-10-19 Thread Javier Guerra Giraldez
On Wed, Oct 19, 2011 at 5:17 PM, Kurtis Mullins wrote: > Good idea. I'm going to check out MongoDB for this. Looks like there's > already some Django tools for it out there. > > On Wed, Oct 19, 2011 at 5:57 PM, Donald Stufft > wrote: >> >> If I wanted maximum performance from a distributed on the

Re: Templates available to a cluster

2011-10-19 Thread Kurtis Mullins
that you can store your template anywhere. > There is already an app for storing templates in the db, you could easily > make one to store it somewhere else as well. > > On Wednesday, October 19, 2011 at 5:48 PM, Kurtis wrote: > > I'm working on a project where I will even

Re: Templates available to a cluster

2011-10-19 Thread Donald Stufft
.com)> wrote: > > The template system uses pluggable loaders that can locate a template based > > upon it's name. So using that you can store your template anywhere. There > > is already an app for storing templates in the db, you could easily make > > one to stor

Re: Templates available to a cluster

2011-10-19 Thread Kurtis Mullins
, Oct 19, 2011 at 5:52 PM, Donald Stufft wrote: > The template system uses pluggable loaders that can locate a template > based upon it's name. So using that you can store your template anywhere. > There is already an app for storing templates in the db, you could easily > make on

Re: Templates available to a cluster

2011-10-19 Thread Donald Stufft
The template system uses pluggable loaders that can locate a template based upon it's name. So using that you can store your template anywhere. There is already an app for storing templates in the db, you could easily make one to store it somewhere else as well. On Wednesday, Octob

Templates available to a cluster

2011-10-19 Thread Kurtis
I'm working on a project where I will eventually need to be able to add/delete/manage templates on the fly. Our Django Application Servers are setup as a cluster behind an Nginx Front-end Server. We're not at that point, yet -- but I wanted to see if there's any architectural i

Re: Please help to get templates working at all

2011-10-13 Thread Piotr Hosowicz
> Your view doesn't seem to have anything at all to do with your template. The > only thing you pass to the template context is a form, which isn't mentioned > at all in the template, and you don't pass the only variable which is used > on the template, which is "campaigns". Yeah, you are great,

Re: Please help to get templates working at all

2011-10-13 Thread Piotr Hosowicz
> Your view doesn't seem to have anything at all to do with your template. The > only thing you pass to the template context is a form, which isn't mentioned > at all in the template, and you don't pass the only variable which is used > on the template, which is "campaigns". Yeah, you are great,

Re: Please help to get templates working at all

2011-10-13 Thread Daniel Roseman
On Thursday, 13 October 2011 16:36:21 UTC+1, Piotr Hosowicz wrote: > > I am writing my personal contact book and now want to make wish list > for Christmas. I cannot get simplest template working, the template > is: > > www.w3.org/TR/html4/loose.dtd"> > > > > Kampanie > > > > {% for

Please help to get templates working at all

2011-10-13 Thread Piotr Hosowicz
I am writing my personal contact book and now want to make wish list for Christmas. I cannot get simplest template working, the template is: Kampanie {% for campaign in campaigns %} {{ campaign.name }} {% endfor %} The model is : class Campaign(models.Model): name = models.

Re: Thread-safeness of templates

2011-10-05 Thread Brian Bouterse
To add to your example. Default arguments are parsed once by the interpreter, not each time the program is run. Most folks don't desire side effects like this. One way to avoid it is to only use immutable typesin python as keyword arguments (True,

Re: Thread-safeness of templates

2011-10-04 Thread Martin J. Laubach
Are you sure your context is thread-safe, ie. it's rebuilt from scratch every time you render an email and not re-used, stored in a global variable, class variable, whatever? Your problem description very much sounds like someone is fiddling with the context while the template is rendering.

Thread-safeness of templates

2011-10-04 Thread Francis Kung
Hi, My understanding is that Django is (or attempts to be) thread-safe, and I'm hoping someone can help me track down this problem: Part of my app uses django templates to create the content of an email, which it then sends out. The code is something like, email = 'a...@def.co

Re: Overwriting queryset from models for templates

2011-10-03 Thread gregory semah
Thanks for your answer! I will check if it really fit my need G. On 3 oct, 15:58, Shawn Milochik wrote: > That's what a custom manager is for: > > https://docs.djangoproject.com/en/1.3/topics/db/managers/#custom-mana... > > So you can replace your Book.objects with another Manager(), or add > a

Re: Overwriting queryset from models for templates

2011-10-03 Thread Shawn Milochik
That's what a custom manager is for: https://docs.djangoproject.com/en/1.3/topics/db/managers/#custom-managers So you can replace your Book.objects with another Manager(), or add another manager to be used for your custom stuff. -- You received this message because you are subscribed to the Goo

Re: Overwriting queryset from models for templates

2011-10-03 Thread gregory semah
Thanks for your quick answer I know that I can do that, of course, but this is not my question, i just want to know if it's possible and how, I mean overwriting queryset with others values not dependant of models instances, and be able to retrieve them from templates as part of objects T

Re: Overwriting queryset from models for templates

2011-10-03 Thread BILLION Sébastien
construct a new querySet like this [, param=True],[, param=False].. Maybe I could need to label the string(with param keyword like the example above) in order to use it in templates as {% for book in books %} {% if param =True %} DO THIS {% else %} DO THAT {% endif %} {% endfor %} Do you know a

Overwriting queryset from models for templates

2011-10-03 Thread gregory semah
er to construct a new querySet like this [, param=True],[, param=False].. Maybe I could need to label the string(with param keyword like the example above) in order to use it in templates as {% for book in books %} {% if param =True %} DO THIS {% else %} DO THAT {% endif %} {% endfor %} Do you

Re: Accessing sum in templates

2011-09-26 Thread David
Sorted: {{ issue.type__severity__sum }} doh :-/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegr

Accessing sum in templates

2011-09-26 Thread David
Hello In my view I have: a = Person.objects.select_related().get(pk=pk) b = a.issue_set.filter(resolution_date__isnull=True).aggregate(Sum('type__severity')) variables = RequestContext(request, { 'person': a, 'issue': b, }) r

Re: Template loader cannot find admin_doc templates

2011-09-15 Thread Piper
so I hope someone can help me out to understand how all this works. In the link above one reads: -- 1. "Optional: Linking to templates requires the ADMIN_FOR setting to be configured." -- To the best of my knowledge, the templates seem to be working

Re: Template loader cannot find admin_doc templates

2011-09-15 Thread James Bennett
On Thu, Sep 15, 2011 at 8:29 PM, Piper wrote: > Solved by adding 'django.contrib.admindocs' to the INSTALLED_APPS. Worth noting that this is the first thing you're instructed to do in the documentation for the admin docs system: https://docs.djangoproject.com/en/1.3/ref/contrib/admin/admindocs/

Re: Template loader cannot find admin_doc templates

2011-09-15 Thread Piper
Solved by adding 'django.contrib.admindocs' to the INSTALLED_APPS. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+un

Template loader cannot find admin_doc templates

2011-09-15 Thread Piper
c line below to enable admin documentation: url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), url(r'', include('django.contrib.flatpages.urls')), ) [/CUT] And settings.py has the

Re: Where is "base.html" that "templates/site_base.html" extends?

2011-09-09 Thread Christos Jonathan Hayward
onathan Hayward > >> "site_base.html", directly under the templates folder, extends a >> "base.html". >> >> Where is the base.html? I see several under the project heirarchy >> somewhere, and I'd like to know which one of them site_base.html exte

Re: Where is "base.html" that "templates/site_base.html" extends?

2011-09-09 Thread Leonardo Giordani
ou find in this sequence. Hope this helps, feel free to reply 2011/9/9 Christos Jonathan Hayward > "site_base.html", directly under the templates folder, extends a > "base.html". > > Where is the base.html? I see several under the project heirarchy > some

Re: Where is "base.html" that "templates/site_base.html" extends?

2011-09-09 Thread Eric Hutchinson
Django itself doesn't ship any templates. In order to understand where all your templates are, and how the {% extends 'template.html' %} functionality works, it's best to read the docs. https://docs.djangoproject.com/en/1.3/topics/templates/#id1 is a good starting point in

Where is "base.html" that "templates/site_base.html" extends?

2011-09-09 Thread Christos Jonathan Hayward
"site_base.html", directly under the templates folder, extends a "base.html". Where is the base.html? I see several under the project heirarchy somewhere, and I'd like to know which one of them site_base.html extends (if it does so), or else where I can go to edit si

Re: Argh: templates, admin, and app loading order

2011-08-31 Thread Nan
Hm, yes, that might work, although at this point I'm a little concerned about changing the order of applications anyway, since I'm not sure what other side effects it might have. Mostly I'm uncomfortable with how important application order ends up being to how one's project operates, especially

Re: Argh: templates, admin, and app loading order

2011-08-30 Thread Doug Ballance
Can you use the filesystem loader as the first template loader, then set TEMPLATE_DIRS in settings.py to specify a template directory outside any app? Use this location for all of your overrides, just make sure the path is right... ie each app you override would have its own subdirectory. -- You

Argh: templates, admin, and app loading order

2011-08-30 Thread Nan
So... I'm trying to keep all site-specific code and overrides to third- party app behavior in a single "current_site" app in my project. For the sake of template loading order, this app is listed first in INSTALLED_APPS so that its templates are located before the third- party

Re: How to load data from local static path in templates (security error)

2011-08-18 Thread Tom Evans
On Wed, Aug 17, 2011 at 8:39 PM, Daniel Roseman wrote: > On Wednesday, 17 August 2011 19:00:13 UTC+1, Adam Zedan wrote: >> >> Hi it seems I cant access data from local static paths such as >> c:\\somefolder\somefile.gif in my templates when I enter the url >>

Re: How to load data from local static path in templates (security error)

2011-08-17 Thread Daniel Roseman
On Wednesday, 17 August 2011 19:00:13 UTC+1, Adam Zedan wrote: > > Hi it seems I cant access data from local static paths such as > c:\\somefolder\somefile.gif in my templates when I enter the url > the code for my template is simplified to somethi

Re: Using {% url somenamedview %} in a custom page extending admin templates

2011-08-16 Thread Tom Evans
ed it says: > > TemplateSyntaxError at /admin/locationbase/location/ > Caught NoReverseMatch while rendering: Reverse for '' with arguments > '()' and keyword arguments '{}' not found. > > So the question is; how can I use the url template tag in templat

Using {% url somenamedview %} in a custom page extending admin templates

2011-08-15 Thread Thomas Weholt
nts '()' and keyword arguments '{}' not found. So the question is; how can I use the url template tag in templates extending the standard admin templates and refer to a view defined in my app by name? What am I now seeing here? -- Mvh/Best regards, Thomas Weholt http://www.weh

Re: django-registration - stuck at Required templates topic

2011-08-05 Thread Eyad Al-Sibai
I had the same thing... all what you need is to add " {% csrf_token %}" in each template for Post form it will solve your issue On Sat, Aug 6, 2011 at 7:42 AM, bob gailer wrote: > I have stumbled around following various pieces of advice: > > added to views: >from django.core.context_proce

Re: django-registration - stuck at Required templates topic

2011-08-05 Thread bob gailer
I have stumbled around following various pieces of advice: added to views: from django.core.context_processors import csrf modified views to end with: form = ContactForm() c = {} c.update(csrf(request)) c['form'] = form return render_to_response('contact_fo

Re: django-registration - stuck at Required templates topic

2011-08-04 Thread Bruce Dou
ngo. . it helps you alot as it help me too.. > On Aug 5, 2011 12:12 PM, "bob gailer" wrote: > > > > > > On Aug 4, 11:47 pm, Mario Gudelj wrote: > >> Hey Bob, > >> > >> You can download some basic templates for this pagehttp:// > devdoo

Re: django-registration - stuck at Required templates topic

2011-08-04 Thread Phang Mulianto
delj wrote: >> Hey Bob, >> >> You can download some basic templates for this pagehttp:// devdoodles.wordpress.com/2009/02/16/user-authentication-with-d... > > OK - did that - now what? I can get the login form displayed - when I > click get: > > Forbidden (403) &

Re: django-registration - stuck at Required templates topic

2011-08-04 Thread bob gailer
On Aug 4, 11:47 pm, Mario Gudelj wrote: > Hey Bob, > > You can download some basic templates for this > pagehttp://devdoodles.wordpress.com/2009/02/16/user-authentication-with-d... OK - did that - now what? I can get the login form displayed - when I click get: Forbidden

Re: django-registration - stuck at Required templates topic

2011-08-04 Thread Mario Gudelj
Hey Bob, You can download some basic templates for this page http://devdoodles.wordpress.com/2009/02/16/user-authentication-with-django-registration/ Cheers, On 5 August 2011 12:42, bob gailer wrote: > I followed the installation & configuration of django-registration up > to th

django-registration - stuck at Required templates topic

2011-08-04 Thread bob gailer
I followed the installation & configuration of django-registration up to the start of the Required templates topic. After that I am very lost. "In the default setup, you will need to create several templates required by django-registration" I have little idea what to do or

Humanizing decimals in templates

2011-07-29 Thread nixlists
Hi. The humanize module - https://docs.djangoproject.com/en/1.3/ref/contrib/humanize/ does not support humanizing decimal values similar to 'intcomma', only integers. Is there an extension to do so, and if not how would one write one? How would one use this http://djangosnippets.org/snippets/842/

Re: Doesn't render templates any longer

2011-07-28 Thread Benedict Verheyen
On 27/07/2011 23:39, Max Bachl wrote: > Hi all! > I've encountered a strange bug today. > I want to return an HTTP response with this code: > > def main(request): > t = loader.get_template("main/start.html") > return HttpResponse(t) > > However, the only result I get is > > > > <

<    2   3   4   5   6   7   8   9   10   11   >