In Tutorial 2, I was instructed to make a templates directory. It is
located at:
C:\DjangoProjects\mysite\templates
Now again in Tutorial 3, section "Write views that actually do
something", I am given the instructions:
create a directory, somewhere on your filesys
On 21 déc, 15:01, Олег Корсак
wrote:
> hello. I have a question about using multiple apps on the same page
> (template).
>
> Lets imagine a template with two blocks
>
> {% block left_side %}{% endblock %}
> and
> {% block right_side %}{% endblock %}
>
> in left_side block there is a voting app for
hello. I have a question about using multiple apps on the same page
(template).
Lets imagine a template with two blocks
{% block left_side %}{% endblock %}
and
{% block right_side %}{% endblock %}
in left_side block there is a voting app for example and in the
right_side block there is a newsfee
Here you find a page about serving multiple templates on the same site
(and saving the preference in a session):
http://www.packtpub.com/article/multiple-templates-in-django
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
Hi,
Well here is an approach, you can use the Django's template engine
for generating dynamic CSS as well...
lets assume your templates path is TEMPLATES
Now create a (minimal) file called style.css in your TEMPLATES like
this:
h1 {
font-size: {{font_size}};
text-decor
Hello,
I'm developing a application that has the ability to be viewed with two
stylesheets.
There are some differences between the stylesheets. It's not only a different
CSS file that is loaded but some pages also have different HTML output.
How could something like this be implemented within th
template_source`
function.")
The "tools/example.tmpl" is a subdirectory under my templates dir,
which is configured in the settings TEMPLATE_DIRS and django has no
problem finding other templates in those subdirectories.
Can someone point out what I'm doing wrong here?
thanks
go views can be almost as usual: get parameters from the
> request, data from the database, filter and preprocess all you need,
> and feed to the relevant PDF format function.
>
> that way you get the same content/presentation separation, even if the
> presentation is written in proc
relevant PDF format function.
that way you get the same content/presentation separation, even if the
presentation is written in procedural python instead of descriptive
templates.
--
Javier
--
You received this message because you are subscribed to the Google Groups
"Django users" g
gt; > views.
>
> > My first question is - at the moment, I'm building up the PDF inside
> > my view. Is this really the recommended way of doing it? It's like
> > I've got presentation code inside my view (controller). Isn't there a
> > cleaner way of
ded way of doing it? It's like
> I've got presentation code inside my view (controller). Isn't there a
> cleaner way of doing it, or going from a template to PDF somehow? (I
> know ReportLab offers a commercial package using RML templates,
> however I was hoping for an opensour
nt, I'm building up the PDF inside
> my view. Is this really the recommended way of doing it? It's like
> I've got presentation code inside my view (controller). Isn't there a
> cleaner way of doing it, or going from a template to PDF somehow? (I
> know ReportLa
x27;t there a
cleaner way of doing it, or going from a template to PDF somehow? (I
know ReportLab offers a commercial package using RML templates,
however I was hoping for an opensource/free method).
Second question, I have a model with several FK fields. E.g.
class Article(models
If you want them to access everything on certain admin pages, then you
can change user permissions around to give them access to only a few
pages. If what you want can be picked out of (add, change, view),
then the permissions model works for that too. If you need something
more fine-grained, or
Hi all,
Django newbie question here. I am building some pages to let my users
manage lists of data. I really like the look, feel, and behavior, of
the admin pages. But I can't give my users that much control. Is
there a way to reuse the admin widgets in non-admin pages? I want to
give them l
Hi,
Something similar is happening to me. I tried to run django-admin.py
makemessages -l es and then compilemessages from the root of my
templates folder (which is outside the project tree) and it creates
the file Templates/conf/locale/es/LC_MESSAGES/django.po / django.mo
correctly.
My problem
gt; please help me through the process
> thx
>
> On 6 Sep, 18:24, justin jools wrote:
>
>
>
> > trying to setup simple social network
> > have installed: registration, profiles, accoutns, messages
>
> > but am stuck as how to setup/link the views.py to templ
Not exactly what you want, but if you are trying to publish images in
your RSS feed with each item: I did this by putting an tag
inside the description. Look at the way they did the feed here:
http://ciclops.org/rssfeed.php this feed w3c validates and seems to
work as desired everywhere I've tried
I did this without feed templates by putting an tag inside the
description. Look at the way they did it here: http://ciclops.org/rssfeed.php
this feed w3c validates and seems to work as expected everywhere I've
tried it (feedly, Ning, firefox's display of the feed) Code is just
the ord
I am currently translating a project, and many of the strings needing
translation are located in my templates. Unfortunately, the .po files
are not being created when I run makemessages, which I am doing from
my project home using:
./manage.py makemessages -l es -e html,shtml
Makemessages is
home page">
I like to ask which part is what I need to include in the Django feed
template ?? The explanation of feed templates is somehow very short?
Should I have two templates, one for RSS(XML) and one for HTML?
Thank you for your help.
Peter
--
You received this message because
talled: registration, profiles, accoutns, messages
>
> but am stuck as how to setup/link the views.py to templates/
> notification. I guess this is what is needed to be done.
>
> Any help much appreciated
--
You received this message because you are subscribed to the Google Groups
&qu
trying to setup simple social network
have installed: registration, profiles, accoutns, messages
but am stuck as how to setup/link the views.py to templates/
notification. I guess this is what is needed to be done.
Any help much appreciated
--
You received this message because you are
There are 2 approaches:
- Think data structures instead, and put all this logic on your view,
such that the template just needs to iterate thru one variable to
build the menu. Something like passing in the template context:
menu = [{'name': 'django', 'text': 'Official Django Site', 'url':
'http:/
g off it's probably best to stick with what's
built-in. Like most toolkits, there is no 1-to-1 translation between
PSP and Django. They are indeed very different beasts. You are best off
just learning how things work in Django and adapting to its methods and
idiosyncrasies.
Have you actua
I come from the world of mod_python and really enjoyed the PSP
template system, where I can embed Python code directly in my template
for dynamically generating menus and such.
What is the recommended method of calling a PSP template from inside
Django and rendering it?
Here is a sniplet of code
I'm trying to use the Django template system to render PDF's from .fdf's. The
PDF's are provided by client and I can generate a dummy .fdf from them and edit
that. I can use pdftk to merge the two, but it seems like the template system
does something similar.
My first problem is that the .fd
You would use CSS for styling.
li { border:1px solid #FF; }
You might want to create a class for error styling though!
On Aug 12, 4:44 pm, reduxdj wrote:
> Hi,
>
> I can't seem to get my form errors to work with customs forms in
> django, following the examples I have done this:
>
>
Hi,
I can't seem to get my form errors to work with customs forms in
django, following the examples I have done this:
Price
{% if form.price.errors %}
eware that incercepts all my href="http://mydomain";> urls in templates and adds to href a lang=en,
> lang=fr,
> if the request.language is respectively en, fr.
> So all my links should be ok.
> Is it possible?
>
> --
> Alessandro Ronchi
> http://www.soasi.com
>
on google.
I know I should have different urls, but I cannot in this project because
I'm using satchmo, a django e-commerce system, and I can't edit urls to work
this way.
So I thought I can create a middleware that incercepts all my http://mydomain";> urls in templates and add
to have a tag to
enable those extends without empty templates, for DRY principle and
because usually you don't want to change a library template at all,
and with this you have to move to realbase.html.
--
Alessandro Ronchi
http://www.soasi.com
Hobby & Giochi
http://hobbygiochi.com
ht
On 08/06/2010 12:22 PM, Alessandro Ronchi wrote:
It's useful to have some templates with the same name of another one,
like you can do with YOURPROJECT/templates/admin/base_site.html that
override the base site django default.
but If I want to add a word in the title of my base_site.html I
It's useful to have some templates with the same name of another one,
like you can do with YOURPROJECT/templates/admin/base_site.html that
override the base site django default.
but If I want to add a word in the title of my base_site.html I need
to copy the entire content of the base_site.h
c = Context({
> 'user_bootimage_list': user_bootimage_list,
> })
> f =
> open('/home/jboon/Lesson1/templates/netboot/static/dynamicmenu.cfg',
> 'w')
> menu_file = File(f)
> menu_file.write(t.render(c))
> return Htt
_list = Bootimage.objects.filter(person=user)[:5]
t = loader.get_template('netboot/menu.cfg')
c = Context({
'user_bootimage_list': user_bootimage_list,
})
f = open('/home/jboon/Lesson1/templates/netboot/static/dynamicmenu.cfg',
'w')
menu_file = File(f
On ma, 2010-07-26 at 09:21 -0700, Josh wrote:
> return HttpResponse(menu, mimetype="plain/text")
>
> What makes Django's text serving different? What can I do to
> troubleshoot this issue further? Am I just missing something about
> how text files are served?
The correct mimetype is tex
Good morning, I've been writing a Django app to create a dynamic net
boot program to boot configs created by users from a web interface
using a tool called gPXE. I've exhausted my troubleshooting methods
and can't seem to figure out why gPXE can boot from a static file
served directly from apache
(auto_now_add=True)
analysis = models.CharField(max_length=200)
prescription = models.CharField(max_length=500)
NOw if I want the joined content like.. if I want to display all the
patients name, problem and the analysis history how do I do it? how do
I pass it to templates?
the relation could be
I found solution but very inefficient one:
{% with gallery.get_pictureingallery_order as
ids_in_order %}
{% for picture_in_gallery_id in ids_in_order %}
{% for picture_in_gallery in
gallery.pictureinga
Hello
I have two models and 1-to-many relation between them, using ForeignKey
(gallery with pictures). Additionally instances on 'many' side are
ordered_with_respect_to owning instance. I need to iterate over them in
template, respecting imposed order. I can use
"get_pictureingallery_order" o
On Tue, Jul 20, 2010 at 9:57 AM, Tereno wrote:
> I'm experiencing this error: Module
> "django.template.loaders.filesystem" does not define a "Loader"
> callable template source loader
>
> and I can't figure out why at all. I've placed my templ
Hey there,
I'm experiencing this error: Module
"django.template.loaders.filesystem" does not define a "Loader"
callable template source loader
and I can't figure out why at all. I've placed my templates dir in the
settings file and yet somehow it doesn't
2010/7/15 fabiofz :
> Hi All,
>
> I'm currently working on providing an editor for django templates in
> Pydev (http://pydev.org).
>
> Now, while I do work with django templates sometimes, my experience is
> a bit limited with it -- so far I used it only for .html fi
>
> Another way is to set your admin_media_prefix to something like /
> admin_media/ and then in your apache conf set an alias for it.
>
> Alias /admin_media/ /usr/local/pyvans/lib/python2.6/site-packages/
> grappelli/media/
>
>
> jaymz
>
In fact, this way works for me.
Thanks for your help
Hi All,
I'm currently working on providing an editor for django templates in
Pydev (http://pydev.org).
Now, while I do work with django templates sometimes, my experience is
a bit limited with it -- so far I used it only for .html files,
sometimes with some javascript in it, so, that'
dules/python2.5/django/contrib/admin/media/
In addition, I've enable the personnal templates by fulfilling templates_dir.
The behaviour is strange : sometimes I can see my personnal title, sometimes I
see "Django Administration", when I refresh the page.
And I don't see images.
M
My server uses Debian, and I've installed Django by aptitude. My files are
> located in /usr/share/pyshared/django.
>
> I can see on the documentation of django about deploying an app with apache
> and wsgi that I should have another web server, or configure apache for the
> media
r, or configure apache for the
media files. It could be the problem (Images are they media files ?).
In fact, I don't understand really this part of the doc. Are the defaults
templates of django concerned by this part ?
Thanks,
--
You received this message because you are subscribed to the
I have site with text written in Russian.
Now I want to translate it to English.
I've upgraded templates with trans tag like that {% trans "Всем
привет" %}.
Then I run makemessages, translated what I want, compilemessages.
And now, the translation for the string "Всем пр
y control structure more intuitive. But the other things
are simply bringing full-blown programming into templates. Besides,
it is *very* easy to migrate them into the Python code.
Tschö,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: torsten.bron...@ja
On Jul 5, 2:25 pm, Torsten Bronger
wrote:
> Hall chen!
>
> George Sakkis writes:
> > [...]
>
> > To be honest, I never *had to* do it (in the strict sense) either
> > but apparently others did ([1-4]). As for the "just put it in the
> > view" argument, remember that until last month this was the
>
ing "if" to be a bit smarter :)
People will want to do *everything* in the template. The lowest
rated snippet on djangosnippets currently is an {% exec %} tag. :-)
Therefore, it's important to enforce some discipline, so that the
templates don't become sort of PHP. I use &quo
've never come across a
> situation where I've needed to do that in 2.5 years of developing
> Django templates, and, whilst I agree that we don't want to get into a
> holy war about whether stuff should be done in templates or views, I
> reckon the reason I've avo
The link to your snippet doesn't work for me.
It sounds like a neat idea. However, I've never come across a
situation where I've needed to do that in 2.5 years of developing
Django templates, and, whilst I agree that we don't want to get into a
holy war about whether stu
Hi all,
there have been at least three threads in this list alone from people
asking how to "break" from a for loop in templates, so the following
snippet [1] might be useful to some. Leaving aside the "thou shalt not
use logic in templates" religious debate, it's
Hi all,
Here is a GPLed software tool I made recently:
http://github.com/redsymbol/genstatic
Hope some of you find it useful and interesting. Please let me know if you
have any feedback.
Cheers,
Aaron
--
Aaron Maxwell
http://redsymbol.net/
--
You received this message because you are subs
e sure that the
> library is on the template_dirs list in the settings.py file (/home/
> jhumunc/webapps/jhumunc/lib/python2.5/django_forms-0.5-py2.5.egg/forms/
> templates). However, when I load the page, it's saying that it can't
> find the templatetags that correspond to that t
ngs.py file. I'm trying to get the page at
http://www.jhumunc.webfactional.com/accounts/register/ to work
properly. The pages uses the forms library and I've made sure that the
library is on the template_dirs list in the settings.py file (/home/
jhumunc/webapps/jhumunc/lib/python2.5/dja
On Thursday 17 June 2010 10:02:20 Venkatraman S wrote:
> > Once I repickled, the problem was solved
>
> Totally not related to your Q, but if you are using photos - try using
> django-photologue. Its awsum!
>
was awesome - I do not think it is maintained now, I tried it with trunk and
gave up a
On Thu, Jun 17, 2010 at 9:58 AM, Kenneth Gonsalves wrote:
> solved - what had happened was that when I pickled the results, the model
> in
> question did not have a 'photo' field which I added subsequently to
> pickling.
> Once I repickled, the problem was solved
>
Totally not related to your Q,
On Thursday 17 June 2010 06:46:21 Kenneth Gonsalves wrote:
> In my current project I am getting keyerror: photo where the photo does
> not exist. This is running on latest trunk. The only difference between
> the two sites is that in site where it is working, 'p' is a query set
> passed from th
On Thursday 17 June 2010 06:46:21 Kenneth Gonsalves wrote:
> in many models with an imagefield called photo, I have this code in the
> template:
>
> {% if p.photo %}
>
>
> {% endif %}
>
> this has been working across many sites for years - and is working on a
> par
,
'djangogolf.web',
'sorl.thumbnail']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.locale.LocaleMiddleware',
'
On Wed, Jun 9, 2010 at 3:57 AM, Nick wrote:
> Boy, that just flew right past me. Ridiculous. Thanks everyone.
>
> On Jun 8, 1:06 pm, Dejan Noveski wrote:
> > http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for
> >
> > scroll a bit down to see the forloo
Boy, that just flew right past me. Ridiculous. Thanks everyone.
On Jun 8, 1:06 pm, Dejan Noveski wrote:
> http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for
>
> scroll a bit down to see the forloop object and its properties.
>
>
>
> On Tue, Jun 8, 2010 at 8
I am looking for a way to identify the first item returned in a loop
and display it differently than the others:
basically it would go like:
{% for item in items %}
{% if is_first_item %}
This is what will show
{% else %}
this is what will show
{% endfor %}
Am I overlooking some
On May 29, 7:47 am, Ogi Vranesic wrote:
> Hi
>
> I formated with python numbers like e.g.:
>
> " 3457.50"
> " 11450.25"
>
> but my problem is to show them correctly one below the other
> in a column by django templates
> because the blank sp
On May 29, 2:47 pm, Ogi Vranesic wrote:
> Hi
>
> I formated with python numbers like e.g.:
>
> " 3457.50"
> " 11450.25"
>
> but my problem is to show them correctly one below the other
> in a column by django templates
> because the blank sp
Hi
I formated with python numbers like e.g.:
" 3457.50"
" 11450.25"
but my problem is to show them correctly one below the other
in a column by django templates
because the blank spaces are ignored.
I tried with the filter escape, however it does not work.
A solution w
;base/base.html",
}
...will expose BASE_TEMPLATE in all my templates.
Regards
Scott
> my Django project has several apps, and each app contains a constant
> named APPLABEL. This constant should be passed to all templates, but
> I'd like to avoid adding it to each ren
Hi,
my Django project has several apps, and each app contains a constant
named APPLABEL. This constant should be passed to all templates, but
I'd like to avoid adding it to each rendering context manually. Is
that possible?
Thanks,
Jan
--
You received this message because you are subscrib
I am struggling to grasp the "full picture" when it comes to view queries
and associated templates which deal with sets of "nested" parent/child
relationships, and am hoping someone here can enlighten me. All the
examples I have seen seem to deal with simple views showi
I was searching for the error in google and I solve it, I don't know if I
solve it at good way, but... It works :p
from django.conf.urls.defaults import *
from coltrane.models import Category
urlpatterns = patterns('',
(r'^$', 'django.views.generic.list_detail.object_list', { 'queryset':
Cate
could you post your urls.py ?
On Apr 21, 6:51 pm, xota wrote:
> Or I do something bad, I was searching in google and some pepople have
> same/similar error without replies, can you help me, this is my error:
>
> Caught an exception while rendering: Reverse for
> 'coltrane_category_list' with argu
Or I do something bad, I was searching in google and some pepople have
same/similar error without replies, can you help me, this is my error:
Caught an exception while rendering: Reverse for
'coltrane_category_list' with arguments '()' and keyword arguments
'{}' not found.
If you need more info,
afety measures built in.
Regarding tag processing, it might be harder than I think, but I don't
see
a problem with cutting such unwanted tags, e.g. with regex or maybe
even
by cloning source code for templates and removing set of tags (OR
maybe
it's possible to disable some of tags, I
I'm writing an application which is kind of event handling app, and
the important functionality is sending emails. User can create his own
email template, and when an event occurs the email is built using this
template and sent. An event is nothing but a python dictionary with
some values. As you m
Thanks! I knew there was a way around this. Repeating code is very not
like django :)
Works like a charm.
Thanks again.
On Apr 13, 12:30 am, Danny Adair wrote:
> On Tue, Apr 13, 2010 at 15:59, rvidal wrote:
> >[...]
> > I have my urls.py looking something like this:
> > urlpatterns = patterns(
On Tue, Apr 13, 2010 at 15:59, rvidal wrote:
>[...]
> I have my urls.py looking something like this:
> urlpatterns = patterns('mysites.shop.views',
> (r'^$', 'index'),
> (r'^client/(?P\d+)/$', 'details'),
> (r'^client/(?P\d+)/receipts/$', 'receipts'),
> (r'^client/(?P\d
On 13 avr, 05:59, rvidal wrote:
> I have my urls.py looking something like this:
> urlpatterns = patterns('mysites.shop.views',
> (r'^$', 'index'),
> (r'^client/(?P\d+)/$', 'details'),
> (r'^client/(?P\d+)/receipts/$', 'receipts'),
> (r'^client/(?P\d+)/contacts/$',
Hi,
I have a database of related data connected via foreign keys. One to
many relationships between one table and various other tables.
Random example:
Client
- id
- name
- age
Receipts
- id
- client (fk)
- timestamp
Contacts
- id
- client (fk)
- timestamp
I have my urls.py looking something l
On Mon, Apr 12, 2010 at 5:55 PM, Phlip wrote:
> Or do all of your see filenames and line numbers, for your .html
> templates, at error time?
>
>
I do on debug pages, with the line causing the error highlighted.
I'm still not sure if you are talking about test output or debug
Without seeing the traceback, this is all just guessing--stabbing in
the dark. But...
a) posting a traceback allows people to actually help not only solve
the problem, but help show how to read the traceback.
b) commenting out template code may have suppressed the problem, but
that still doesn't
;. That part's
done - by clamping out segments with {% comment %} until they isolated
the faulty lines.
I am asking _why_ I had to clamp out segments with {% comment %}. (In
test.)
Or do all of your see filenames and line numbers, for your .html
templates, at error time?
--
You received
here the error is. Without the traceback, it's hard to say where your
> > problem lies.
>
> One of the templates is "basket.html", and "basket.html" does not
> appear in the transcript.
>
> All the lines are only django's internal render() calls (
On Mon, Apr 12, 2010 at 5:10 PM, Phlip wrote:
> > Uusually the first line in the traceback tells you pretty explicitly
> > where the error is. Without the traceback, it's hard to say where your
> > problem lies.
>
> One of the templates is "basket.html",
> Uusually the first line in the traceback tells you pretty explicitly
> where the error is. Without the traceback, it's hard to say where your
> problem lies.
One of the templates is "basket.html", and "basket.html" does not
appear in the transcript.
All th
ed stack trace of all the lines AROUND the template.
>
> How do I tell what lines INSIDE the templates caused the error?
>
> --
> Phlip
> http://c2.com/cgi/wiki?ZeekLand
--
You received this message because you are subscribed to the Google Groups
"Django users" group
Djangoists:
When code below a template throws an error, we get an insanely
detailed stack trace of all the lines AROUND the template.
How do I tell what lines INSIDE the templates caused the error?
--
Phlip
http://c2.com/cgi/wiki?ZeekLand
--
You received this message because you are
On Thu, Apr 8, 2010 at 3:00 AM, mmenchu wrote:
> I'm trying to write to one of my templates the display name for
> item.category. Item is an object with an IntegerField named
> 'category' and a set of specified choices. I call render_to_response
> and call get_ca
I'm trying to write to one of my templates the display name for
item.category. Item is an object with an IntegerField named
'category' and a set of specified choices. I call render_to_response
and call get_category_display() but I keep getting
"Could not parse the remainde
On Wed, Mar 24, 2010 at 5:49 PM, saxon75 wrote:
> I apologize if this is blindingly obvious, but suppose I want to have
> a template actually print the literal string "{{ url }}" in the page.
> How would I go about doing that?
http://docs.djangoproject.com/en/dev/ref
I apologize if this is blindingly obvious, but suppose I want to have
a template actually print the literal string "{{ url }}" in the page.
How would I go about doing that?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, s
On 24 mar, 16:50, ALJ wrote:
> Hi again Paulo,
>
> Ok. I'll also have a look at that.
>
> I agree that the business logic should be in the views. However, it
> feels that we need a little more flexibility with the templates when
> things are truely just a presentation
Hi again Paulo,
Ok. I'll also have a look at that.
I agree that the business logic should be in the views. However, it
feels that we need a little more flexibility with the templates when
things are truely just a presentation problem. When you have to start
constructing your own diction
Sorry, I hadn't understood your original problem, now I see why the nested
ifs wouldn't work.
Regarding your last question, I think a list of lists would be easier than
dictionaries. You can append the product as the first item in each sublist
and then iterate the list to get the rows and columns
Just as a matter of interest ... is there a 'best way' of formatting
the data if you do decide to process it all in the view and then pass
to the template? I seem to have dictionaries coming out of my ears if
I construct the data myself.
--
You received this message because you are subscribed to
Hi Dalore,
Thanks for that. I changed it a bit because it was still within that
{% for sale in sales %} loop. It works. But it really makes the raw
html pretty ugly with loads of spaces in it. Never mind. I suppose no-
one is going to see it.
{% for rate in rates %}
{{ rate.cost_item
What about something like this?
It gets you your text field, empty if no data, but with data if it
matches your if clause.
{{ rate.cost_item.name }}
{% for appointment in appointments %}
{% for sale in sales %}
{% endfor %}
{% endfor %
801 - 900 of 2531 matches
Mail list logo