Re: Templates vs. source code

2020-05-29 Thread אורי
Thank you. אורי u...@speedy.net On Fri, May 29, 2020 at 12:56 PM Sencer Hamarat wrote: > Hi Uri, > Never expose whole settings anytime. settings is always includes sensitive > data. At least DB access key and Django's secret value. > This attitude is highly vulnerable. Anyone could access those

Re: Templates vs. source code

2020-05-29 Thread Sencer Hamarat
Hi Uri, Never expose whole settings anytime. settings is always includes sensitive data. At least DB access key and Django's secret value. This attitude is highly vulnerable. Anyone could access those sensitive data via response headers if you don't play settings without cautious. Saygılarımla, Se

Re: Templates rendering problem

2019-10-16 Thread Boris Romero
Hi! I discover this problem start with Django 2.1, Django 2.0.13 still working good. I'm reading the changes on Django 2.1 whom can cause this problem. Thanks for the ideas! On Wednesday, October 16, 2019 at 4:35:36 PM UTC-3, Boris Romero wrote: > > Thanks again for the answer. I believe the pro

Re: Templates rendering problem

2019-10-16 Thread Boris Romero
Thanks again for the answer. I believe the problem is related with unicode changes between python versions, but I think it's a problem from any library or dependency used at the app, whom is not working properly, because with the same python version the problem appears and dissapears using diff

Re: Templates rendering problem

2019-10-16 Thread lemme smash
okay, but it's even harder to guess what is a problem there without ability to see relevant code pieces. btw, you may want to check this https://www.geeksforgeeks.org/important-differences-between-python-2-x-and-python-3-x-with-examples/#Unicode as you most probably had to migrate python as wel

Re: Templates rendering problem

2019-10-16 Thread Boris Romero
Thanks for the answer Lemme! As I said, my problems appear exactly when I update django from 1.11 to django 2.2.x. With this change a lot of libraries need to update, and now I was trying to remove some of them and proving if they are the reason of this strange behavior. Before update django, a

Re: Templates rendering problem

2019-10-16 Thread lemme smash
it's really hard to help here without understanding whats going on there. when i ask for example I meant not only piece of page screenshot to see what you mean, but whole stack of how you pass data in a view and how you render it in a template On Tuesday, October 15, 2019 at 9:31:26 PM UTC+3, B

Re: Templates rendering problem

2019-10-15 Thread Boris Romero
Any help or ideas? Thanks! On Thursday, October 10, 2019 at 12:15:42 PM UTC-3, Boris Romero wrote: > > Hi! Yes, it's reproducing when I run it locally, but with DEBUG=FALSE and > with nginx and uwsgi. And no, it's not a database encoding problem, it just > involves the templates, because the sam

Re: Templates rendering problem

2019-10-10 Thread Boris Romero
Hi! Yes, it's reproducing when I run it locally, but with DEBUG=FALSE and with nginx and uwsgi. And no, it's not a database encoding problem, it just involves the templates, because the same database, with diferents instances of the app (with the upload and without it) not make any differences.

Re: Templates rendering problem

2019-10-10 Thread lemme smash
so, it's not reproducing when you run it locally? also, can you provide an example of string where you have "strange" character? most probably you store it in database. On Thursday, October 10, 2019 at 1:48:52 AM UTC+3, Boris Romero wrote: > > Hi! > > I recently update Django from 1.11 to 2.2.6

Re: templates and Views

2019-02-19 Thread abdouramane mahamane
Thank you so much, for this reply that solves my problem :) Le lundi 18 février 2019 16:15:05 UTC+1, abdouramane mahamane a écrit : > > I'm trying to show in one template .html multiple results of my views.py > class. > But when i add an other {%block content2 %} in my base.html, i have an > er

Re: templates and Views

2019-02-19 Thread abdouramane mahamane
Thank you so much, for this reply that solves my problem :) Le lundi 18 février 2019 22:55:24 UTC+1, mohamed khaled a écrit : > > I think this link can help you > > https://www.google.com/url?sa=t&source=web&rct=j&url=https://stackoverflow.com/questions/12187751/django-pass-multiple-models-to-one

Re: Templates html error

2018-06-28 Thread Tim Vogt (Tim Vogt)
/blog/mabase your structure must be /blog/mabase/templates/mabase/index.html TIm > Op 28 jun. 2018, om 15:35 heeft emmanuel wyckens het > volgende geschreven: > > /blog/mabase -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscr

Re: Templates and URL Mappings

2018-04-03 Thread Will Burchell
Daniel, thank you so much! I had been eyeing my regex with suspicion by was looking at the wrong pattern. Many thanks again, all appeas to be working fine now :) On Monday, 2 April 2018 12:27:56 UTC+1, Daniel Roseman wrote: > > On Monday, 2 April 2018 12:00:31 UTC+1, Will Burchell wrote: > > >

Re: Templates and URL Mappings

2018-04-02 Thread Daniel Roseman
On Monday, 2 April 2018 12:00:31 UTC+1, Will Burchell wrote: > from django.conf.urls import url > from . import views > > app_name = 'stock' # Referenced by template, ie item in index.html > > urlpatterns = [ > # /stock/ > url(r'^$', views.index, name="index"), > # /stock/nnn/ >

Re: Templates couldn't be found after a new package installed

2015-06-24 Thread Ashish Khatkar
Can you post your urls.py, views.py and settings.py so that we can know what is the exact issue here ? On Wednesday, June 24, 2015 at 4:35:49 PM UTC+5:30, entheo wrote: > > Just received the message after run mysite sever to which a package > called 'django-polls' installed according to django-

Re: templates tags works in scripts sections of the html?

2015-03-23 Thread dk
AHHH!!!... that make scenes that the java script did work when I did it manually. I haven't use json files before, so I am not sure how to manage that, I will look around for more information on that. On Friday, March 20, 2015 at 4:59:30 PM UTC-5, dk wrote: > I am trying to create an au

Re: templates tags works in scripts sections of the html?

2015-03-23 Thread Vijay Khemlani
JSON is literally the notation for objects and arrays in JavaScript, when you "print" it it outputs valid JavaScript code. On Mon, Mar 23, 2015 at 11:59 AM, dk wrote: > AHHH!!!... > that make scenes that the java script did work when I did it manually. > I haven't use json files before, so

Re: templates tags works in scripts sections of the html?

2015-03-20 Thread Vijay Khemlani
It works, but the javascript you are generating has syntax errors. For example, you are missing the commas after every element. Either way, dumping variables directly from django templates to JavaScript is not very elegant, you could make a JSON object in the view beforehand json_tags = json.dum

Re: templates tags works in scripts sections of the html?

2015-03-20 Thread Stephen J. Butler
They do work. But did you check the generated page? I bet you get an error in your browser's JavaScript console about syntax. On Fri, Mar 20, 2015 at 4:59 PM, dk wrote: > I am trying to create an autocomplete tag with jquery UI > http://jqueryui.com/autocomplete/ > > > > in my view I got a list o

Re: templates: if and static tags incompatible?

2014-09-29 Thread Fred Stluka
The problem is that static is not being recognized as a valid Django tag. Add this line to the top of the template file to define it. {% load staticfiles %} --Fred Fred Stluka -- mailto:f...@bristle.com -- http://bristle.c

Re: Templates: best way to access object attributes described in a external list.

2013-03-05 Thread Serge G. Spaolonzi
On Mon, Mar 4, 2013 at 12:01 PM, Bill Freeman wrote: > Are you saying that you need control over which of an item's attributes > are shown and which are not and/or the order in which attributes are shown, > or are you saying that the way python/django converts the attributes to > strings does not

Re: Templates: best way to access object attributes described in a external list.

2013-03-04 Thread Bill Freeman
Are you saying that you need control over which of an item's attributes are shown and which are not and/or the order in which attributes are shown, or are you saying that the way python/django converts the attributes to strings does not meet your requirements, or both? Your approach can certainly

Re: Templates error on partial rendering

2013-02-18 Thread Pankaj Singh
Hey Andrea, Please have a look at http://stackoverflow.com/questions/4300442/show-undefined-variable-errors-in-templates Put this in your debug settings: class InvalidString(str): def __mod__(self, other): from django.template.base import TemplateSyntaxError raise TemplateSyn

Re: Templates not found

2012-12-18 Thread Sithembewena Lloyd Dube
Thank you Sergiy and @donarb - my urls.py file was wrng as described by @donarb. On Wed, Dec 12, 2012 at 6:38 PM, donarb wrote: > When you used the shell, you imported 'tracks.views' but in your urls.py, > you have musicsite.views.home. The two don't match. > > > On Wednesday, December 12, 2012

Re: Templates not found

2012-12-12 Thread donarb
When you used the shell, you imported 'tracks.views' but in your urls.py, you have musicsite.views.home. The two don't match. On Wednesday, December 12, 2012 6:11:54 AM UTC-8, Lloyd Dube wrote: > > urls.py: > > urlpatterns = patterns('', > # Examples: > url(r'^$', 'musicsite.views.home',

Re: Templates not found

2012-12-12 Thread Sergiy Khohlov
could you please repeat your not view error ? Look like urls,oy has no access to views.py Many thanks, Serge +380 636150445 skype: skhohlov 2012/12/12 Sithembewena Lloyd Dube : > urls.py: > > urlpatterns = patterns('', > # Examples: > url(r'^$', 'musicsite.views.home', name='home'),

Re: Templates not found

2012-12-11 Thread Sergiy Khohlov
please paste your urls.py 2012/12/11 Sithembewena Lloyd Dube : > Hi Segiy, > > Thanks for the response. "myproject" is only an alias I used while posting > the code on here, in the project code it is actually "tracks". > > > On Tue, Dec 11, 2012 at 1:31 PM, Sergiy Khohlov wrote: >> >> take a loo

Re: Templates not found

2012-12-11 Thread Sergiy Khohlov
take a look you have error related to myproject.view.home but importing track.view.home 2012/12/11 Sithembewena Lloyd Dube : > > > On Tue, Dec 11, 2012 at 4:36 AM, Sithembewena Lloyd Dube > wrote: >> >> Hi all, >> >> I have a Django project running Django 1.4.1. (just upgraded). My >> TEM

Re: Templates not working properly

2012-04-30 Thread Gerald Klein
No problem eveyone has one of those moments On Mon, Apr 30, 2012 at 4:07 PM, Zaerion wrote: > Yup, I caught it just after I posted it and spent about 30 minutes trying > to figure out what I did wrong. Thanks for the help! :) > > On Monday, April 30, 2012 2:05:37 PM UTC-7, Gerald Klein wrote: >>

Re: Templates not working properly

2012-04-30 Thread Zaerion
Yup, I caught it just after I posted it and spent about 30 minutes trying to figure out what I did wrong. Thanks for the help! :) On Monday, April 30, 2012 2:05:37 PM UTC-7, Gerald Klein wrote: > > Hi, the delimiters use are using are wrong it should be {% not (% > > On Mon, Apr 30, 2012 at 3:41

Re: Templates not working properly

2012-04-30 Thread Zaerion
Nevermind. I'm just an idiot. I had used parenthesis instead of curly braces. Sorry! On Monday, April 30, 2012 1:41:25 PM UTC-7, Zaerion wrote: > > I'm new to using Django and was working my way through the tutorial to get > a better feel of it. I'm stuck on part 3 of the tutorial and the sectio

Re: Templates not working properly

2012-04-30 Thread Gerald Klein
Hi, the delimiters use are using are wrong it should be {% not (% On Mon, Apr 30, 2012 at 3:41 PM, Zaerion wrote: > I'm new to using Django and was working my way through the tutorial to get > a better feel of it. I'm stuck on part 3 of the tutorial and the section > where they show you how to u

Re: templates couple apps to a site; how do you separate them?

2012-03-14 Thread bruno desthuilliers
On Mar 14, 2:31 am, Ken wrote: > I'm struggling with how I should go about writing "pluggable" apps.  I > haven't found a satisfactory way of decoupling apps from a site and > the primary sticking point is templates.  I've combed through some > discussions but have not found any that have helped.

Re: templates couple apps to a site; how do you separate them?

2012-03-13 Thread Nick
When writing an app one of the things you do is set limitations. It's the same for people who choose to use pluggable apps, you're trading customization for convenience. The way I would go about it is to write multiple outputs that are handled primarily in the view. You could set up a keyword para

Re: templates not updating when i change things please help

2012-02-19 Thread Rich
I found my problem... I had 2 different templates created with the same code and I was using the wrong one On Feb 19, 9:53 am, Rich wrote: > Hi I am pretty new to django and I feel like I either have some kind > of configuration wrong or maybe im not understanding how something > works. > > Whats

Re: templates not updating when i change things please help

2012-02-19 Thread Furbee
When you make a change to a module (.py) file, you may need to restart your web server service (Apache2, IIS Service, etc). For template files (.htm/html) I have never had to restart my server for those changes to be reflected, so that may be local cache in the browser. Perhaps try using a new brow

Re: Templates available to a cluster

2011-10-20 Thread Konstantinos Pachnis
Hello, I had the same problem, but not a clue how to implement this. After Donald mentioned that the template system uses pluggable loaders, I spent some time to create one for my own use. It's very basic, but at least I believe it demonstrates how to create a template loader. Kurtis, you can fin

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
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 fly template > system. I'd probably store them in a fast document db

Re: Templates available to a cluster

2011-10-19 Thread Donald Stufft
If I wanted maximum performance from a distributed on the fly template system. I'd probably store them in a fast document db. On Wednesday, October 19, 2011 at 5:54 PM, Kurtis Mullins wrote: > Very true, I could definitely implement it as a pluggable loader. I'll try to > find the DB Template L

Re: Templates available to a cluster

2011-10-19 Thread Kurtis Mullins
Very true, I could definitely implement it as a pluggable loader. I'll try to find the DB Template Loader too. I'm mainly concerned with this being a large bottle neck for our front-facing pages so I'm not sure which path to choose. Maybe some R&D is in order :) Thanks! On Wed, Oct 19, 2011 at 5:5

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, October 19, 2011

Re: Templates are parsed on every request?

2011-03-24 Thread Karen Tracey
On Thu, Mar 24, 2011 at 5:09 PM, Fett wrote: > I just had to implement some custom template tags, and figured out > that template files are parsed each time a request is received (more > precisely, I noticed this behavior while in debug mode, but didn't > expect to have it with debug = False). >

Re: templates - pulling child templates

2011-01-21 Thread Tom Evans
On Fri, Jan 21, 2011 at 2:59 PM, km wrote: > Hi all, > > The docs say we can have multiple child templates extending the parent > template. But then how to render multiple  child templates in one call ? > > regards, > KM > I don't think the docs say that. Each call to render a template takes the

Re: templates - pulling child templates

2011-01-21 Thread km
Hi all, The docs say we can have multiple child templates extending the parent template. But then how to render multiple child templates in one call ? regards, KM On Fri, Jan 21, 2011 at 8:14 PM, km wrote: > > Hi all, > > On Fri, Jan 21, 2011 at 6:03 PM, Daniel Roseman wrote: > >> On Friday,

Re: templates - pulling child templates

2011-01-21 Thread km
Hi all, On Fri, Jan 21, 2011 at 6:03 PM, Daniel Roseman wrote: > On Friday, January 21, 2011 12:08:57 PM UTC, km wrote: >> >> Hi all, >> >> I am trying to display a parent django template (base.html) with a view >> function called "base" like this: >> >> def base(request): >>return render_to

Re: templates - pulling child templates

2011-01-21 Thread Daniel Roseman
On Friday, January 21, 2011 12:08:57 PM UTC, km wrote: > > Hi all, > > I am trying to display a parent django template (base.html) with a view > function called "base" like this: > > def base(request): >return render_to_response('base.html') > > The base.html gets displayed in the browser(fir

Re: templates - pulling child templates

2011-01-21 Thread David De La Harpe Golden
On 21/01/11 12:08, km wrote: > Hi all, > > I am trying to display a parent django template (base.html) with a view > function called "base" like this: > > def base(request): >return render_to_response('base.html') > > The base.html gets displayed in the browser(firefox 3.x) but the child ht

Re: templates - pulling child templates

2011-01-21 Thread Tom Evans
On Fri, Jan 21, 2011 at 12:08 PM, km wrote: > Hi all, > > I am trying to display a  parent django template (base.html) with a view > function called "base" like this: > > def base(request): >    return render_to_response('base.html') > > The base.html gets displayed in the browser(firefox 3.x) but

Re: Templates Directory Question

2011-01-03 Thread Daniel Hepper
You can put the templates anywhere you want, by a good place is a directory named templates in the base directory of your project, i.e. C:\DjangoProjects\mysite\templates\ Don't forget to add this path to the TEMPLATE_DIRS variable in your settings.py. The template file from the example would be

Re: Templates Directory Question

2011-01-03 Thread Anthony Pearce
Now I feel stupid. That intelligent comment flew right over my head. I'm not sure yet where apache is falling in here yet, nor do I know what htdocs is. I should mention I'm using Windows 7 also, in case any terminology is based on another OS. On Jan 3, 10:56 pm, "Mo J. Al-Mughrabi" wrote: > By

Re: Templates Directory Question

2011-01-03 Thread Mo J. Al-Mughrabi
By document root they mean apache public directory, aka htdocs Sent from my iPhone On Jan 3, 2011, at 4:53 PM, Anthony Pearce wrote: > 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

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread bruno desthuilliers
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 problem. Don't forget you

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread ALJ
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 dictionaries / li

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread Paulo Almeida
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

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread ALJ
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

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread ALJ
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

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread dalore
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 %

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread ALJ
Hi Paulo, The 'if' test has to fall within the "for sale in sales" loop, because it's testing the values of the the sale. However, if there is no match, then the default is triggered. Therefore I will get as many defaults as there are sales (-1 if there is a match). Nesting {% if %} 's won't work.

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread Paulo Almeida
I don't understand why is it obvious that an 'else' won't work. If a single {% else %} is not what you want, you can nest {% if %} clauses. But if you are doing this it can also mean that you should move this logic to the view and just pass the final table to the template. - Paulo On Wed, Mar 24,

Re: templates?

2010-03-10 Thread lalla
Hello jirka, i could not get through the error. But when i run python manage.py shell.. and do the same.i aint getting any errors. what should i put in PYTHONPATH? to make it run through only python.How to configure the things manually. Thanx in advance On Mar 11, 2:41 am, Jirka Vejrazka wrote: >

Re: templates?

2010-03-10 Thread Jirka Vejrazka
> DJANGO_SETTINGS_MODULE=C:/django/Django-1.1.1/djangotest/mysite/settings Oops - I take it back (it's been a long day). You need to supply Python path, i.e just "mysite.settings" if you PYTHONPATH is already set to PYTHONPATH=C:\django\Django-1.1.1\djangotest and mysite is a directory there.

Re: templates?

2010-03-10 Thread Jirka Vejrazka
Hi Nadeesh, you need to use forward slashes, even on Windows (or double-backslashes). So, changing to: DJANGO_SETTINGS_MODULE=C:/django/Django-1.1.1/djangotest/mysite/settings might solve your problem, assuming everything else is OK. Cheers Jirka -- You received this message becaus

Re: Templates sometimes load at bottom of page

2010-03-03 Thread Shawn Milochik
Dude, I have one word for you, and you've heard it already tonight: virtualenv I do everything on my Mac, and virtualenv and git make it a lot easier than I deserve. Let me know if you need help. Shawn On Mar 3, 2010, at 9:28 PM, timdude wrote: > I know I should do it. But I'm such a noob, t

Re: Templates sometimes load at bottom of page

2010-03-03 Thread timdude
I know I should do it. But I'm such a noob, the idea scares the crap out of me. I've got half a dozen sites hanging off the same code base...which is all .96 dependant. I'll get the time and the guts up one of these days. Cheers, Tim On Mar 3, 5:47 pm, Atamert Ölçgen wrote: > On Wednesday 03 Mar

Re: Templates sometimes load at bottom of page

2010-03-02 Thread Atamert Ölçgen
On Wednesday 03 March 2010 07:58:39 timdude wrote: > I'm using .96. Other than that, what would my problem be? There has been significant changes since 0.96, you should seriously consider upgrading! -- Saygılarımla, Atamert Ölçgen -+- --+ +++ www.muhuk.com mu...@jabber.org -- You receiv

Re: Templates design question

2010-02-15 Thread andreas schmid
you could create a template module where you put in the logic to dipslay the content of the post: Hello, > > I'm writing some simple webblog, just for self teaching, and I have a > question how to do better. Here is the situation, I have base.html, I > have blog.html which extends base. Now i

Re: Templates,layout, css, ie and Pyjamas

2009-11-09 Thread Ishwor Gurung
Grant, Hi 2009/11/10 grant neale : > > Hi Ishwor, > > I'm in France I'm afraid. > Is there any solution out there for getting the basics up and running - Download a copy of Django and give it a go. - Extract it to a folder - Run 'python setup.py install'; - Go to django directory - python django

Re: Templates,layout, css, ie and Pyjamas

2009-11-09 Thread grant neale
Hi Ishwor, I'm in France I'm afraid. Is there any solution out there for getting the basics up and running and then going into the "beauty contest" later? Or are you just saying that it's hard, just eat your lunch? If you ever come to France, I can send you some links on where to stay. :) T

Re: Templates,layout, css, ie and Pyjamas

2009-11-09 Thread Ishwor Gurung
Hi, 2009/11/10 grant neale : > > Hi, > > I'm a hobbyist and do not have a lot of time on my hands to do front > end (templates, css) stuff. Hire a professional to do you it for you. > I was looking around and saw that pyjamas takes care of the layout of > the user interface. This is Django list

Re: templates in Practical Django Projects

2009-06-21 Thread Nick Lo
> I am now on linux . I created a CMS under jim/djp/ > I created the projec t to the flatpages. > I am trying to create templates. > I created a templates in jim/djp/templates.I created cms under > templates, then flatpages directory. I then created default.html > > In the setting I put the templa

Re: templates in Practical Django Projects

2009-06-21 Thread ChrisD
Likely you need a full path to that. from my settings.py file TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/ django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. '/home/ch

Re: Templates in models and i18n.

2009-04-12 Thread Poromenos
It's not an entire template, I'm just using the template system as an alternative to string formatting because of its name resolution capabilities. I found out how to do it, actually, I used ugettext instead of lazy an it works well! Poromenos On 12 Απρ 2009, at 19:52, Karen Tracey wrote:

Re: Templates in models and i18n.

2009-04-12 Thread Karen Tracey
On Sun, Apr 12, 2009 at 11:29 AM, Poromenos wrote: > > Hello, > I am trying to render a template in my models (to get the model > details in a printable format), but I want the template string to be > internationalised. ugettext_lazy does not return a string object, and > the template returns not

Re: Templates Cant find the CSS file

2009-01-12 Thread Skylar
My solution is that I have a site-enabled nginx host listening on http://media.site/ which has a document root at say /var/www/site/. I set my MEDIA_URL = http://media.site/. I import MEDIA_URL into views and send it to the template with say render_to_response(). So, in the stylesheet link for

Re: Templates Cant find the CSS file

2009-01-12 Thread pyramid...@gmail.com
ok, I have been trying to set up Apache and mod_python. I followed all the tutorials, i seem to be getting the similar to error to alot of ppl but the solutions don't work for me. ImportError: Could not import settings 'bltss.settings' (Is it on sys.path? Does it have syntax errors?): No module n

Re: Templates Cant find the CSS file

2009-01-12 Thread Andrew Trotter
Hi there I'm also somewhat new to Django and the mailing list, so somebody else probably has a better solution. However, here's the solution I found to this problem: http://docs.djangoproject.com/en/dev/howto/static-files/?from=olddocs I hope it helps. Please note the disclaimer on that page,

Re: Templates Cant find the CSS file

2009-01-12 Thread David Zhou
On Mon, Jan 12, 2009 at 3:25 AM, pyramid...@gmail.com wrote: > > Im trying to get the template to load the CSS, but it does not load, > the server output shows a 404. ... > preferably i dont want the css file there but in a global location, > can someone tell me whats going on here? See: http:/

Re: Templates dir exception

2009-01-04 Thread Santiago
I tend to use: TEMPLATE_DIRS = ( os.getcwd()+'/static/templates' ) so when using generic views it goes to os.getcwd()+'/static/templates/' this lets me have my proyect live in different folders and run fine... in your case it is specting a directory tree like this: /

Re: Templates dir exception

2009-01-04 Thread knight
I think you can try accessing books/publisher_list.html instead of just publisher_list.html This should solve the problem, if I understand it correctly. Regards, Alex A. On Jan 4, 11:11 am, HB wrote: > Hey, > My Django project has the  following structure: > +++ > djcode >        # Django files

Re: templates database access

2008-12-08 Thread maeck
Your user will not have access to your database from the browser, so you cannot do any kind of create, update and deletes from templates directly. It will always have to go through POST on your views. You could do some AJAX to avoid web-page roundtrips, but then again, you will be using views to d

Re: templates database access

2008-12-08 Thread Daniel Roseman
On Dec 8, 10:25 am, Vicky <[EMAIL PROTECTED]> wrote: > Is there any way to insert, retrieve, delete and update tables in a > database from templates itself? Well, retrieving is what you do when you display data, but for the rest the answer is *definitely not omg why would you want to do such a ho

Re: Templates and method arguments for thumbnails

2008-11-15 Thread Malcolm Tredinnick
On Sat, 2008-11-15 at 12:16 -0800, [EMAIL PROTECTED] wrote: > Hi, > > From the django documentation, it looks like it is not possible to > pass arguments to methods from the template HTML code. > > For example: > > class MyModel(Model): > def foo(self): > return 'This works' > > can be

Re: Templates - testing multiple things on IF line

2008-11-13 Thread Steve Holden
John M wrote: > Does the IF tag allow for OR's or AND's? > > Yes. You can use one or the other, but not both, IIRC. [Checks documentation]. Yes: "If you need to combine and and or to do advanced logic, just use nested if tags." regards Steve --~--~-~--~~~---~--~-

Re: Templates, context-setting custom tag and nested blocks - doesn't work ? (and is it supposed to anyway ?)

2008-09-30 Thread Malcolm Tredinnick
On Tue, 2008-09-30 at 08:22 -0700, bruno desthuilliers wrote: > On 30 sep, 14:04, bruno desthuilliers <[EMAIL PROTECTED]> > wrote: > > On 29 sep, 23:16, bruno desthuilliers <[EMAIL PROTECTED]> > > wrote: > > > > Partly answering to myself: > > > > (snip) > > > > > After a couple more tests and in

Re: Templates, context-setting custom tag and nested blocks - doesn't work ? (and is it supposed to anyway ?)

2008-09-30 Thread bruno desthuilliers
On 30 sep, 14:04, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 29 sep, 23:16, bruno desthuilliers <[EMAIL PROTECTED]> > wrote: > > Partly answering to myself: > > (snip) > > > After a couple more tests and investigations, it appears that the > > nested blocks have nothing to do with my prob

Re: Templates, context-setting custom tag and nested blocks - doesn't work ? (and is it supposed to anyway ?)

2008-09-30 Thread bruno desthuilliers
On 29 sep, 23:16, bruno desthuilliers <[EMAIL PROTECTED]> wrote: Partly answering to myself: (snip) > After a couple more tests and investigations, it appears that the > nested blocks have nothing to do with my problem. What really happens > is that, given > > - a context updating tag > - a base

Re: Templates, context-setting custom tag and nested blocks - doesn't work ? (and is it supposed to anyway ?)

2008-09-29 Thread bruno desthuilliers
On 27 sep, 07:17, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: Hi Malcolm. > On Wed, 2008-09-24 at 02:36 -0700, bruno desthuilliers wrote: (snip) > I may not be completely understanding the problem you're explaining -- a > short example from you may help illustrate the exact difficulty. Firs

Re: Templates, context-setting custom tag and nested blocks - doesn't work ? (and is it supposed to anyway ?)

2008-09-26 Thread Malcolm Tredinnick
On Wed, 2008-09-24 at 02:36 -0700, bruno desthuilliers wrote: > Hi all > > I don't know wether it's me doing something wrong, or if it's a normal > limitation of Django's templates, or else, but anyway, here's the > problem: > > I have a custom tag that sets a variable in the context (the usual

Re: templates: additional forloop variable?

2008-07-14 Thread Scott Moonen
(Tim - thanks for the suggestion.) Russ, I'm considering adding a forloop.previous (or somesuch) variable to the >> supplemental variables produced by the for tag. If forloop.first is true, >> this value would always be None, but otherwise it would reference the >> actual >> loop item from the p

Re: templates: additional forloop variable?

2008-07-14 Thread Russell Keith-Magee
On Mon, Jul 14, 2008 at 7:46 AM, Scott Moonen <[EMAIL PROTECTED]> wrote: > I'm considering adding a forloop.previous (or somesuch) variable to the > supplemental variables produced by the for tag. If forloop.first is true, > this value would always be None, but otherwise it would reference the ac

Re: templates: additional forloop variable?

2008-07-13 Thread Tim Chase
> I'm considering adding a forloop.previous (or somesuch) > variable to the supplemental variables produced by the for > tag. If forloop.first is true, this value would always be > None, but otherwise it would reference the actual loop item > from the prior iteration. I'd be tempted to do it as

Re: Templates: 'block' tag with name 'title' appears more than once

2008-04-25 Thread Marty Alchin
On Fri, Apr 25, 2008 at 6:35 AM, Grupo Django <[EMAIL PROTECTED]> wrote: > I have this template code: > {% block title %}{% endblock %} > > > And I get the error: 'block' tag with name 'title' appears more than > once. > > What could I do to make this work? I don't know if it's suitable fo

Re: Templates won't translate

2008-04-12 Thread Kenneth Gonsalves
On 12-Apr-08, at 10:15 PM, Basti wrote: > Probably I'm only being stupid but I can't get my templates to be > translated. Everything else (translation in views etc.) works fine. does the template stuff appear in django.po? -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in

Re: Templates won't translate

2008-04-12 Thread Basti
Never mind. I was being stupid after all. I forgot to restart the test server. Plus there was a #, fuzzy in my django.po file that led to the block not being translated. On 12 Apr., 18:45, Basti <[EMAIL PROTECTED]> wrote: > Hi there! > > Probably I'm only being stupid but I can't get my template

Re: Templates with multiple repeating blocks

2008-01-17 Thread AmanKow
On Jan 16, 3:41 am, stryderjzw <[EMAIL PROTECTED]> wrote: > Thanks, everyone. > > I like this idea. That really helped. I hope this gets considered. > > Cheers, > Justin Ok, as soon as I get a chance, I'll get some docs and tests done and post a ticket with a patch. That should greatly improve

Re: Templates with multiple repeating blocks

2008-01-16 Thread stryderjzw
Thanks, everyone. I like this idea. That really helped. I hope this gets considered. Cheers, Justin On Jan 3, 1:16 pm, AmanKow <[EMAIL PROTECTED]> wrote: > I posted a diff on dpaste: http://dpaste.com/hold/29777/ > > This is for a change to django/template/loader_tags.py > > This change would

Re: Templates with multiple repeating blocks

2008-01-03 Thread AmanKow
I posted a diff on dpaste: http://dpaste.com/hold/29777/ This is for a change to django/template/loader_tags.py This change would add an explicit reuse_block tag. {% block menu %} ... {% endblock %} ... {% reuse_block menu %} This change will actually reuse the parsed block. It does not cr

Re: Templates with multiple repeating blocks

2008-01-02 Thread Peter Rowell
> Use the user defined inclusion template tag or {% include %} standard > taghttp://www.djangoproject.com/documentation/templates_python/#inclusio... @Alex: That's not what he was asking for. He wants to be able to have multiple blocks with the same name in a parent template and have them get the

  1   2   >