Re: Django Templates and Conditional CSS classes

2017-11-11 Thread treyd
Omar (and everybody else who responded), Thanks for that ideas and putting a method on the model to return the appropriate CSS class based on the state. I think that would be the cleanest solution if I am going to bite the bullet and put this template-specific logic on the model. It got me th

Re: Django Templates and Conditional CSS classes

2017-11-11 Thread Omar Helal
Hi treyd, I think idea of updating the model and storing it in the db is a bit overkill, however you could create an @propery on the model that will do that logic for you and return the css class for you. e.g. @property def css_class(self): if self.state is SUCHANDSUCH: return "label-soan

Re: Django Templates and Conditional CSS classes

2017-11-10 Thread treyd
Thanks, all, for the info. Looks like the best way to clean this up is to make the model have some knowledge of the CSS class I want to use and make a method to get it. I like that, but I was unsure about sticking view information into the model. Probably the best solution is javascript logic

Re: Django Templates and Conditional CSS classes

2017-11-10 Thread Vijay Khemlani
You can also add a "state_css_class" (or something) method to your object class and just call ... the method should be quite simple On Fri, Nov 10, 2017 at 7:01 PM, Adam Simon wrote: > > You can pass the class from either the model or the view into the > template. For example, you can assign

Re: Django Templates and Conditional CSS classes

2017-11-10 Thread Adam Simon
You can pass the class from either the model or the view into the template. For example, you can assign a class to a button with a variable: <|button> And then the class would have to be defined in your style somewhere On Fri, Nov 10, 2017 at 1:37 PM treyd wrote: > At some point I plan on fig

Re: Django Templates and Conditional CSS classes

2017-11-10 Thread treyd
At some point I plan on figuring out how to do more intelligent front-end in-browser stuff (Angular, etc) which yeah would definitely help me here but I was wondering if there was a Django-only way of doing this. On Friday, November 10, 2017 at 3:51:09 PM UTC-5, Adam wrote: > > > Are you open to

Re: Django Templates and Conditional CSS classes

2017-11-10 Thread Adam Simon
Are you open to using JavaScript in the front end? It would make it really easy On Fri, Nov 10, 2017 at 12:40 PM treyd wrote: > Hello, > > I am trying to render a model field in a django template, and, based on > the value of the field, I want to specify a different CSS class. Right > now, my s

Django Templates and Conditional CSS classes

2017-11-10 Thread treyd
Hello, I am trying to render a model field in a django template, and, based on the value of the field, I want to specify a different CSS class. Right now, my solution is this: {{ myobject.state }} This works, but seems like a really ugly solution and a bunch of logic in the template. Is the

New Django User-Modifying templates

2017-07-23 Thread 413jonnn
Hi, I am a new user to Django. I recently downloaded and installed a calendar app called "Happenings". I would like to incorporate that into my app and would like to modify several things in the Happenings app. When I go to the admin page, I see the Happenings app listed and it works ok but as

Re: pass context to overridden templates

2017-05-04 Thread Florian Schweikert
On 03/05/17 15:53, cjdcordeiro wrote: > Probably the best would be overriding the app's default class based > view, but when I look at it > (https://github.com/django-notifications/django-notifications/blob/master/notifications/views.py#L29) > it doesn't have a get_context method or anything I can

Re: pass context to overridden templates

2017-05-03 Thread cjdcordeiro
fications' > )), > ... > > > I've modified those default templates but I am unable to pass context to > them. > > I found this: > https://github.com/django-crispy-forms/django-crispy-forms/issues/646 > > It isn't old so I'm afraid this is yet not pos

pass context to overridden templates

2017-05-02 Thread cjdcordeiro
Hi guys, I'm using django-notification-hq, so my app's urls.py has: ... url(r'^inbox/', include(notifications.urls, namespace='notifications')), ... I've modified those default templates but I am unable to pass context to them. I found this: https://gi

Re: Different models in child and Parent Templates

2017-05-02 Thread chuck . horowitz
So what would you like the ContactView to populate *into *the nav bar? Without a data model, there is nothing to render. Remember that {% include 'blog/navbar.html' %} will not access/render that "url", it will simply paste in the contents of that file(template) into the template before render

Re: Different models in child and Parent Templates

2017-05-02 Thread jithu s jacob
{% include 'blog/navbar.html' %} RECENT POSTS {%block content %} {% endblock%} class HomeView(ListView): template_name='blog/home.html' model=Blog class BlogView(DetailView): template_name='blog/blog.html' model=Blog class Contact

Different models in child and Parent Templates

2017-05-01 Thread chuck . horowitz
Please be more specific about your issue. How are you rendering your templates? Can you paste into a response your views.py and urls.py for the relevant apps? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Different models in child and Parent Templates

2017-05-01 Thread jithu s jacob
I am using parent template as base which has a side nav bar. the child template keeps changing with clicking of buttons. My child template changes correctly with call to different views through the URLs. Now I want to add some data from model i the parent template irrespective of the view/mod

Jinja templates structure

2017-02-24 Thread Guillermo Gonzalez
Hi guys! I'm involved in a big Django project and I'm trying to propose a way to organize the big amount of jinja templates that we have in our project. The way I'm proposing to oganize them is following a BEM methodology, where all the pages used by a DjangoView being in a

makemessages for js templates

2017-01-19 Thread Nacharov Mikhail
Hello, does somebody know how can I use makemessages commad to collect translation strings from js templates? For example, in mustache(handlebars) templates I would like to have something like this: {{#baggage}} {{#gettext}}{{ num }} bag{{/gettext}} {{/baggage}} Where gettext is the

Re: Questions about templates from a novice - Question #1

2016-12-02 Thread jim_anderson
ject that I call 'testDjangoProject' (I'm not too >> original). My current objective in the test project is to get a working >> template environment and a working knowledge so that I can write and >> templates, template tags and template filters. >> >>

Re: Questions about templates from a novice - Question #1

2016-12-01 Thread Dan Tagg
ect and in parallel, I am experimenting > with a django project that I call 'testDjangoProject' (I'm not too > original). My current objective in the test project is to get a working > template environment and a working knowledge so that I can write and > templates, templa

Questions about templates from a novice - Question #1

2016-12-01 Thread jim_anderson
m experimenting with a django project that I call 'testDjangoProject' (I'm not too original). My current objective in the test project is to get a working template environment and a working knowledge so that I can write and templates, template tags and template filters. I have

Re: What is the use of parent_template filter in Django templates

2016-11-16 Thread Andrew Pinkham
On Nov 1, 2016, at 10:26 AM, Prateek wrote: > I am reading Django Unleashed in which the author uses the following code to > extends the template > > {% extends parent_template|default:"organizer/base_organizer.html" %} > > What does parent_template do ? Hi Prateek, Thanks for buying my book!

Re: What is the use of parent_template filter in Django templates

2016-11-01 Thread ludovic coues
Is there any variable called parent_template in the context ? 2016-11-01 15:26 GMT+01:00 Prateek : > I am reading Django Unleashed in which the author uses the following code to > extends the template > > {% extends parent_template|default:"organizer/base_organizer.html" %} > > > What does parent_

What is the use of parent_template filter in Django templates

2016-11-01 Thread Prateek
roject.com/es/1.10/ref/templates/builtins/> -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to

Re: how to display models in templates

2016-09-13 Thread Timothy Steele
thank you very mach it has work. i am most grateful, any way this did not let me sleep the hole night On Tuesday, September 13, 2016 at 8:33:53 AM UTC+1, Timothy Steele wrote: > > please i try my best but i can display my models in a templates i have > just created. > > *Please

Re: how to display models in templates

2016-09-13 Thread ludovic coues
teele : > thanks i have seen it, but i need to only display *Packt Publishing* but > it give this ** in addition > > > On Tuesday, September 13, 2016 at 8:33:53 AM UTC+1, Timothy Steele wrote: >> >> please i try my best but i can display my models in a templates i have >

Re: how to display models in templates

2016-09-13 Thread Timothy Steele
thanks i have seen it, but i need to only display *Packt Publishing* but it give this ** in addition On Tuesday, September 13, 2016 at 8:33:53 AM UTC+1, Timothy Steele wrote: > > please i try my best but i can display my models in a templates i have > just created. > > *Please

Re: how to display models in templates

2016-09-13 Thread ludovic coues
ur template ? >> >> {{ bookmarks|pprint }} >> {% for bookmark in bookmaks %} >>{{ bookmark|pprint }} >> {% endfor %} >> >> Also, in your for loop, you use bookmarks.title, notice the s. >> >> 2016-09-13 9:33 GMT+02:00 Timothy Steele : &

Re: how to display models in templates

2016-09-13 Thread Timothy Steele
> 2016-09-13 9:33 GMT+02:00 Timothy Steele >: > >> please i try my best but i can display my models in a templates i have >> just created. >> >> *Please have a look at the codes in the models.py file* >> >> from django.db import models >> fro

Re: how to display models in templates

2016-09-13 Thread ludovic coues
n a templates i have > just created. > > *Please have a look at the codes in the models.py file* > > from django.db import models > from django.contrib.auth.models import User > # Create your models here. > > class Link(models.Model): > url=models.URLField(uniq

how to display models in templates

2016-09-13 Thread Timothy Steele
please i try my best but i can display my models in a templates i have just created. *Please have a look at the codes in the models.py file* from django.db import models from django.contrib.auth.models import User # Create your models here. class Link(models.Model): url=models.URLField

Re: How do templates automatically convert dates to local timezone?

2016-08-04 Thread João Sampaio
on from the UTC-stored > datetime in the DB to the localtime-displayed datetime in the templates. > Which function(s) does the template system call to do the conversion? > > On Wednesday, August 3, 2016 at 1:49:45 PM UTC-7, Constantine Covtushenko > wrote: >> >> Hi Robert

Re: How do templates automatically convert dates to local timezone?

2016-08-03 Thread Robert Rollins
Perhaps I wasn't clear. I know *what* Django does with timezone-aware dates. I just want to know *how* it does the conversion from the UTC-stored datetime in the DB to the localtime-displayed datetime in the templates. Which function(s) does the template system call to do the conversion

Re: How do templates automatically convert dates to local timezone?

2016-08-03 Thread Constantine Covtushenko
Hi Robert, You have touched a very simple but always confusing questions - storing dates and showing them to users in different places. As I know Django uses that in very straightforward way. It always converts dates to UTC. Flow that converts them back to different users in different time-zones

How do templates automatically convert dates to local timezone?

2016-08-03 Thread Robert Rollins
I'm writing tests that assert dates are being properly rendered on a certain page, but the tests are failing because the date value on the model object is in UTC, and the date is rendered in local time on the template. I'd like to run that date value through the same mechanism by which the temp

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2016-04-25 Thread Luis Zárate
Sory for not answer before, but I think I could help. First you need to know how django find the templates, so take a look template loaders https://docs.djangoproject.com/en/1.9/ref/templates/api/#django.template.loaders.filesystem.Loader There are two default loaders (filesystem and app

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2016-04-22 Thread woodz
7:15:59 PM UTC+1, Andreas Ka wrote: > > I am working through > https://docs.djangoproject.com/en/1.7/intro/tutorial02 > so far all went fine - but now *templates changes just don't work.* > > > > I think there must be a flaw in that tutorial, something missing, >

Re: Customizing Admin Layout and templates

2015-12-17 Thread Derek
You are better off not trying to change the admin; rather write your own templates and views which can customised to create the exact layout you want. Admin is really designed to be used "as is" and populate the "back end data" of your application. On Tuesday, 15 December

Re: Customizing Admin Layout and templates

2015-12-15 Thread Daniel Chimeno
Hello, If you want to build a CMS, you could use some apps or projects that are out there: https://www.djangopackages.com/grids/g/cms/ El martes, 15 de diciembre de 2015, 20:05:31 (UTC+1), Mayank Singhal escribió: > > Hello, > I am new to django. I want to customize the admin panel

Customizing Admin Layout and templates

2015-12-15 Thread Mayank Singhal
Hello, I am new to django. I want to customize the admin panel templates and layouts. How can i do that can somebody provide me the tutorial. I want to convert it in a panel like Wordpress or Joomla Admin Panel. -- You received this message because you are subscribed to the Google Groups

Re: Tool to document project urls, views, templates, etc...

2015-12-14 Thread Dan Tagg
http://ccbv.co.uk/ does this for django class based views. The code is on github https://github.com/refreshoxford/django-cbv-inspector/ Might be a good starting point. D On 14 December 2015 at 17:49, Royendgel Silberie wrote: > The closest I know is : > > python manage.py show_urls > > in the

Re: Tool to document project urls, views, templates, etc...

2015-12-14 Thread Royendgel Silberie
The closest I know is : python manage.py show_urls in the django-extensions package On Saturday, December 12, 2015 at 9:43:28 AM UTC-4, Mat Gessel wrote: > > Anyone know of a tool that can analyze a project and generate a list or > graph of *views* & related information? > > I'm maintaining a m

Tool to document project urls, views, templates, etc...

2015-12-12 Thread Mat Gessel
Anyone know of a tool that can analyze a project and generate a list or graph of *views* & related information? I'm maintaining a medium size Django project. For each feature/change, I am finding myself creating a "map" of the relevant view names/relationships for quick reference. This includes:

Custom Templates in Django Sitemaps Index

2015-11-06 Thread Andreas Dickow
See my new tutorial on Custom Templates in Django Sitemaps: https://biz-factory.de/django-sitemap-index-tutorial/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, sen

Jquery and templates

2015-11-01 Thread varun naganathan
I basically want to run a jquery script that gets data of an html tag and then use that value to query the database.Any suggestions would be very helpful! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Django templates

2015-11-01 Thread Humphrey Butau
The templates work on any platform, try Django cookie cutter! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.co

Re: Django templates

2015-10-31 Thread Andreas Kuhne
Hi, There aren't any specific templates for windows or any other operating system. Django runs on a webserver and is compatible regardless of OS. I would recommend that you look at the tutorial and see how to get started: https://docs.djangoproject.com/en/1.8/intro/tutorial01/ Regards, An

Django templates

2015-10-31 Thread misheck mujeyi
hi guys a still very new to django so i was wondering is ter a link where i can find Djnago windows templates -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, sen

Re: Possible bug in interaction between 'block' and 'include' in Django Templates

2015-09-10 Thread Suriya Subramanian
I got the answer on IRC that this is not a bug as explained in the documentation for include https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#include Suriya On Thursday, September 10, 2015 at 2:55:42 PM UTC+5:30, Suriya Subramanian wrote: > > Hi, > > I think there is

Possible bug in interaction between 'block' and 'include' in Django Templates

2015-09-10 Thread Suriya Subramanian
Hi, I think there is a bug in how 'block' and 'include' template tags interact in the Django Template Language. I have created a Gist showing this issue: https://gist.github.com/anonymous/2627bb35955db77dbfaa The order of the files in the Gist can be a bit confusing. I will explain what I am t

Re: customize project templates

2015-09-06 Thread Lâm Hải Sơn
Hello, In django 1.8, setting template will be same bellow TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', *'DIRS': [],* 'APP_DIRS': True, 

customize project templates

2015-09-05 Thread Terry Chia
base_site.html from the Django admin template directory in the source code of Django into the project directory. I am facing with this warning. I have attached my file below. Can someone help? My path for base_site.html is at mysite/templates/admin/base_site.html ?: (1_8.W001) The standalon

Re: settings.py TEMPLATES DIRS

2015-08-01 Thread Gary Roach
m. I am using > Ninja-ide as my ide. When I enter the following in the TEMPLATES section > the settings.py file I get an invalid syntax error: > > 'DIRS': [os.path.join(BASE_DIR, 'templates'], > > > Since the DIRS entry is directly out of a tutorial I'm n

Re: settings.py TEMPLATES DIRS

2015-08-01 Thread James Schneider
You're missing a closing ) after 'templates'... -James On Jul 31, 2015 11:59 PM, "Gary Roach" wrote: > Hi > > I'm using Django 1.8 and python 2-7 on a Debian Linux system. I am using > Ninja-ide as my ide. When I enter the following in the TEMPLAT

settings.py TEMPLATES DIRS

2015-07-31 Thread Gary Roach
Hi I'm using Django 1.8 and python 2-7 on a Debian Linux system. I am using Ninja-ide as my ide. When I enter the following in the TEMPLATES section the settings.py file I get an invalid syntax error: 'DIRS': [os.path.join(BASE_DIR, 'templates'], Since the DIRS e

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-

Templates couldn't be found after a new package installed

2015-06-24 Thread entheo
Just received the message after run mysite sever to which a package called 'django-polls' installed according to django-project tutorial . TemplateDoesNotExist at /polls/ polls/index.html, polls/question_list.html I am a new starter for Django Can anyone help me out the question? -- You rec

Re: Presenting percents of Model values in simple templates?

2015-06-10 Thread Vijay Khemlani
import HttpResponse > from django.template import RequestContext, loader > from .models import Container > def index(request): > object_list = Container.objects.all() > template = loader.get_template('myapp/index.html') > context = RequestContext(request, { > &

Presenting percents of Model values in simple templates?

2015-06-10 Thread JLeary
uestContext, loader from .models import Container def index(request): object_list = Container.objects.all() template = loader.get_template('myapp/index.html') context = RequestContext(request, { 'object_list': object_list, }) return HttpResponse(template.render(c

RE: new to Django having models/views/templates question

2015-06-03 Thread Mario Gudelj
: > django-users@googlegroups.com] *On Behalf Of *James Schneider > *Sent:* Tuesday, June 02, 2015 6:01 PM > *To:* django-users@googlegroups.com > *Subject:* Re: new to Django having models/views/templates question > > > > Posting the actual model code will probably help. > &

RE: new to Django having models/views/templates question

2015-06-03 Thread Chris Strasser
Django having models/views/templates question Posting the actual model code will probably help. Your template has this: item.customer_location.name <http://item.customer_location.name/> But you specified the issue later as this: item.customer_location.customer The former won't wo

Re: new to Django having models/views/templates question

2015-06-02 Thread James Schneider
Posting the actual model code will probably help. Your template has this: item.customer_location.name But you specified the issue later as this: item.customer_location.customer The former won't work per your summarized model definitions. The Location model has no attribute called 'name'. The

Re: new to Django having models/views/templates question

2015-06-02 Thread Chris Strasser
Hi James thanks for the response... this line: {{item.customer_location.customer}} . worked this morning and all last week now gives this error: RuntimeError at /sto/ maximum recursion depth exceeded while calling a Python object Request Method: GET Request URL: http://10.0.0.102:80

Re: new to Django having models/views/templates question

2015-06-02 Thread James Schneider
Can you post the error and traceback? It sounds like you may have an encoding issue. -James On Jun 2, 2015 11:00 AM, "Chris Strasser" wrote: > Hi am plugging away at learning Django and have done well so far (thanks > to great documentation and Stackoverflow) but I have run into a problem > that

new to Django having models/views/templates question

2015-06-02 Thread Chris Strasser
Hi am plugging away at learning Django and have done well so far (thanks to great documentation and Stackoverflow) but I have run into a problem that i cant seem to figure out. I have a model that refers to another model that refers to another model. example : Class ServiceOrder id -in

Re: Defining base templates for reusable apps

2015-05-11 Thread Some Developer
it might not be straightforward for the app's user to override. The Django's admin is a good example of this, and it can be customized partially or entirely by adding an admin directory in your site's templates directory, there are also some apps providing new interfaces &

Re: Defining base templates for reusable apps

2015-05-09 Thread Bruno A.
e app's user to override. The Django's admin is a good example of this, and it can be customized partially or entirely by adding an admin directory in your site's templates directory, there are also some apps providing new interfaces <https://www.djangopackages.com/g

Defining base templates for reusable apps

2015-05-08 Thread Some Developer
I'm looking into building a set of open source reusable apps for Django and was wondering what the currently accepted best practice was for defining base templates for reusable apps was? I want my reusable apps templates to be easy to slot into an already existing site design but I

admin templates not overriding after upgrade to 1.8

2015-04-03 Thread Ezequiel
Hi! In my_templates_dir/admin/ I override some admin templates files: base.html, base_site.html, change_form.html and index.html. But none of them are working after migrate to 1.8. I read https://docs.djangoproject.com/en/1.8/releases/1.8/ but I don't find any reference to changes relat

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

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

templates tags works in scripts sections of the html?

2015-03-20 Thread dk
I am trying to create an autocomplete tag with jquery UI http://jqueryui.com/autocomplete/ in my view I got a list of commands, in the meant time I am just testing it, so I have a list with ["a", "aaa", "b", "bbb"] $(function() { var avaibleTags = [ {% for i in list_commands %}

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2015-03-12 Thread fernando . lescano
└── views.py └── templates └── admin └── base_site.html On Sunday, November 16, 2014 at 3:15:59 PM UTC-3, Andreas Ka wrote: > > I am working through > https://docs.djangoproject.com/en/1.7/intro/tutorial02 > so far all went fine - but no

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2015-03-10 Thread Collin Anderson
Hi, To be clear, you should have this setting: TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')] and in your mysite/templates/admin/base_site.html you should have something like: {% block branding %} Polls Administration {% endblock %} Does that all look right? Thanks, Collin

Re: Sharing templates across multiple projects

2015-03-09 Thread JHeasly
Thanks for the feedback Simon & Ilya. I've done submodules in Git before, but I think I'll keep the templates in a separate repo and symbolic link to the repo ... -- You received this message because you are subscribed to the Google Groups "Django users" group. To uns

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2015-03-08 Thread Bryan Arguello
gt; https://docs.djangoproject.com/en/1.7/intro/tutorial02 > so far all went fine - but now *templates changes just don't work.* > > > > I think there must be a flaw in that tutorial, something missing, > or something different in django 1.7.1 ? > > https://docs.djangoproject.

Re: Sharing templates across multiple projects

2015-03-06 Thread Ilya Kazakevich
I like Simon's ideas about shared location and separate app (Django encourages us to use apps to share anything), but you also may share them on VCS level. SVN supports "external" checkout, in git you may add one repository to another. \project1\templates\shared_temps \pro

Re: Sharing templates across multiple projects

2015-03-06 Thread Simon Charette
Hi John, I suggest you put the templates you want to share in a location accessible by your multiple projects and add this directory to your TEMPLATE_DIRS <https://docs.djangoproject.com/en/1.7/ref/settings/#std:setting-TEMPLATE_DIRS> setting. Make sure yo

Sharing templates across multiple projects

2015-03-06 Thread JHeasly
Hello — I'm looking for any blogposts/best practices for deploying a common set of templates across multiple Django projects. My initial impulse is to just make a master Github repo of the template and pull it into each of the projects. Are there better approaches? TIA, John -- You rec

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2015-02-16 Thread Djarum Tujuhenam
I am using Debian 7 and Python 2.7, Django version 1.7 Reading the Tutorial on the exactly same page : https://docs.djangoproject.com/en/1.7/intro/tutorial02/ The result is our admin template completely ignored. -- You received this message because you are subscribed to the Google Groups "Dj

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2015-02-12 Thread Marc Moncrief
I've been going through the tutorial and had the same problem. The docs say "Create a templates directory in your project directory. " I don't know if this will apply to you, but I thought that meant to put it in the poll directory. They mean to put it in the mysite dir

Re: How to add my Templates folder to TEMPLATE_DIRS

2015-01-18 Thread Mike Dewhirst
On 18/01/2015 5:01 PM, Kishan Mehta wrote: Hello all, > I want to customise how admin page looks > I have my template folder in my application folder at C:\Users\kishan\Django_App\polls\templates\admin > In settings.py I have added TEMPLATE_DIRS = [os.path.join(BASE_DIR,'C

How to add my Templates folder to TEMPLATE_DIRS

2015-01-18 Thread Kishan Mehta
Hello all, > I want to customise how admin page looks > I have my template folder in my application folder at C:\Users\kishan\Django_App\polls\templates\admin > In settings.py I have added TEMPLATE_DIRS = [os.path.join(BASE_DIR,'C:\Users\kishan\Django_App\polls\templates

Re: Advice about composing several templates

2015-01-04 Thread Andreas Kuhne
Hi Martin, You are doing it correctly if you use the {% include "foo/bar.html" %} method. I usually try to make my include templates as small as possible and use one or more on a page to try to be as DRY as possible. It tends to make better, smaller code and also it's easier

Advice about composing several templates

2015-01-04 Thread Martin Torre Castro
when coming to show personal data of a person, you can show also another data concerning that person, but not personal data (financial data, for instance). My intuition told me that we should look for a solution in which we could make small templates that we could compose, combine and concatenat

Re: Evaluating variables in a blocktrans block within templates

2014-12-18 Thread Frankline
Nicely answered. Thanks Andreas. On Thu, Dec 18, 2014 at 3:27 PM, Andreas Kuhne wrote: > > Hi Frankline, > > You can only reference variables in the templates directly with the > blocktrans tag. See > https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#blocktrans-

Re: Evaluating variables in a blocktrans block within templates

2014-12-18 Thread Andreas Kuhne
Hi Frankline, You can only reference variables in the templates directly with the blocktrans tag. See https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#blocktrans-template-tag. So you have to use the "with" statement on blocktrans to access properties of a class. Regards

Evaluating variables in a blocktrans block within templates

2014-12-18 Thread Frankline
Hi all, I recently had a weird problem in my django templates regarding evaluating variables within a blocktrans, but I finally figured it out. I guess I just want to know the reason why it worked, an explanation sort of. THIS DID NOT WORK {% blocktrans %}Approve all {{ objects.count }} users

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2014-11-25 Thread donarb
> This is where I placed it: >> >> ... >> import os >> BASE_DIR = os.path.dirname(os.path.dirname(__file__)) >> TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')] >> ... >> >> >> just tried this: >> >> import mysite.set

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2014-11-25 Thread Collin Anderson
ngs file, > > are there two TEMPLATE_DIRS variables defined? > > Nope. > > > This is where I placed it: > > ... > import os > BASE_DIR = os.path.dirname(os.path.dirname(__file__)) > TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')] > ... > &g

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2014-11-22 Thread Andreas Ka
irname(__file__)) TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')] ... just tried this: import mysite.settings as settings print settings.TEMPLATE_DIRS ['D:\\Programming\\eclipse\\mysite\\templates'] so no: not empty. Why is my file templates/admin/base_site.html nev

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2014-11-21 Thread donarb
On Friday, November 21, 2014 10:59:19 AM UTC-8, Andreas Ka wrote: > > I don't know. > How to test that? > > > > The things I have done were these: > > https://docs.djangoproject.com/en/1.7/intro/tutorial02/#customizing-your-project-s-templates > > mkdir

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2014-11-21 Thread Andreas Ka
I don't know. How to test that? The things I have done were these: https://docs.djangoproject.com/en/1.7/intro/tutorial02/#customizing-your-project-s-templates mkdir templates mkdir templates/admin cp /usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/admin/base_site

Django translate not translating jinja templates

2014-11-21 Thread Tom Hamilton Stubber
Hi all, I have a project that is being translated fine for the most part, but my jinja templates aren't working. If I reference them in the django.po file and then compilemessages, the page loads fine with my translations. However, if I makemessages then my entries in the .po get commente

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2014-11-20 Thread Collin Anderson
Hi, Do other templates work in that folder? Collin On Monday, November 17, 2014 4:12:27 PM UTC-5, Andreas Ka wrote: > > > > Show your view code > The tutorial did not create any view.py for the admin pages > > > > See > https://docs.djangoproject.com/en/1.7/i

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2014-11-17 Thread Andreas Ka
> Show your view code The tutorial did not create any view.py for the admin pages See https://docs.djangoproject.com/en/1.7/intro/tutorial02/#customize-the-admin-look-and-feel We copied from the Django source files these two into: /mysite/templates/admin/base_site.html and /mysite/templa

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2014-11-17 Thread Artie
Are you sure about correct path to your templates in views? Show your view code понедельник, 17 ноября 2014 г., 5:04:53 UTC+2 пользователь Andreas Ka написал: > > thanks for your answer. > > yes, I just tried that. Same result. > By now, I have understood much more about the t

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2014-11-16 Thread Andreas Ka
thanks for your answer. yes, I just tried that. Same result. By now, I have understood much more about the templates. But still, for the admin pages mysite/templates/admin/base_site.html doesn't work yet. I have actually found more errors in the tutorial: https://docs.djangoproject.c

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