Re: HOW TO OUTPUT DATA GOT FROM combined queryset IN DJANGO TEMPLATE (html file) ?

2023-01-16 Thread Byansi Samuel
Thanks it worked but I would like to ask you, why did you use  " game" in
{%for game in combined_list %} ? En what is the role of 'game'


On Sat, Jan 14, 2023, 8:35 PM Hector Mwaky  wrote:

>
>1.
>
>In the windows_games view in others/views.py, you are using the
>filter() method on the Action and Adventure models to get the action and
>adventure games that have the 'os' field set to 'windows'. Then you are
>using the itertools.chain() function to combine the two querysets into a
>single list, and storing that list in the variable combined_list. The
>context variable is not created correctly, it should be context =
>{'combined_list': combined_list}
>2.
>
>In the template others/os/windows_game.html, to output the results of
>the combined_list you should use a for loop to iterate over the list and
>display each item. Also, it seems that you are trying to access the
>game_pic attribute of the objects in the combined_list, but the models you
>have defined (Action and Adventure) do not have a field called game_pic
>3.
>
>{% for game in combined_list %}  {{
>game.name }} {% endfor %}
>4.
>
>It would be a good idea to add a __str__ method to the models in order
>to return the name of the game, and also to add a field game_pic if you
>want to display the image of the game.
>class Action(models.Model): name=models.Charfield() os=
>models.Charfield(choices=OS) game_pic = models.ImageField(upload_to=
>'action_game_pic/') def __str__(self): return
>
>
> On Thursday, 12 January 2023 at 18:27:03 UTC+3 samuelb...@gmail.com wrote:
>
>> Hey!  Am having a problem. And l request for your Help.
>>
>> Am having 3 apps in Django project
>> - action
>> - adventure
>> - others
>>
>>
>> #action/ models.py
>>
>> 
>> class Action(models.Model):
>> name=models.Charfield()
>> os= models.Charfield( choices=OS)
>>
>>
>>
>> #adventure/models.py
>>
>>
>> 
>> class Adventure(models.Model):
>>  name=models.Charfield()
>>  os= models.Charfield( choices=OS)
>>
>>
>>
>> #Others/views.py
>>
>>
>> from itertools import chain
>>
>> from action.models import Action
>>
>> from adventure.models import Adventure
>>
>>
>> def windows_games(request):
>>
>> win_action = Action.objects.filter(os='windows')
>>
>> win_adventure = Adventure.objects.filter(os='windows')
>> combined_list = list(chain(win_action,win_adventure))
>>
>> context = ['combined_list':combined_list,]
>>
>>  return render(request, 'others/os/windows_game.html' , context)
>>
>>
>>
>> #others/os/windows_game.html
>>
>> .
>> 
>>  
>>  {{combined_list.name}}
>> .
>>
>>
>>
>>
>>
>>
>>
>>
>> 1). I need to correct me in #others/ views.py  if there is any mistake
>> done.
>>
>> 2). I would like to know how to know how to write the tag that outputs
>> the results in #others/os/windows_game.html because I tried that but
>> outputs nothing.
>> And l would like to be in form of,
>> #{{combined_list.game_pic}}, etc
>>
>>
>> Please help me.
>> I'm Samuel
>>
>>
>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0b3af5d4-bb40-430c-9016-c2c7fa6108fan%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGQoQ3yPZCzzFhw9w5%3DhMrc5jWEjNQzAKgJcdCs8o6jva3JUhA%40mail.gmail.com.


Re: HOW TO OUTPUT DATA GOT FROM combined queryset IN DJANGO TEMPLATE (html file) ?

2023-01-14 Thread Hector Mwaky

   
   1. 
   
   In the windows_games view in others/views.py, you are using the filter() 
   method on the Action and Adventure models to get the action and adventure 
   games that have the 'os' field set to 'windows'. Then you are using the 
   itertools.chain() function to combine the two querysets into a single list, 
   and storing that list in the variable combined_list. The context variable 
   is not created correctly, it should be context = {'combined_list': 
   combined_list}
   2. 
   
   In the template others/os/windows_game.html, to output the results of 
   the combined_list you should use a for loop to iterate over the list and 
   display each item. Also, it seems that you are trying to access the 
   game_pic attribute of the objects in the combined_list, but the models you 
   have defined (Action and Adventure) do not have a field called game_pic
   3. 
   
   {% for game in combined_list %}  {{ 
   game.name }} {% endfor %}
   4. 
   
   It would be a good idea to add a __str__ method to the models in order 
   to return the name of the game, and also to add a field game_pic if you 
   want to display the image of the game.
   class Action(models.Model): name=models.Charfield() os= 
   models.Charfield(choices=OS) game_pic = models.ImageField(upload_to=
   'action_game_pic/') def __str__(self): return 
   

On Thursday, 12 January 2023 at 18:27:03 UTC+3 samuelb...@gmail.com wrote:

> Hey!  Am having a problem. And l request for your Help.
>
> Am having 3 apps in Django project
> - action
> - adventure
> - others
>
>
> #action/ models.py
>
> 
> class Action(models.Model):
> name=models.Charfield()
> os= models.Charfield( choices=OS)
>
>
>
> #adventure/models.py
>
>
> 
> class Adventure(models.Model):
>  name=models.Charfield()
>  os= models.Charfield( choices=OS)
>
>
>
> #Others/views.py
>
>
> from itertools import chain
>
> from action.models import Action
>
> from adventure.models import Adventure
>
>
> def windows_games(request):
>
> win_action = Action.objects.filter(os='windows')
>
> win_adventure = Adventure.objects.filter(os='windows')
> combined_list = list(chain(win_action,win_adventure))
>
> context = ['combined_list':combined_list,] 
>
>  return render(request, 'others/os/windows_game.html' , context)
>
>
>
> #others/os/windows_game.html
>
> .
> 
>  
>  {{combined_list.name}}
> .
>
>
>
>
>
>
>
>
> 1). I need to correct me in #others/ views.py  if there is any mistake 
> done.
>
> 2). I would like to know how to know how to write the tag that outputs the 
> results in #others/os/windows_game.html because I tried that but outputs 
> nothing.
> And l would like to be in form of,  
> #{{combined_list.game_pic}}, etc
>
>
> Please help me.
> I'm Samuel
>
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0b3af5d4-bb40-430c-9016-c2c7fa6108fan%40googlegroups.com.


Re: If Statement django template

2023-01-12 Thread ASAMOAH EMMANUEL
You can't compare the `contract.supplier` attribute directly to a string
like 'IBM', because it is a foreign key to a `Supplier` model instance.
Instead, you need to access the related `Supplier` model's attributes to
compare them. For example, if the `Supplier` model has a `name` attribute,
you can use:

{% if contract.supplier.name == 'IBM' %}
Alternatively, you could also use a `filter()` method on your `QuerySet` to
filter the contracts by their supplier name before passing them to the
template.

contracts = Contract.objects.filter(supplier__name='IBM')
Then you don't need to use the if statement in the template.

{% for contract in contracts %}

On Thu, Jan 12, 2023 at 2:52 PM Namanya Daniel 
wrote:

>
> Replace supplier with related_name
>
> On Thu, 12 Jan 2023 at 16:13, 'dtdave' via Django users <
> django-users@googlegroups.com> wrote:
>
>> I have the following relationship in a model
>>
>> class Contract(models.Model):
>> supplier = models.ForeignKey(
>> Supplier,
>> on_delete=models.CASCADE,
>> verbose_name="Supplier Name",
>> related_name="contract_suppliers",
>> )
>>
>> I am trying to include an if statement in my template but the following
>> does not work:
>> {% if contract.supplier == 'IBM' %}
>>
>> If I replace this with a non-foreign key item then it works fine.
>>
>> Any help would be appreciated.
>>
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/4343a170-b193-4c91-aac4-8d773404353dn%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAP4VW2V7HfijNHaCX5G_6ACmkQwLvHVXK%2BfgVdMEjTUOF8jYKA%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABFHQYw8jQObsCMUX4poRMRTtb0g0ph2f%2BjNrrdvnbfNu2Eq5Q%40mail.gmail.com.


Re: If Statement django template

2023-01-12 Thread Precious Olusola
The supplier field in contract is an instance of a Supplier object which is
not a string, so comparing it to a string won't work, instead compare a
field of the supplier instance in the supplier field in contract instance.

Like: {% if contract.supplier.name == "IBM"%}

Do you get it?


On Thu, Jan 12, 2023, 2:13 PM 'dtdave' via Django users <
django-users@googlegroups.com> wrote:

> I have the following relationship in a model
>
> class Contract(models.Model):
> supplier = models.ForeignKey(
> Supplier,
> on_delete=models.CASCADE,
> verbose_name="Supplier Name",
> related_name="contract_suppliers",
> )
>
> I am trying to include an if statement in my template but the following
> does not work:
> {% if contract.supplier == 'IBM' %}
>
> If I replace this with a non-foreign key item then it works fine.
>
> Any help would be appreciated.
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4343a170-b193-4c91-aac4-8d773404353dn%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADGG_A%3DMaFuX%2B%3DUM0xyyCud1E%3DkmMFOPFeZXih4fQvoYyfy5Kw%40mail.gmail.com.


Re: If Statement django template

2023-01-12 Thread Peter Benjamin Ani
Have you figured out a solution to it?

On Thu, 12 Jan 2023, 15:52 Namanya Daniel, 
wrote:

>
> Replace supplier with related_name
>
> On Thu, 12 Jan 2023 at 16:13, 'dtdave' via Django users <
> django-users@googlegroups.com> wrote:
>
>> I have the following relationship in a model
>>
>> class Contract(models.Model):
>> supplier = models.ForeignKey(
>> Supplier,
>> on_delete=models.CASCADE,
>> verbose_name="Supplier Name",
>> related_name="contract_suppliers",
>> )
>>
>> I am trying to include an if statement in my template but the following
>> does not work:
>> {% if contract.supplier == 'IBM' %}
>>
>> If I replace this with a non-foreign key item then it works fine.
>>
>> Any help would be appreciated.
>>
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/4343a170-b193-4c91-aac4-8d773404353dn%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAP4VW2V7HfijNHaCX5G_6ACmkQwLvHVXK%2BfgVdMEjTUOF8jYKA%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPxt_2Uu5ed-AwG4fC_72Ly8MYVm-n5Wio_Sp3jafSd0wqbwpg%40mail.gmail.com.


HOW TO OUTPUT DATA GOT FROM combined queryset IN DJANGO TEMPLATE (html file) ?

2023-01-12 Thread Byansi Samuel
Hey!  Am having a problem. And l request for your Help.

Am having 3 apps in Django project
- action
- adventure
- others


#action/ models.py


class Action(models.Model):
name=models.Charfield()
os= models.Charfield( choices=OS)



#adventure/models.py



class Adventure(models.Model):
 name=models.Charfield()
 os= models.Charfield( choices=OS)



#Others/views.py


from itertools import chain

from action.models import Action

from adventure.models import Adventure


def windows_games(request):

win_action = Action.objects.filter(os='windows')

win_adventure = Adventure.objects.filter(os='windows')
combined_list = list(chain(win_action,win_adventure))

context = ['combined_list':combined_list,]

 return render(request, 'others/os/windows_game.html' , context)



#others/os/windows_game.html

.

 
 {{combined_list.name}}
.








1). I need to correct me in #others/ views.py  if there is any mistake done.

2). I would like to know how to know how to write the tag that outputs the
results in #others/os/windows_game.html because I tried that but outputs
nothing.
And l would like to be in form of,
#{{combined_list.game_pic}}, etc


Please help me.
I'm Samuel

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGQoQ3zPgg7vfKGvQRFyOoYW_7fuM20DUSpzqeY7_uDyPX0agw%40mail.gmail.com.


Re: If Statement django template

2023-01-12 Thread Namanya Daniel
Replace supplier with related_name

On Thu, 12 Jan 2023 at 16:13, 'dtdave' via Django users <
django-users@googlegroups.com> wrote:

> I have the following relationship in a model
>
> class Contract(models.Model):
> supplier = models.ForeignKey(
> Supplier,
> on_delete=models.CASCADE,
> verbose_name="Supplier Name",
> related_name="contract_suppliers",
> )
>
> I am trying to include an if statement in my template but the following
> does not work:
> {% if contract.supplier == 'IBM' %}
>
> If I replace this with a non-foreign key item then it works fine.
>
> Any help would be appreciated.
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4343a170-b193-4c91-aac4-8d773404353dn%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP4VW2V7HfijNHaCX5G_6ACmkQwLvHVXK%2BfgVdMEjTUOF8jYKA%40mail.gmail.com.


Re: If Statement django template

2023-01-12 Thread Peter Benjamin Ani
why using a foreignkey then? what type of relationship is existing between
the supplier and the

On Thu, Jan 12, 2023 at 2:13 PM 'dtdave' via Django users <
django-users@googlegroups.com> wrote:

> I have the following relationship in a model
>
> class Contract(models.Model):
> supplier = models.ForeignKey(
> Supplier,
> on_delete=models.CASCADE,
> verbose_name="Supplier Name",
> related_name="contract_suppliers",
> )
>
> I am trying to include an if statement in my template but the following
> does not work:
> {% if contract.supplier == 'IBM' %}
>
> If I replace this with a non-foreign key item then it works fine.
>
> Any help would be appreciated.
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4343a170-b193-4c91-aac4-8d773404353dn%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPxt_2WpMVk%2Bzsw_useriH4GfGq0k1O5MisHbObcZ%2BCvR3hw%2Bg%40mail.gmail.com.


If Statement django template

2023-01-12 Thread 'dtdave' via Django users
I have the following relationship in a model

class Contract(models.Model):
supplier = models.ForeignKey(
Supplier,
on_delete=models.CASCADE,
verbose_name="Supplier Name",
related_name="contract_suppliers",
)

I am trying to include an if statement in my template but the following 
does not work:
{% if contract.supplier == 'IBM' %}

If I replace this with a non-foreign key item then it works fine.

Any help would be appreciated.



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4343a170-b193-4c91-aac4-8d773404353dn%40googlegroups.com.


django template engine and bootstrap modals

2022-02-10 Thread Andrea Villani
Hi everyone!
I am developing an appweb and I'm stuck. My homepage is structured as a 
ListView, where each row shows every object's attributes using django 
template engine (ex: {{object.attribute}}. Last column shows a button to do 
an action through a bootstrap modal and if I put {{object .attribute}} it 
doesn't refered to the current object but to the first one which is 
displayed in the ListView. I have tried also using a bootstrap dropdown and 
the problem does not arise. Someone knows how to solve that?
Thank you in avdance!

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/104d4f10-89c0-49eb-b267-44ff6a8af082n%40googlegroups.com.


Re: Creating some fields on the fly in django template

2021-10-24 Thread Ammar Mohammed
Hello
In your case i wouldn't import all the form at once using, {{ form.as_p}}

Instead try to import every single field of your form thenyou can use
JavaScript to show and hide fields according to input because django can't
do this kind of editing.


On 24 Oct 2021 7:32 PM, "Dina Dodin"  wrote:

Hi

i have forms (not using Models)
in some forms i want to introduce dropdown list for example in case some
specific value is selected for another existing form field.

i tried something if found in google but nothing seems to work for me.

if someone can help me with it will be great!

in html template i get the form as this: {{ form.as_p }}
i want to show/hide a new field according to value i select of existing
field value.

-- 
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/4974223a-7544-4934-8f1f-e07675590d44n%40googlegroups.com

.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHs1H7uWigr_Z6kQHb%3DbZE3F-JXrj7JA-y9T5zWVn15fkmvdMw%40mail.gmail.com.


Creating some fields on the fly in django template

2021-10-24 Thread Dina Dodin
Hi

i have forms (not using Models)
in some forms i want to introduce dropdown list for example in case some 
specific value is selected for another existing form field.

i tried something if found in google but nothing seems to work for me.

if someone can help me with it will be great!

in html template i get the form as this: {{ form.as_p }}
i want to show/hide a new field according to value i select of existing 
field value.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4974223a-7544-4934-8f1f-e07675590d44n%40googlegroups.com.


Re: How to use django template tags in .js file ??

2021-06-17 Thread Ayush Bisht
thanks, It works for me  

On Wednesday, June 16, 2021 at 12:08:20 PM UTC-7 Nikeet NA wrote:

> Or you can store the url in the variable then use it.
>
> On Thursday, 17 June 2021 at 00:29:00 UTC+5:30 Nikeet NA wrote:
>
>> Do like this use 
>> var obj_slug = object.slug inside script tag below it include your js 
>> file with the above js script. in js file you can acces it with obj_slug 
>> variable.
>>
>> On Wednesday, 16 June 2021 at 22:31:39 UTC+5:30 kuassi...@paydunya.com 
>> wrote:
>>
>>> I also had the problem once. But what I understood is that the 
>>> interpretation of the DJANGO syntax in statics files only works when the 
>>> file has an HTML extension. So if you really want to do something separate 
>>> with the script you can just create another HTML file but in another folder 
>>> where you will put the script content surrounded by the SCRIPT tags and 
>>> then you will just include with the directive {% INCLUDE %} in 
>>> your main HTML file.
>>>
>>> On Wednesday, June 16, 2021 at 3:59:16 PM UTC bisht.a...@gmail.com 
>>> wrote:
>>>
 while doing great stuff with django I have found some clumsy behaviour 
 of django in handling .js file. Is there a way to effectively integrate 
 all 
 the stuff of   in a separate file and effectively used it 
 with rest of the html code. 

 for example : 

 // *file.html 
 ..*

 
   

 >>> method="POST" id="likes-form">
 {% csrf_token %}

 >>> id="like-{{
 object.pk}}">
 
   
   
 {{ object.total_likes }}
   
 




 //  *file.js file*  
 ..

 $("#likes-form").submit(function (e)
 {  e.preventDefault();
   var serializedData = $(this).serializeArray();
   $.ajax({
   type: 'POST',
   url: '{% url 'blog_likes' object.slug  %}',
   data: serializedData,
   success: function (response) {
 var like_count = JSON.parse(response["like"]);
 like_flag = JSON.parse(response["flag"]);
 
 console.log(like_flag);
   
 if(like_flag == 0){  
 $(".like-inner-flex-1").toggleClass('like-animate');   
   }else
   $(".like-inner-flex-1").toggleClass('like-animate'); 
   
   if(like_flag){

   $('.like-btn').css({"background-color": "#d629801a" , "outline": 
 "none"});

 $('.like-inner-flex-1').css({"background-position": "right",  
 "filter": "grayscale(0%)"});

 } else {

 $('.like-btn').css({"background-color": "transparent", "outline": 
 "none"});

 $('.like-inner-flex-1').css({"background-position": "right",  
 "filter": "grayscale(100%)"});

 }

 $("#likes").text(`${like_count}`);
 }})
 })

 ..

 if I use above script inside the same html file then it works, but in 
 above case its not working ?? If there is any work around to do this thing 
 , then please suggest me .

 Thank you...

  




-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0e2ac9d2-60ef-4acf-b69f-8f0ba70eeffbn%40googlegroups.com.


Re: How to use django template tags in .js file ??

2021-06-16 Thread Nikeet NA
Or you can store the url in the variable then use it.

On Thursday, 17 June 2021 at 00:29:00 UTC+5:30 Nikeet NA wrote:

> Do like this use 
> var obj_slug = object.slug inside script tag below it include your js file 
> with the above js script. in js file you can acces it with obj_slug 
> variable.
>
> On Wednesday, 16 June 2021 at 22:31:39 UTC+5:30 kuassi...@paydunya.com 
> wrote:
>
>> I also had the problem once. But what I understood is that the 
>> interpretation of the DJANGO syntax in statics files only works when the 
>> file has an HTML extension. So if you really want to do something separate 
>> with the script you can just create another HTML file but in another folder 
>> where you will put the script content surrounded by the SCRIPT tags and 
>> then you will just include with the directive {% INCLUDE %} in 
>> your main HTML file.
>>
>> On Wednesday, June 16, 2021 at 3:59:16 PM UTC bisht.a...@gmail.com wrote:
>>
>>> while doing great stuff with django I have found some clumsy behaviour 
>>> of django in handling .js file. Is there a way to effectively integrate all 
>>> the stuff of   in a separate file and effectively used it 
>>> with rest of the html code. 
>>>
>>> for example : 
>>>
>>> // *file.html 
>>> ..*
>>>
>>> 
>>>   
>>>
>>> >> method="POST" id="likes-form">
>>> {% csrf_token %}
>>>
>>> >> id="like-{{
>>> object.pk}}">
>>> 
>>>   
>>>   
>>> {{ object.total_likes }}
>>>   
>>> 
>>>
>>>
>>>
>>>
>>> //  *file.js file*  
>>> ..
>>>
>>> $("#likes-form").submit(function (e)
>>> {  e.preventDefault();
>>>   var serializedData = $(this).serializeArray();
>>>   $.ajax({
>>>   type: 'POST',
>>>   url: '{% url 'blog_likes' object.slug  %}',
>>>   data: serializedData,
>>>   success: function (response) {
>>> var like_count = JSON.parse(response["like"]);
>>> like_flag = JSON.parse(response["flag"]);
>>> 
>>> console.log(like_flag);
>>>   
>>> if(like_flag == 0){  
>>> $(".like-inner-flex-1").toggleClass('like-animate');   
>>>   }else
>>>   $(".like-inner-flex-1").toggleClass('like-animate'); 
>>>   
>>>   if(like_flag){
>>>
>>>   $('.like-btn').css({"background-color": "#d629801a" , "outline": 
>>> "none"});
>>>
>>> $('.like-inner-flex-1').css({"background-position": "right",  
>>> "filter": "grayscale(0%)"});
>>>
>>> } else {
>>>
>>> $('.like-btn').css({"background-color": "transparent", "outline": 
>>> "none"});
>>>
>>> $('.like-inner-flex-1').css({"background-position": "right",  
>>> "filter": "grayscale(100%)"});
>>>
>>> }
>>>
>>> $("#likes").text(`${like_count}`);
>>> }})
>>> })
>>>
>>> ..
>>>
>>> if I use above script inside the same html file then it works, but in 
>>> above case its not working ?? If there is any work around to do this thing 
>>> , then please suggest me .
>>>
>>> Thank you...
>>>
>>>  
>>>
>>>
>>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3e005ecb-77c9-4fac-aa10-ba0d7059c758n%40googlegroups.com.


Re: How to use django template tags in .js file ??

2021-06-16 Thread Nikeet NA
Do like this use 
var obj_slug = object.slug inside script tag below it include your js file 
with the above js script. in js file you can acces it with obj_slug 
variable.

On Wednesday, 16 June 2021 at 22:31:39 UTC+5:30 kuassi...@paydunya.com 
wrote:

> I also had the problem once. But what I understood is that the 
> interpretation of the DJANGO syntax in statics files only works when the 
> file has an HTML extension. So if you really want to do something separate 
> with the script you can just create another HTML file but in another folder 
> where you will put the script content surrounded by the SCRIPT tags and 
> then you will just include with the directive {% INCLUDE %} in 
> your main HTML file.
>
> On Wednesday, June 16, 2021 at 3:59:16 PM UTC bisht.a...@gmail.com wrote:
>
>> while doing great stuff with django I have found some clumsy behaviour of 
>> django in handling .js file. Is there a way to effectively integrate all 
>> the stuff of   in a separate file and effectively used it 
>> with rest of the html code. 
>>
>> for example : 
>>
>> // *file.html 
>> ..*
>>
>> 
>>   
>>
>> > method="POST" id="likes-form">
>> {% csrf_token %}
>>
>> > id="like-{{
>> object.pk}}">
>> 
>>   
>>   
>> {{ object.total_likes }}
>>   
>> 
>>
>>
>>
>>
>> //  *file.js file*  
>> ..
>>
>> $("#likes-form").submit(function (e)
>> {  e.preventDefault();
>>   var serializedData = $(this).serializeArray();
>>   $.ajax({
>>   type: 'POST',
>>   url: '{% url 'blog_likes' object.slug  %}',
>>   data: serializedData,
>>   success: function (response) {
>> var like_count = JSON.parse(response["like"]);
>> like_flag = JSON.parse(response["flag"]);
>> 
>> console.log(like_flag);
>>   
>> if(like_flag == 0){  
>> $(".like-inner-flex-1").toggleClass('like-animate');   
>>   }else
>>   $(".like-inner-flex-1").toggleClass('like-animate'); 
>>   
>>   if(like_flag){
>>
>>   $('.like-btn').css({"background-color": "#d629801a" , "outline": 
>> "none"});
>>
>> $('.like-inner-flex-1').css({"background-position": "right",  
>> "filter": "grayscale(0%)"});
>>
>> } else {
>>
>> $('.like-btn').css({"background-color": "transparent", "outline": 
>> "none"});
>>
>> $('.like-inner-flex-1').css({"background-position": "right",  
>> "filter": "grayscale(100%)"});
>>
>> }
>>
>> $("#likes").text(`${like_count}`);
>> }})
>> })
>>
>> ..
>>
>> if I use above script inside the same html file then it works, but in 
>> above case its not working ?? If there is any work around to do this thing 
>> , then please suggest me .
>>
>> Thank you...
>>
>>  
>>
>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5646832c-ab1a-4e58-8e10-0b178ddab1c0n%40googlegroups.com.


Re: How to use django template tags in .js file ??

2021-06-16 Thread Kuassi Israel
I also had the problem once. But what I understood is that the 
interpretation of the DJANGO syntax in statics files only works when the 
file has an HTML extension. So if you really want to do something separate 
with the script you can just create another HTML file but in another folder 
where you will put the script content surrounded by the SCRIPT tags and 
then you will just include with the directive {% INCLUDE %} in 
your main HTML file.

On Wednesday, June 16, 2021 at 3:59:16 PM UTC bisht.a...@gmail.com wrote:

> while doing great stuff with django I have found some clumsy behaviour of 
> django in handling .js file. Is there a way to effectively integrate all 
> the stuff of   in a separate file and effectively used it 
> with rest of the html code. 
>
> for example : 
>
> // *file.html 
> ..*
>
> 
>   
>
>  method="POST" id="likes-form">
> {% csrf_token %}
>
>  id="like-{{
> object.pk}}">
> 
>   
>   
> {{ object.total_likes }}
>   
> 
>
>
>
>
> //  *file.js file*  
> ..
>
> $("#likes-form").submit(function (e)
> {  e.preventDefault();
>   var serializedData = $(this).serializeArray();
>   $.ajax({
>   type: 'POST',
>   url: '{% url 'blog_likes' object.slug  %}',
>   data: serializedData,
>   success: function (response) {
> var like_count = JSON.parse(response["like"]);
> like_flag = JSON.parse(response["flag"]);
> 
> console.log(like_flag);
>   
> if(like_flag == 0){  
> $(".like-inner-flex-1").toggleClass('like-animate');   
>   }else
>   $(".like-inner-flex-1").toggleClass('like-animate'); 
>   
>   if(like_flag){
>
>   $('.like-btn').css({"background-color": "#d629801a" , "outline": 
> "none"});
>
> $('.like-inner-flex-1').css({"background-position": "right",  
> "filter": "grayscale(0%)"});
>
> } else {
>
> $('.like-btn').css({"background-color": "transparent", "outline": 
> "none"});
>
> $('.like-inner-flex-1').css({"background-position": "right",  
> "filter": "grayscale(100%)"});
>
> }
>
> $("#likes").text(`${like_count}`);
> }})
> })
>
> ..
>
> if I use above script inside the same html file then it works, but in 
> above case its not working ?? If there is any work around to do this thing 
> , then please suggest me .
>
> Thank you...
>
>  
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c39ae23c-28f6-4e38-9dec-87e6d4809759n%40googlegroups.com.


How to use django template tags in .js file ??

2021-06-16 Thread Ayush Bisht
while doing great stuff with django I have found some clumsy behaviour of 
django in handling .js file. Is there a way to effectively integrate all 
the stuff of   in a separate file and effectively used it 
with rest of the html code. 

for example : 

// *file.html 
..*


  

{% csrf_token %}


  
  
{{ object.total_likes }}
  





//  *file.js file*  
..

$("#likes-form").submit(function (e)
{  e.preventDefault();
  var serializedData = $(this).serializeArray();
  $.ajax({
  type: 'POST',
  url: '{% url 'blog_likes' object.slug  %}',
  data: serializedData,
  success: function (response) {
var like_count = JSON.parse(response["like"]);
like_flag = JSON.parse(response["flag"]);

console.log(like_flag);
  
if(like_flag == 0){  
$(".like-inner-flex-1").toggleClass('like-animate');   
  }else
  $(".like-inner-flex-1").toggleClass('like-animate'); 
  
  if(like_flag){
  $('.like-btn').css({"background-color": "#d629801a" , "outline": 
"none"});
$('.like-inner-flex-1').css({"background-position": "right",  "filter": 
"grayscale(0%)"});

} else {
$('.like-btn').css({"background-color": "transparent", "outline": 
"none"});
$('.like-inner-flex-1').css({"background-position": "right",  "filter": 
"grayscale(100%)"});

}

$("#likes").text(`${like_count}`);
}})
})

..

if I use above script inside the same html file then it works, but in above 
case its not working ?? If there is any work around to do this thing , then 
please suggest me .

Thank you...

 


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fbb6ae3c-2632-4183-9336-fb6bad5dfe0en%40googlegroups.com.


Re: Announcing DjHTML: A Django template indender

2021-05-24 Thread RANGA BHARATH JINKA
Awesome

On Tue, May 25, 2021 at 10:13 AM lalit suthar 
wrote:

> This is looking pretty cool!
>
> On Monday, 24 May 2021 at 18:54:12 UTC+5:30 Jaap Joris Vens wrote:
>
>> Dear all,
>>
>> I would like to take this opportunity to announce my side project to
>> the Django community. It's a Django template indenter called DjHTML.
>> It's Black for Django templates!
>>
>> https://github.com/rtts/djhtml/
>>
>> Over the past year I have fallen in love with Black and pre-commit to
>> automatically format code upon each commit. However, I could not find
>> any tool that would do the same for HTML files and so I decided to
>> write one myself. Take for instance the following template:
>>
>> {% block content %}
>> > {% if index > 1 %}
>> class="extra"
>> {% endif %}
>> >
>> {% localize on %}
>> {% if clickable %}
>> 
>> {% endif %}
>> Blog post {{ nr }}
>> {% if clickable %}
>> 
>> {% endif %}
>> {% endlocalize %}
>> 
>> {% endblock %}
>>
>> This is what it looks like after processing by DjHTML:
>>
>> {% block content %}
>> > {% if index > 1 %}
>> class="extra"
>> {% endif %}
>> >
>> {% localize on %}
>> {% if clickable %}
>> 
>> {% endif %}
>> Blog post {{ nr }}
>> {% if clickable %}
>> 
>> {% endif %}
>> {% endlocalize %}
>> 
>> {% endblock %}
>>
>> Currently, DjHTML is able to parse DTL, HTML, CSS, Javascript and any
>> combinations of these inside the same template. The indentation rules
>> are similar to Emacs' web-mode.el but with better handling of some
>> edge cases.
>>
>> The difference with Black is that DjHTML is an indenter and not a
>> formatter: It will only add/remove whitespace and not insert newlines
>> or any other characters. The goal is to indent already well-structured
>> templates but not to fix broken ones. Also, unlike Black, the tabwidth
>> is configurable :-)
>>
>> I am hoping that some of you will give it a try and hopefully provide
>> me with some feedback, test cases, and bug reports that will help me
>> improve this tool.
>>
>> Greetings,
>> Jaap Joris Vens
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1c5db289-6978-49bd-a306-271997bd5154n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/1c5db289-6978-49bd-a306-271997bd5154n%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK5m316w4rBMedgB%2BhJWJNRdh-ht2PZUWXLVmrJkvya7tdgP2g%40mail.gmail.com.


Re: Announcing DjHTML: A Django template indender

2021-05-24 Thread lalit suthar
This is looking pretty cool! 

On Monday, 24 May 2021 at 18:54:12 UTC+5:30 Jaap Joris Vens wrote:

> Dear all,
>
> I would like to take this opportunity to announce my side project to
> the Django community. It's a Django template indenter called DjHTML.
> It's Black for Django templates!
>
> https://github.com/rtts/djhtml/
>
> Over the past year I have fallen in love with Black and pre-commit to
> automatically format code upon each commit. However, I could not find
> any tool that would do the same for HTML files and so I decided to
> write one myself. Take for instance the following template:
>
> {% block content %}
>  {% if index > 1 %}
> class="extra"
> {% endif %}
> >
> {% localize on %}
> {% if clickable %}
> 
> {% endif %}
> Blog post {{ nr }}
> {% if clickable %}
> 
> {% endif %}
> {% endlocalize %}
> 
> {% endblock %}
>
> This is what it looks like after processing by DjHTML:
>
> {% block content %}
>  {% if index > 1 %}
> class="extra"
> {% endif %}
> >
> {% localize on %}
> {% if clickable %}
> 
> {% endif %}
> Blog post {{ nr }}
> {% if clickable %}
> 
> {% endif %}
> {% endlocalize %}
> 
> {% endblock %}
>
> Currently, DjHTML is able to parse DTL, HTML, CSS, Javascript and any
> combinations of these inside the same template. The indentation rules
> are similar to Emacs' web-mode.el but with better handling of some
> edge cases.
>
> The difference with Black is that DjHTML is an indenter and not a
> formatter: It will only add/remove whitespace and not insert newlines
> or any other characters. The goal is to indent already well-structured
> templates but not to fix broken ones. Also, unlike Black, the tabwidth
> is configurable :-)
>
> I am hoping that some of you will give it a try and hopefully provide
> me with some feedback, test cases, and bug reports that will help me
> improve this tool.
>
> Greetings,
> Jaap Joris Vens
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1c5db289-6978-49bd-a306-271997bd5154n%40googlegroups.com.


Announcing DjHTML: A Django template indender

2021-05-24 Thread Jaap Joris Vens
Dear all,

I would like to take this opportunity to announce my side project to
the Django community. It's a Django template indenter called DjHTML.
It's Black for Django templates!

https://github.com/rtts/djhtml/

Over the past year I have fallen in love with Black and pre-commit to
automatically format code upon each commit. However, I could not find
any tool that would do the same for HTML files and so I decided to
write one myself. Take for instance the following template:

{% block content %}
 1 %}
class="extra"
{% endif %}
>
{% localize on %}
{% if clickable %}

{% endif %}
Blog post {{ nr }}
{% if clickable %}

{% endif %}
{% endlocalize %}

{% endblock %}

This is what it looks like after processing by DjHTML:

{% block content %}
 1 %}
class="extra"
{% endif %}
>
{% localize on %}
{% if clickable %}

{% endif %}
Blog post {{ nr }}
{% if clickable %}

{% endif %}
{% endlocalize %}

{% endblock %}

Currently, DjHTML is able to parse DTL, HTML, CSS, Javascript and any
combinations of these inside the same template. The indentation rules
are similar to Emacs' web-mode.el but with better handling of some
edge cases.

The difference with Black is that DjHTML is an indenter and not a
formatter: It will only add/remove whitespace and not insert newlines
or any other characters. The goal is to indent already well-structured
templates but not to fix broken ones. Also, unlike Black, the tabwidth
is configurable :-)

I am hoping that some of you will give it a try and hopefully provide
me with some feedback, test cases, and bug reports that will help me
improve this tool.

Greetings,
Jaap Joris Vens

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/YKug2AoTDvcMSLz4%40logos.


Re: using variable in django template

2021-02-16 Thread Kasper Laudrup

On 16/02/2021 13.18, Jiffin George Kokkat wrote:

Hi guys,
i want to declare a variable in django template and update value of 
variable inside a loop




https://pythoncircle.com/post/701/how-to-set-a-variable-in-django-template/

https://pythoncircle.com/post/685/for-loop-in-django-template/

Kind regards,

Kasper Laudrup

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e99aad17-ddf3-69c0-fe90-e8b6be4c45b9%40stacktrace.dk.


using variable in django template

2021-02-16 Thread Jiffin George Kokkat
Hi guys,
i want to declare a variable in django template and update value of
variable inside a loop

how to do
Thanks,
Jiffin George Kokkat

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ1rugfx0igTMCHZdgKS7uS0nfOUSKBVgG9oH7MVPzS4Qvf38A%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-12-03 Thread Suhaib Ali
you can use jquery to fetch api calls

On Wed, Nov 25, 2020 at 7:49 PM Aman Modi  wrote:

>
>
> Hello Django lovers.
>
> I want to use REST API  on Django template but i have no idea how can i do
> that.
> I want to use same API on android app and Django template.
>
> Any suggestion .
>
> Thanks and regard
> Aman Modi
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD%2BVV6LED5wS5sAxE-wy6BjyXEzjdVs4wMSd5zQoSgcJ3Vv8uQ%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-11-30 Thread Kris A. Stern
Hey,

Guess you are making some baseless assumptions about the so-called
templates... Can the original poster of the question please clarify what
you really meant before we get more and more confused?

K.S.

On Tue, 1 Dec 2020 at 10:03, Liu Zheng  wrote:

> Hi,
>
> Guys earlier have provided useful links for consuming APIs. Just want to
> emphasize some concepts between server-side and client-side codes.
> A django template is rendered into a page on the *server side*. That
> means, the server does the work and prepares the html content before
> sending it to the browser. In theory, you can call APIs when rendering
> the templates on the server side, but it's almost never a good idea. APIs
> are designed to be consumed by *clients*. The django templates should
> contain the relevant  javascripts (using ajax). These javascripts are not
> executed when the server renders the templates. They are sent as they are
> to the client, and are executed automatically by the browser. If the
> javascript calls API, the browser will come back to your server (this time,
> to the rest api endpoints, instead of the template rendering endpoints) and
> consume your API.
>
> Hope it helps.
>
> Best
> Zheng
>
> On Mon, Nov 30, 2020 at 1:30 AM sree e  wrote:
>
>>
>> Hi
>> find this link
>> https://github.com/sumasreeeduru/Textyfi
>> And go through "api" app , where you will find adding the api in easy way.
>> On Sunday, November 29, 2020 at 12:36:44 PM UTC+5:30 bharath...@gmail.com
>> wrote:
>>
>>> Hi
>>> Use JavaScript or jQuery to call APIs in frontend of Django template.
>>> You can use fetch API using vanilla JavaScript.
>>> You can perform all CRUD operations.
>>> All the best 
>>>
>>> On Sun, 29 Nov 2020, 11:57 am Aman Modi,  wrote:
>>>
>>>> I know how to create API but i just want to know how to use in Django
>>>> template.
>>>>
>>>> On Wednesday, November 25, 2020 at 8:07:47 PM UTC+5:30
>>>> omkar...@gmail.com wrote:
>>>>
>>>>> Creating REST API in Django is similar to any app on Django. All you
>>>>> need to do is, install the djangorestframework library, and serialize your
>>>>> models.
>>>>>
>>>>> YT video 
>>>>> https://youtu.be/TmsD8QExZ84
>>>>> On Wed, Nov 25, 2020, 7:48 PM Aman Modi  wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> Hello Django lovers.
>>>>>>
>>>>>> I want to use REST API  on the Django template but I have no idea how
>>>>>> can I do that.
>>>>>> I want to use the same API on the android app and the Django template.
>>>>>>
>>>>>> Any suggestion.
>>>>>>
>>>>>
>>>>>> Thanks and regard
>>>>>> Aman Modi
>>>>>>
>>>>>> --
>>>>>> 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...@googlegroups.com.
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com?utm_medium=email_source=footer>
>>>>>> .
>>>>>>
>>>>> --
>>>> 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...@googlegroups.com.
>>>>
>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/9219ddfb-a07d-40b4-9e64-8324520043f7n%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/9219ddfb-a07d-40b4-9e64-8324520043f7n%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>
>>>
>>>> --
>> 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 view this discussion on the web

Re: Is it possible to use REST API on Django template ?

2020-11-30 Thread Liu Zheng
Hi,

Guys earlier have provided useful links for consuming APIs. Just want to
emphasize some concepts between server-side and client-side codes.
A django template is rendered into a page on the *server side*. That means,
the server does the work and prepares the html content before sending it to
the browser. In theory, you can call APIs when rendering the templates on
the server side, but it's almost never a good idea. APIs are designed to be
consumed by *clients*. The django templates should contain the relevant
javascripts (using ajax). These javascripts are not executed when the
server renders the templates. They are sent as they are to the client, and
are executed automatically by the browser. If the javascript calls API, the
browser will come back to your server (this time, to the rest api
endpoints, instead of the template rendering endpoints) and consume your
API.

Hope it helps.

Best
Zheng

On Mon, Nov 30, 2020 at 1:30 AM sree e  wrote:

>
> Hi
> find this link
> https://github.com/sumasreeeduru/Textyfi
> And go through "api" app , where you will find adding the api in easy way.
> On Sunday, November 29, 2020 at 12:36:44 PM UTC+5:30 bharath...@gmail.com
> wrote:
>
>> Hi
>> Use JavaScript or jQuery to call APIs in frontend of Django template.
>> You can use fetch API using vanilla JavaScript.
>> You can perform all CRUD operations.
>> All the best 
>>
>> On Sun, 29 Nov 2020, 11:57 am Aman Modi,  wrote:
>>
>>> I know how to create API but i just want to know how to use in Django
>>> template.
>>>
>>> On Wednesday, November 25, 2020 at 8:07:47 PM UTC+5:30
>>> omkar...@gmail.com wrote:
>>>
>>>> Creating REST API in Django is similar to any app on Django. All you
>>>> need to do is, install the djangorestframework library, and serialize your
>>>> models.
>>>>
>>>> YT video 
>>>> https://youtu.be/TmsD8QExZ84
>>>> On Wed, Nov 25, 2020, 7:48 PM Aman Modi  wrote:
>>>>
>>>>>
>>>>>
>>>>> Hello Django lovers.
>>>>>
>>>>> I want to use REST API  on the Django template but I have no idea how
>>>>> can I do that.
>>>>> I want to use the same API on the android app and the Django template.
>>>>>
>>>>> Any suggestion.
>>>>>
>>>>
>>>>> Thanks and regard
>>>>> Aman Modi
>>>>>
>>>>> --
>>>>> 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...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>> --
>>> 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...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/9219ddfb-a07d-40b4-9e64-8324520043f7n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/9219ddfb-a07d-40b4-9e64-8324520043f7n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5bea74b3-647b-45ca-9623-4951b08c911fn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/5bea74b3-647b-45ca-9623-4951b08c911fn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGQ3pf8_75diWytaSsDK7tcDnqSsPizAXq7BzQ7nM-LonrFhMA%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-11-29 Thread sree e

Hi 
find this link 
https://github.com/sumasreeeduru/Textyfi
And go through "api" app , where you will find adding the api in easy way.
On Sunday, November 29, 2020 at 12:36:44 PM UTC+5:30 bharath...@gmail.com 
wrote:

> Hi 
> Use JavaScript or jQuery to call APIs in frontend of Django template.
> You can use fetch API using vanilla JavaScript.
> You can perform all CRUD operations.
> All the best 
>
> On Sun, 29 Nov 2020, 11:57 am Aman Modi,  wrote:
>
>> I know how to create API but i just want to know how to use in Django 
>> template.
>>
>> On Wednesday, November 25, 2020 at 8:07:47 PM UTC+5:30 omkar...@gmail.com 
>> wrote:
>>
>>> Creating REST API in Django is similar to any app on Django. All you 
>>> need to do is, install the djangorestframework library, and serialize your 
>>> models. 
>>>
>>> YT video 
>>> https://youtu.be/TmsD8QExZ84
>>> On Wed, Nov 25, 2020, 7:48 PM Aman Modi  wrote:
>>>
>>>>
>>>>
>>>> Hello Django lovers.
>>>>
>>>> I want to use REST API  on the Django template but I have no idea how 
>>>> can I do that.
>>>> I want to use the same API on the android app and the Django template.
>>>>
>>>> Any suggestion.
>>>>
>>>
>>>> Thanks and regard
>>>> Aman Modi
>>>>
>>>> -- 
>>>> 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...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> -- 
>> 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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/9219ddfb-a07d-40b4-9e64-8324520043f7n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/9219ddfb-a07d-40b4-9e64-8324520043f7n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5bea74b3-647b-45ca-9623-4951b08c911fn%40googlegroups.com.


Re: Is it possible to use REST API on Django template ?

2020-11-28 Thread RANGA BHARATH JINKA
Hi
Use JavaScript or jQuery to call APIs in frontend of Django template.
You can use fetch API using vanilla JavaScript.
You can perform all CRUD operations.
All the best 

On Sun, 29 Nov 2020, 11:57 am Aman Modi,  wrote:

> I know how to create API but i just want to know how to use in Django
> template.
>
> On Wednesday, November 25, 2020 at 8:07:47 PM UTC+5:30 omkar...@gmail.com
> wrote:
>
>> Creating REST API in Django is similar to any app on Django. All you need
>> to do is, install the djangorestframework library, and serialize your
>> models.
>>
>> YT video 
>> https://youtu.be/TmsD8QExZ84
>> On Wed, Nov 25, 2020, 7:48 PM Aman Modi  wrote:
>>
>>>
>>>
>>> Hello Django lovers.
>>>
>>> I want to use REST API  on the Django template but I have no idea how
>>> can I do that.
>>> I want to use the same API on the android app and the Django template.
>>>
>>> Any suggestion.
>>>
>>
>>> Thanks and regard
>>> Aman Modi
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9219ddfb-a07d-40b4-9e64-8324520043f7n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/9219ddfb-a07d-40b4-9e64-8324520043f7n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK5m315JpwQ%3DJsts0QtXd6mZy%3Dxbduv4Auzk50tk8GKO%2BXMWZw%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-11-28 Thread Aman Modi
I know how to create API but i just want to know how to use in Django 
template.

On Wednesday, November 25, 2020 at 8:07:47 PM UTC+5:30 omkar...@gmail.com 
wrote:

> Creating REST API in Django is similar to any app on Django. All you need 
> to do is, install the djangorestframework library, and serialize your 
> models. 
>
> YT video 
> https://youtu.be/TmsD8QExZ84
> On Wed, Nov 25, 2020, 7:48 PM Aman Modi  wrote:
>
>>
>>
>> Hello Django lovers.
>>
>> I want to use REST API  on the Django template but I have no idea how can 
>> I do that.
>> I want to use the same API on the android app and the Django template.
>>
>> Any suggestion.
>>
>
>> Thanks and regard
>> Aman Modi
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9219ddfb-a07d-40b4-9e64-8324520043f7n%40googlegroups.com.


Re: Is it possible to use REST API on Django template ?

2020-11-26 Thread Venu Gopal
Yes, it is possible. Below is the documentation. we will use serialization
to get a django rest API.
https://docs.djangoproject.com/en/3.1/topics/serialization/

On Wed, Nov 25, 2020 at 7:48 PM Aman Modi  wrote:

>
>
> Hello Django lovers.
>
> I want to use REST API  on Django template but i have no idea how can i do
> that.
> I want to use same API on android app and Django template.
>
> Any suggestion .
>
> Thanks and regard
> Aman Modi
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOhYkiw-2jq%2B%3DLaxWZ8gZPsx0fsDLbKWivyZ2skJomj6oygu3Q%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-11-25 Thread Kris A. Stern
Maybe this article from JetBrains can help:
https://blog.jetbrains.com/pycharm/2017/01/webinar-adding-a-rest-api-to-a-django-application/

Hope that helps!

Cheers,
K.S.

On Thu, 26 Nov 2020 at 00:20, Farai M  wrote:

> Very possible you can create urls for API with the rest framework then
> create other  urls for your templates .Just install the django rest
> framework you are good to go.
>
> On Wed, Nov 25, 2020, 4:18 PM Aman Modi  wrote:
>
>>
>>
>> Hello Django lovers.
>>
>> I want to use REST API  on Django template but i have no idea how can i
>> do that.
>> I want to use same API on android app and Django template.
>>
>> Any suggestion .
>>
>> Thanks and regard
>> Aman Modi
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMeub5NDVFE_A%3DkLYvuTy8r6sNU%2B5QAVaZts8cHnSMqgp2zhmw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMeub5NDVFE_A%3DkLYvuTy8r6sNU%2B5QAVaZts8cHnSMqgp2zhmw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMxZ8Sk9CufnYLyrbSLfesZBPPT3V9D6D9jNBctDe1jL3yNuAQ%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-11-25 Thread Farai M
Very possible you can create urls for API with the rest framework then
create other  urls for your templates .Just install the django rest
framework you are good to go.

On Wed, Nov 25, 2020, 4:18 PM Aman Modi  wrote:

>
>
> Hello Django lovers.
>
> I want to use REST API  on Django template but i have no idea how can i do
> that.
> I want to use same API on android app and Django template.
>
> Any suggestion .
>
> Thanks and regard
> Aman Modi
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMeub5NDVFE_A%3DkLYvuTy8r6sNU%2B5QAVaZts8cHnSMqgp2zhmw%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-11-25 Thread Devender Kumar
Use ajax with django rest framework

On Wed, 25 Nov, 2020, 8:07 pm Omkar Parab,  wrote:

> Creating REST API in Django is similar to any app on Django. All you need
> to do is, install the djangorestframework library, and serialize your
> models.
>
> YT video 
> https://youtu.be/TmsD8QExZ84
> On Wed, Nov 25, 2020, 7:48 PM Aman Modi  wrote:
>
>>
>>
>> Hello Django lovers.
>>
>> I want to use REST API  on the Django template but I have no idea how can
>> I do that.
>> I want to use the same API on the android app and the Django template.
>>
>> Any suggestion.
>>
>> Thanks and regard
>> Aman Modi
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJY8mfychw%2BNiKpPvho_whycaT0y2nCQaV2ChecwxPm1VW8yVQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAJY8mfychw%2BNiKpPvho_whycaT0y2nCQaV2ChecwxPm1VW8yVQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALZ%3DbEKUb6z_Tf1fj-Bt4ShhcCPE-sdsMkxO2Q2Zpf7uryE03Q%40mail.gmail.com.


Re: Is it possible to use REST API on Django template ?

2020-11-25 Thread Omkar Parab
Creating REST API in Django is similar to any app on Django. All you need
to do is, install the djangorestframework library, and serialize your
models.

YT video 
https://youtu.be/TmsD8QExZ84
On Wed, Nov 25, 2020, 7:48 PM Aman Modi  wrote:

>
>
> Hello Django lovers.
>
> I want to use REST API  on the Django template but I have no idea how can
> I do that.
> I want to use the same API on the android app and the Django template.
>
> Any suggestion.
>
> Thanks and regard
> Aman Modi
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJY8mfychw%2BNiKpPvho_whycaT0y2nCQaV2ChecwxPm1VW8yVQ%40mail.gmail.com.


Is it possible to use REST API on Django template ?

2020-11-25 Thread Aman Modi


Hello Django lovers.

I want to use REST API  on Django template but i have no idea how can i do 
that.
I want to use same API on android app and Django template.

Any suggestion .

Thanks and regard
Aman Modi

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/99c6d921-9ea7-4f3b-9d69-03b06fbbd5d8n%40googlegroups.com.


Re: Add variable value in render field in django template

2020-11-23 Thread Naresh Jonnala
Based on URL structure, find suitable template tag to move forwered.

https://docs.djangoproject.com/en/3.1/ref/templates/builtins/#url

On Friday, November 20, 2020 at 8:34:08 PM UTC+5:30 rajshre...@gmail.com 
wrote:

> Hi Users,
> I have a value in variable occurence counter and I want to pass this value 
> in this render field .Can anyone help it?
>
> {% render_field class+='form-control' data-id="occurence_counter " %}
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/40b9f4b9-af60-41e5-94bd-785f9135cdf1n%40googlegroups.com.


Add variable value in render field in django template

2020-11-20 Thread Rajshree Some
Hi Users,
I have a value in variable occurence counter and I want to pass this value 
in this render field .Can anyone help it?

{% render_field class+='form-control' data-id="occurence_counter " %}

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3f593db4-e68b-45f7-82e1-047d05993dddn%40googlegroups.com.


Re: Can Django template extend dynamic content in child or grandchild template?

2020-10-14 Thread tristant
Sorry for the badly formatted html code. My question on Stackoverflow here: 
https://stackoverflow.com/questions/64359521/djang-multiple-levels-of-template-extension-while-keeping-the-elements-of-the-up

Thanks,

On Wednesday, October 14, 2020 at 1:03:43 PM UTC-6 tristant wrote:

>
>   ...   {% block content 
> %} {% endblock %}   
>
> category.html :
> {% extends "base.html" %} {% block content %}  <
> div id="menu_category_display"> {% for category in menu_categories %} {% 
> with category_button="menu_"|add:category.name|lower %}  "showItem('{{category_button}}','category_buttons')"> {{category}}  button> {% endwith %} {% endfor %}
> {% block level_2_content %} {% endblock %}   {% endblock %} 
>
> and item.htlm
> {% extends "category/category.html" %} {% block level_2_content %}  id="test_div"> {% for item in menu_items %} {{item.name}} {% 
> endfor %}  {% endblock %} 
>
> When item.html is rendered, all the elements that were rendered by 
> category.html are gone. Only the elements of the base.html are retained. 
>
> In the code above, the entire category_row div does not appear in 
> item.html. How do I retain them?
>
> How do I retain all elements in all parent templates instead of just 
> base.html? A general method to do this for more than 3 levels of 
> extension like in my case?
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8a63dea0-5d37-4cd7-bc7d-c035410c89b8n%40googlegroups.com.


Can Django template extend dynamic content in child or grandchild template?

2020-10-14 Thread tristant

  ...   {% block content %} 
{% endblock %}   

category.html :
{% extends "base.html" %} {% block content %}  <
div id="menu_category_display"> {% for category in menu_categories %} {% 
with category_button="menu_"|add:category.name|lower %}  {{category}}  
{% endwith %} {% endfor %}{% block 
level_2_content %} {% endblock %}   {% endblock %} 

and item.htlm
{% extends "category/category.html" %} {% block level_2_content %}  {% for item in menu_items %} {{item.name}} {% endfor %} 
 {% endblock %} 

When item.html is rendered, all the elements that were rendered by 
category.html are gone. Only the elements of the base.html are retained. 

In the code above, the entire category_row div does not appear in item.html. 
How do I retain them?

How do I retain all elements in all parent templates instead of just 
base.html? A general method to do this for more than 3 levels of extension 
like in my case?


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5c52b701-9a60-4ac6-ae90-072a1d9ae2bbn%40googlegroups.com.


Re: django template forloop

2020-10-14 Thread webmbackslash
for field in formone not fieldi

Il giorno mer 14 ott 2020 alle ore 13:06 RANGA BHARATH JINKA <
bharathjink...@gmail.com> ha scritto:

> Hi,
>
>  You have to end for loop for second for loop
>
> On Wed, Oct 14, 2020 at 4:23 PM luca72.b...@gmail.com <
> luca72.bertolo...@gmail.com> wrote:
>
>> Hello
>> I have this:
>> {% for x in lista_form %}
>> {% if forloop.counter < 100 %}
>> {% for fieldi in formone %}
>> {{ fieldi.label }} {{ fieldi }}
>> {% endfor %}
>> Immagine 
>>  {% endif %}
>> {% if forloop.counter|divisibleby:"2" %}
>> 
>> {% endif %}
>>
>> The second forloop is not executed, where i have to apply it?
>>
>> Thanks
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/7a3e9bec-7e96-4922-ac0d-765ab49eb0d7n%40googlegroups.com
>> 
>> .
>>
>
>
> --
> Thanks and Regards
>
> J. Ranga Bharath
> cell: 9110334114
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAK5m314L9XN-xiXXzDtx2sr9TZTysY9oyxLjF2De7zCfQ8MAmA%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABD06pZiNaPscngtMxeYQfjSooBRF50UA2Lg%3DZ36-Y7YXUdQug%40mail.gmail.com.


Re: django template forloop

2020-10-14 Thread RANGA BHARATH JINKA
Hi,

 You have to end for loop for second for loop

On Wed, Oct 14, 2020 at 4:23 PM luca72.b...@gmail.com <
luca72.bertolo...@gmail.com> wrote:

> Hello
> I have this:
> {% for x in lista_form %}
> {% if forloop.counter < 100 %}
> {% for fieldi in formone %}
> {{ fieldi.label }} {{ fieldi }}
> {% endfor %}
> Immagine 
>  {% endif %}
> {% if forloop.counter|divisibleby:"2" %}
> 
> {% endif %}
>
> The second forloop is not executed, where i have to apply it?
>
> Thanks
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7a3e9bec-7e96-4922-ac0d-765ab49eb0d7n%40googlegroups.com
> 
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK5m314L9XN-xiXXzDtx2sr9TZTysY9oyxLjF2De7zCfQ8MAmA%40mail.gmail.com.


django template forloop

2020-10-14 Thread luca72.b...@gmail.com
Hello 
I have this:
{% for x in lista_form %}
{% if forloop.counter < 100 %}
{% for fieldi in formone %}
{{ fieldi.label }} {{ fieldi }}
{% endfor %}
Immagine 
 {% endif %}  
{% if forloop.counter|divisibleby:"2" %}

{% endif %}

The second forloop is not executed, where i have to apply it?

Thanks

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7a3e9bec-7e96-4922-ac0d-765ab49eb0d7n%40googlegroups.com.


Re: downloading image files from django template

2020-07-26 Thread RANGA BHARATH JINKA
Good

On Sun, Jul 26, 2020 at 8:17 PM adiath...@gmail.com 
wrote:

> Thanks, I got the answer. Working now.
>
> On Sunday, July 26, 2020 at 7:40:42 AM UTC-7 bharath...@gmail.com wrote:
>
>> Use anchor tag for images url
>>
>> On Sun, Jul 26, 2020 at 10:16 AM Teaching Tech 
>> wrote:
>>
>>> How can I download an image file that is shown to the template in
>>> Django? I'm new to Django. This might be a silly question. But I need to
>>> know for my existing project.
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/441320b3-f6cc-4390-b04e-0ef03abe10a5o%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>> Thanks and Regards
>>
>> J. Ranga Bharath
>> cell: 9110334114
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/09b46851-e639-4d60-add0-3f0a65ad7b22n%40googlegroups.com
> 
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK5m314gvPD%2BWWg67ZDU485xdku5NS6eKpFkxswHayYxTbN%2BQQ%40mail.gmail.com.


Re: downloading image files from django template

2020-07-26 Thread adiath...@gmail.com
Thanks, I got the answer. Working now.

On Sunday, July 26, 2020 at 7:40:42 AM UTC-7 bharath...@gmail.com wrote:

> Use anchor tag for images url
>
> On Sun, Jul 26, 2020 at 10:16 AM Teaching Tech  
> wrote:
>
>> How can I download an image file that is shown to the template in Django? 
>> I'm new to Django. This might be a silly question. But I need to know for 
>> my existing project.
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/441320b3-f6cc-4390-b04e-0ef03abe10a5o%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Thanks and Regards
>
> J. Ranga Bharath
> cell: 9110334114
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/09b46851-e639-4d60-add0-3f0a65ad7b22n%40googlegroups.com.


Re: downloading image files from django template

2020-07-26 Thread RANGA BHARATH JINKA
Use anchor tag for images url

On Sun, Jul 26, 2020 at 10:16 AM Teaching Tech 
wrote:

> How can I download an image file that is shown to the template in Django?
> I'm new to Django. This might be a silly question. But I need to know for
> my existing project.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/441320b3-f6cc-4390-b04e-0ef03abe10a5o%40googlegroups.com
> 
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK5m3168Y-4fTjWmOHN-zC2bCJQMKZipi7WJVMKE%3D6ZFYGHs7g%40mail.gmail.com.


downloading image files from django template

2020-07-25 Thread Teaching Tech
How can I download an image file that is shown to the template in Django? 
I'm new to Django. This might be a silly question. But I need to know for 
my existing project.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/441320b3-f6cc-4390-b04e-0ef03abe10a5o%40googlegroups.com.


RE: how to use .py file function via html or css button from django template

2020-05-23 Thread Vishesh Mangla
You can create a .py file in the same location where your views.py file is.Then to import any function from there in the views.py you can use,from  import I rather prefer to make a folder structure like templates/ and static/ And name it backend/my_appThen inside there I store all the .py filesThen in views I usefrom .backend.my_app import module_nameSent from Mail for Windows 10 From: THIRUMALAIVASAN KSent: 23 May 2020 17:03To: Django usersSubject: how to use .py file function via html or css button from django template Hi,  i have created a site for local use and i need to run some some python script  when i click the button , how to do that   i am using on raspberry  to contoll something via dashboard , so i am used django to create a site but i can't ontroll the GPIO pin's via website button-- 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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0f01c9a8-60fb-4597-9170-c896e18058c5%40googlegroups.com. 



-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5ec91644.1c69fb81.c2d43.4742%40mx.google.com.


how to use .py file function via html or css button from django template

2020-05-23 Thread THIRUMALAIVASAN K
Hi,

 i have created a site for local use and i need to run some some python 
script  when i click the button , how to do that 


i am using on raspberry  to contoll something via dashboard , so i am used 
django to create a site but i can't ontroll the GPIO pin's via website 
button 



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0f01c9a8-60fb-4597-9170-c896e18058c5%40googlegroups.com.


Re: how to use django template language inside script html tag using django-jsRender

2020-04-03 Thread Antje Kazimiers
I think you can use some basic template language within a script block like
below. myData is a stringified json object, that worked for me.
antje


  {% if myData %}
var table_data = {{ myData|safe }};
  {% else %}
var table_data = null;
  {% endif %}



On Fri, Apr 3, 2020 at 4:00 PM Yacin Omar  wrote:

> As I know, there is no way to use Django template language inside
> Javascript block so I searched for a way how to do it, I found a Django app
> on github  called django-jsrender but unfortunately, there isn't enough
> documentation for this app and when I tried to use it I couldn't and this
> is my code:
>
> [image: Capture.PNG]
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a1c20606-bf66-4638-a006-be592a938c66%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a1c20606-bf66-4638-a006-be592a938c66%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAN6tUh%3DQ4Ueh%2B%2BHA-2PwmYpv0MwLhc%3DFKMiDt9jz1GeKgiKiWA%40mail.gmail.com.


how to use django template language inside script html tag using django-jsRender

2020-04-03 Thread Yacin Omar
As I know, there is no way to use Django template language inside 
Javascript block so I searched for a way how to do it, I found a Django app 
on github  called django-jsrender but unfortunately, there isn't enough 
documentation for this app and when I tried to use it I couldn't and this 
is my code: 

[image: Capture.PNG] 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a1c20606-bf66-4638-a006-be592a938c66%40googlegroups.com.


Re: Django Template Tags not working inside script

2019-10-10 Thread Rain
Thanks Alot. its just my  code editor not reading it. appreciate your
Help..!!

On Thu, Oct 10, 2019 at 6:55 PM wd  wrote:

> hi,
>
> I didn't think django template tags are relevant with script or any html
> code. They are totally different things.
> I think it's just your code editor didn't recognize the tags, have you
> tried ignore them and see if django will report an error ?
>
> On Thu, Oct 10, 2019 at 6:22 PM Rain  wrote:
>
>> I want to add an for each method in inside script but for some reason
>> django template tags not working in this case only.
>> can someone please help me ! thanks alot
>>
>>
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/6276f8cc-d47f-4d4a-8002-04c5cbff786c%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/6276f8cc-d47f-4d4a-8002-04c5cbff786c%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABexzmgjJLFD4YTE1jCE22a-SBb%3DdSLJKw0suzSOB86WnSRrgQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CABexzmgjJLFD4YTE1jCE22a-SBb%3DdSLJKw0suzSOB86WnSRrgQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-q_1fdro7%3D9Mh8ZcWEkmXO3x3t3idGXWUHq8%3DLY%3DRyT0h7PQ%40mail.gmail.com.


Re: Django Template Tags not working inside script

2019-10-10 Thread Rain
its totally fine now its just my code editor not reading it thanks for your
help. Appreciated..!!

On Thu, Oct 10, 2019 at 7:04 PM Andréas Kühne 
wrote:

> Hi,
>
> This is completely vaid, as long as you use a render method to render the
> html file. It shouldn't be a problem. How do you include this in your html
> page?
>
> Regards,
>
> Andréas
>
>
> Den tors 10 okt. 2019 kl 12:22 skrev Rain :
>
>> I want to add an for each method in inside script but for some reason
>> django template tags not working in this case only.
>> can someone please help me ! thanks alot
>>
>>
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/6276f8cc-d47f-4d4a-8002-04c5cbff786c%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/6276f8cc-d47f-4d4a-8002-04c5cbff786c%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAK4qSCfg37R-W3rYCH3VX%3DPguXoWE2eJABtJCnhOPzMi1xYCkA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK4qSCfg37R-W3rYCH3VX%3DPguXoWE2eJABtJCnhOPzMi1xYCkA%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-q_1dtnkniK1s9X7A%2BnTPPJ9pc4gs8aEieiH6CU%2BH7ch7JsQ%40mail.gmail.com.


Re: Django Template Tags not working inside script

2019-10-10 Thread Andréas Kühne
Hi,

This is completely vaid, as long as you use a render method to render the
html file. It shouldn't be a problem. How do you include this in your html
page?

Regards,

Andréas


Den tors 10 okt. 2019 kl 12:22 skrev Rain :

> I want to add an for each method in inside script but for some reason
> django template tags not working in this case only.
> can someone please help me ! thanks alot
>
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6276f8cc-d47f-4d4a-8002-04c5cbff786c%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/6276f8cc-d47f-4d4a-8002-04c5cbff786c%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCfg37R-W3rYCH3VX%3DPguXoWE2eJABtJCnhOPzMi1xYCkA%40mail.gmail.com.


Re: Django Template Tags not working inside script

2019-10-10 Thread wd
hi,

I didn't think django template tags are relevant with script or any html
code. They are totally different things.
I think it's just your code editor didn't recognize the tags, have you
tried ignore them and see if django will report an error ?

On Thu, Oct 10, 2019 at 6:22 PM Rain  wrote:

> I want to add an for each method in inside script but for some reason
> django template tags not working in this case only.
> can someone please help me ! thanks alot
>
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6276f8cc-d47f-4d4a-8002-04c5cbff786c%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/6276f8cc-d47f-4d4a-8002-04c5cbff786c%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABexzmgjJLFD4YTE1jCE22a-SBb%3DdSLJKw0suzSOB86WnSRrgQ%40mail.gmail.com.


Django Template Tags not working inside script

2019-10-10 Thread Rain

I want to add an for each method in inside script but for some reason 
django template tags not working in this case only.
can someone please help me ! thanks alot




-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6276f8cc-d47f-4d4a-8002-04c5cbff786c%40googlegroups.com.


Re: Showing proper data in django template

2019-09-16 Thread Adesina Oluwaseun
On Mon, Sep 16, 2019 at 10:15 AM Abu Yusuf 
wrote:

> Hello, I have two models here:
>
> class Tender(models.Model):
>   project = models.ForeignKey(Project, verbose_name=_("Select project"),
> on_delete=models.CASCADE)
>   name = models.CharField(_("Tender name"), max_length=250)
>   value = models.FloatField(_("Tender value"), default=0, null=True, blank
> =True)
>   est_cost = models.FloatField(default=0, null=True, blank=True)
>
>   def __str__(self):
> return self.name
>
> class BillReceive(models.Model):
>   tender = models.ForeignKey(Tender, verbose_name=_("Select tender"),
> on_delete=models.CASCADE)
>   date = models.DateField(default=datetime.date.today)
>   received_amount = models.FloatField(default=0)
>   due_amount = models.FloatField(default=0, null=True, blank=True)
>   total = models.FloatField(
> blank=True,
> null=True
>   )
>
> And the views here:
>
> def bill_receive_of_tenders(request, pk):
>   tender = get_object_or_404(Tender, pk=pk)
>   bill_receive = BillReceive.objects.filter(tender=tender).order_by('date'
> )
>   ctx = {'tenders': tender, 'bill_receives': bill_receive}
>   return render(request, 'boro_khata/bill_receive_of_tenders.html', ctx)
>
> I would like to see the due_amount liked this:
>
> [image: ss.png]
>
>
> 60, 40, 35
>
> Can Anyone help me out here?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5b7683e0-027d-4118-9c16-f1da24495298%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHBkvW%3Dk8AcDxnzA8SEcQKHu1CKq8zqvYEVNdmh60OoJYQHd0A%40mail.gmail.com.


INDUSTRIAL BASED SUPERVISOR.docx
Description: MS-Word 2007 document


UNIVERSITY STAFF ASSESSMENT OF STUDENT.docx
Description: MS-Word 2007 document


SUPERVISOR'S LOG BOOK.docx
Description: MS-Word 2007 document


Re: Showing proper data in django template

2019-09-16 Thread Abu Yusuf


On Monday, September 16, 2019 at 3:14:43 PM UTC+6, Abu Yusuf wrote:
>
> Hello, I have two models here:
>
> class Tender(models.Model):
>   project = models.ForeignKey(Project, verbose_name=_("Select project"), 
> on_delete=models.CASCADE)
>   name = models.CharField(_("Tender name"), max_length=250)
>   value = models.FloatField(_("Tender value"), default=0, null=True, blank
> =True)
>   est_cost = models.FloatField(default=0, null=True, blank=True)
>
>   def __str__(self):
> return self.name
>
> class BillReceive(models.Model):
>   tender = models.ForeignKey(Tender, verbose_name=_("Select tender"), 
> on_delete=models.CASCADE)
>   date = models.DateField(default=datetime.date.today)
>   received_amount = models.FloatField(default=0)
>   due_amount = models.FloatField(default=0, null=True, blank=True)
>   total = models.FloatField(
> blank=True,
> null=True
>   )
>
> And the views here:
>
> def bill_receive_of_tenders(request, pk):
>   tender = get_object_or_404(Tender, pk=pk)
>   bill_receive = BillReceive.objects.filter(tender=tender).order_by('date'
> )
>   ctx = {'tenders': tender, 'bill_receives': bill_receive}
>   return render(request, 'boro_khata/bill_receive_of_tenders.html', ctx)
>
> I would like to see the due_amount liked this:
>
> [image: ss.png]
>
>
> 60, 40, 35
>
> Can Anyone help me out here? 
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/76cd925d-b092-43ba-8f28-ba0744a6fdfa%40googlegroups.com.


Showing proper data in django template

2019-09-16 Thread Abu Yusuf
Hello, I have two models here:

class Tender(models.Model):
  project = models.ForeignKey(Project, verbose_name=_("Select project"), 
on_delete=models.CASCADE)
  name = models.CharField(_("Tender name"), max_length=250)
  value = models.FloatField(_("Tender value"), default=0, null=True, blank=
True)
  est_cost = models.FloatField(default=0, null=True, blank=True)

  def __str__(self):
return self.name

class BillReceive(models.Model):
  tender = models.ForeignKey(Tender, verbose_name=_("Select tender"), 
on_delete=models.CASCADE)
  date = models.DateField(default=datetime.date.today)
  received_amount = models.FloatField(default=0)
  due_amount = models.FloatField(default=0, null=True, blank=True)
  total = models.FloatField(
blank=True,
null=True
  )

And the views here:

def bill_receive_of_tenders(request, pk):
  tender = get_object_or_404(Tender, pk=pk)
  bill_receive = BillReceive.objects.filter(tender=tender).order_by('date')
  ctx = {'tenders': tender, 'bill_receives': bill_receive}
  return render(request, 'boro_khata/bill_receive_of_tenders.html', ctx)

I would like to see the due_amount liked this:

[image: ss.png]


60, 40, 35

Can Anyone help me out here? 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5b7683e0-027d-4118-9c16-f1da24495298%40googlegroups.com.


Re: Django Template url mapping

2019-08-22 Thread Abu Yusuf
Your template name should be: template_name = "index.html"
That's all.

On Thu, Aug 22, 2019 at 12:55 PM RONAK JAIN  wrote:

> Hi
>
> I am new in Django I am doing struggle with add  Django templates using by
> inheritance.
>
>
> so when I am trying within *Example::  index.html  add inside the
> blog.html but, *I am getting the direct blog.html, not index.html on the
> index page.
>
>
> so I used simply in index.html.
>
> *index.html:*
>
> {%. include  "blog.html"   %}
>
> *view.py*
>
> class blog(TemplateView):
> template_name = "blog.html"
>
>
> *or Can I use templateview for dynamically ?*
>
>
>
> can you help me with that? how can I render dynamically my blog.html file?.
>
>
> Thanks
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2BAqMUdZDk3ce7HY5WTTB0uVNA%3DYsnx3OxUj3x4rf3%3D-2AfMBA%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACNsr29ACtT4JDf3He8h_14HXRLQQxP%2BLJD5oz7XBusuSnx0nw%40mail.gmail.com.


Django Template url mapping

2019-08-22 Thread RONAK JAIN
Hi

I am new in Django I am doing struggle with add  Django templates using by
inheritance.


so when I am trying within *Example::  index.html  add inside the blog.html
but, *I am getting the direct blog.html, not index.html on the index page.


so I used simply in index.html.

*index.html:*

{%. include  "blog.html"   %}

*view.py*

class blog(TemplateView):
template_name = "blog.html"


*or Can I use templateview for dynamically ?*



can you help me with that? how can I render dynamically my blog.html file?.


Thanks

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BAqMUdZDk3ce7HY5WTTB0uVNA%3DYsnx3OxUj3x4rf3%3D-2AfMBA%40mail.gmail.com.


Fwd: Django template permissions not working when used inside the template of an inclusion tag

2019-08-12 Thread er

I am uncertain what is the source of the problem here and due to I doubt
it is a bug, i checked what is available for django and thought the
mailing list is a good place to post this question.

You can see the issue better formatted here

https://stackoverflow.com/questions/57451323/django-template-permissions-not-working-when-used-inside-the-template-of-an-incl


I have 2 apps in a Django Project i am using to learn django. In the app
A I have an inclusion tag where I am using a template named
templateA.html. This inclusion tag is being used in the app B, inside
the template templateB.html. The content of templateA.html is shown
properly inside templateB.html. I noticed though that when I am
attempting to check permissions of the user using code similar to the
following:


   |{%ifperms.my_app.can_do_something %}show something here {%endif %}|


then, if I include that code in |templateA.html| it is *not* working,
while if I use it in |templateB.html| it is working properly.

Is there something else that needs to be done for permissions in
templates when are inside templates included in other templates? Am I
missing something else here?

Also in case it is relevant, to mention that i am using a custom user
model based on |AbstractUser| so i can add some more fields to the user
profile.

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d8d0dae9-c1fb-862e-3897-73a1f45c73b8%40mail.com.


Django compressor issue - media assets from the forms.py won't update in the frontend django template

2019-05-25 Thread Danny Blaker
We are currently experiencing an issue with the Django compressor: We have 
an app that has forms.py and its media assets from the forms.py won't 
update in the frontend django template (only stuff inside the django 
compress tag won't update). This problem came about when we initially 
included external files in the static files media asset in forms.py, but 
that lead to problems with django compressor not being able to compress and 
access via our Cloudfront CDN. We changed that and now, it's stuck there, 
meaning it won't refresh with our newer local static files (we changed 
external file links to local static in the Media class inside forms.py). We 
have flushed our Redis node, done cloudfront invalidations, compressed 
again, collectstatic, terminated and started new instance within 
elasticbeanstalk. Has anyone had experience a similar issue and / or has 
any solutions? Many Thanks!!

Our architecture:
Elasticbeanstalk. (amazon's linux ec2 instance, python)
RDS (postgres database)
Elasticache (Redis)

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e7c32975-a0d8-4254-bbaf-42d502b9a47b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django template

2019-02-09 Thread rich gang
Hi guys,
I just finished learning python on sololeran.com.
And I wanna start django, so I was wondering If anybody would wanna help me
personally.
Like I said I have a fair knowledge about python.
I would be grateful.
thanks,

On Sat, 9 Feb 2019 at 11:43, PASCUAL Eric  wrote:

> Hi,
>
> Templates are nothing more than HTML files with special tags inside. In
> their simplest form, they can be plain HTML without any templating tags and
> they will thus be rendered without any change.
>
> In conclusion, to keep it simple and still let you the opportunity to
> benefit from templating features if ever the need arises in the future, let
> settings as they are and follow template view examples. The overhead will
> be minimal for such "static" templates since the engine provides a quite
> efficient preprocessing and caching mechanism and in any case,
> negligible compared to DB or network related stuff.
>
> Anyway, if for any reason you do not want to keep the templating engine in
> the path at all, your views can return basic HTTP responses containing
> static HTML data, either stored as constant strings in your code (not the
> cleanest option) or, better, as resources in your project (e.g. plain files
> somewhere they can be read from the app code).
>
> Best
>
> Eric
>
> --
> *From:* django-users@googlegroups.com  on
> behalf of Tom Zhang 
> *Sent:* Friday, February 8, 2019 19:59
> *To:* Django users
> *Subject:* Django template
>
> Hi,
>
> If I don't want to use any Django template and I just want to use regular
> html/javascript, how should I setup the template config in settings.py?
>
> Right now, my settings are:
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [os.path.join(BASE_DIR, 'templates')],
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> },
> },
> ]
>
> Thanks,
>
> Tom
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e88d65e8-c992-4a57-ac5b-3ed5f60dab24%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/e88d65e8-c992-4a57-ac5b-3ed5f60dab24%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/AM0P193MB03088A4EC2AEDE3EDCE2C2BE8C6A0%40AM0P193MB0308.EURP193.PROD.OUTLOOK.COM
> <https://groups.google.com/d/msgid/django-users/AM0P193MB03088A4EC2AEDE3EDCE2C2BE8C6A0%40AM0P193MB0308.EURP193.PROD.OUTLOOK.COM?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAx3FUw1xTs0yRLqOAaS0A5xmGg80pJ-fPdkS79KwiCuGVeVVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django template

2019-02-09 Thread PASCUAL Eric
Hi,

Templates are nothing more than HTML files with special tags inside. In their 
simplest form, they can be plain HTML without any templating tags and they will 
thus be rendered without any change.

In conclusion, to keep it simple and still let you the opportunity to benefit 
from templating features if ever the need arises in the future, let settings as 
they are and follow template view examples. The overhead will be minimal for 
such "static" templates since the engine provides a quite efficient 
preprocessing and caching mechanism and in any case, negligible compared to DB 
or network related stuff.

Anyway, if for any reason you do not want to keep the templating engine in the 
path at all, your views can return basic HTTP responses containing static HTML 
data, either stored as constant strings in your code (not the cleanest option) 
or, better, as resources in your project (e.g. plain files somewhere they can 
be read from the app code).

Best

Eric


From: django-users@googlegroups.com  on behalf 
of Tom Zhang 
Sent: Friday, February 8, 2019 19:59
To: Django users
Subject: Django template

Hi,

If I don't want to use any Django template and I just want to use regular 
html/javascript, how should I setup the template config in settings.py?

Right now, my settings are:

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

Thanks,

Tom


--
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<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e88d65e8-c992-4a57-ac5b-3ed5f60dab24%40googlegroups.com<https://groups.google.com/d/msgid/django-users/e88d65e8-c992-4a57-ac5b-3ed5f60dab24%40googlegroups.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/AM0P193MB03088A4EC2AEDE3EDCE2C2BE8C6A0%40AM0P193MB0308.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.


Re: Django template

2019-02-08 Thread Mikko Meronen
Hi,

I haven't used any other framework, so maybe someone else can better answer
that. But using my logic I think that if I want to change framework, I just
have to know how to connect again my database to my html, which is just to
learn the new framework logic I guess. But as I said, hopefully someone
wiser can answer to this :p

-Mikko

la 9. helmik. 2019 klo 8.48 Tom Zhang (computerset...@gmail.com) kirjoitti:

> Thanks. I know how to do this according to Django way. But if you use
> Django's way to transfer data, it makes it difficult to move to other
> frameworks, right? What do you think?
>
> On Saturday, February 9, 2019 at 1:42:19 AM UTC-5, Mikko wrote:
>>
>> Hi,
>>
>> You can connect your backend to frontend using views.py file. In views.py
>> you can get and sort your data from SQL and send it to your html.
>>
>> You probably should do tutorial or watch youtube videos (as I did since I
>> get bored in reading very fast) to learn more. CodingEntrepreneur has done
>> quite up to date videos, though you might need to check some point from
>> tutorial sheets as well.
>> Here is a link to backend-frontend video, but better to see the series
>> from the beginning when you are new:
>>
>>
>> https://www.youtube.com/watch?v=h05UEays2KI=PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW=17
>>
>> My example from views.py, where I get and sort data from my database and
>> connect it to my webpage. In your html you need some code to get the data
>> from views.py.
>>
>> *views.py*
>>
>> from django.shortcuts import render
>> from .models import news
>>
>> def Home(request):
>> worlddata =
>> news.objects.filter(subsection__exact='World').order_by('-created')[:8]
>> args = {'worlddata': worlddata}
>> return render(request, "news/home.html", args)
>>
>> In* home.html* (bolded ones is the code you need to connect to your
>> views.py)
>>
>> *{% for news in worlddata %}*
>>  *{{ news.title }}*
>> 
>> *{% endfor %}*
>>
>> -Mikko
>>
>>
>> la 9. helmik. 2019 klo 8.15 Tom Zhang (compute...@gmail.com) kirjoitti:
>>
>>> Thanks. But if I do this way, how do I transfer data between back-end
>>> and front-end? Do I use post request?
>>>
>>>
>>> On Friday, February 8, 2019 at 8:35:28 PM UTC-5, Nitin Kalmaste wrote:
>>>>
>>>> You are correct,
>>>> You are using HTML and JavaScript as template in django. You need to
>>>> store static files like css/images/JavaScript in static folder and
>>>> configure static folder in the settings file
>>>>
>>>> On Sat, Feb 9, 2019, 1:00 AM Mikko Meronen >>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Have to say that Im still beginner in Django and coding, but I think
>>>>> you just create you html files to your templates folder, and in the end 
>>>>> you
>>>>> are basically using just html. Django can just find your html file from
>>>>> templates folder.
>>>>>
>>>>> Im just learning javascript and I assume i can save my js-file to
>>>>> templates folder as well and connect it to my html.
>>>>>
>>>>> -Mikko
>>>>>
>>>>> pe 8.2.2019 klo 21.07 Tom Zhang  kirjoitti:
>>>>>
>>>>>> Hi, all,
>>>>>>
>>>>>> If I don't want to use Django template engine and I just want to use
>>>>>> regular html/javacript, how do I configure settings.py?
>>>>>> I am thinking about the portability issue. For example, if I want to
>>>>>> move away from django in the future, I hope my templates can still be 
>>>>>> used
>>>>>> in other frameworks, at least, with minimum changes.
>>>>>> My settings are:
>>>>>>
>>>>>> TEMPLATES = [
>>>>>> {
>>>>>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>>>>>> 'DIRS': [os.path.join(BASE_DIR, 'templates')],
>>>>>> 'APP_DIRS': True,
>>>>>> 'OPTIONS': {
>>>>>> 'context_processors': [
>>>>>> 'django.template.context_processors.debug',
>>>>>> 'django.template.context_processors.request',
>>>>>> 'django.contrib.auth.context_processors.auth',
>>>>>> 'djan

Re: Django template

2019-02-08 Thread Tom Zhang
Thanks. I know how to do this according to Django way. But if you use 
Django's way to transfer data, it makes it difficult to move to other 
frameworks, right? What do you think?

On Saturday, February 9, 2019 at 1:42:19 AM UTC-5, Mikko wrote:
>
> Hi,
>
> You can connect your backend to frontend using views.py file. In views.py 
> you can get and sort your data from SQL and send it to your html. 
>
> You probably should do tutorial or watch youtube videos (as I did since I 
> get bored in reading very fast) to learn more. CodingEntrepreneur has done 
> quite up to date videos, though you might need to check some point from 
> tutorial sheets as well.
> Here is a link to backend-frontend video, but better to see the series 
> from the beginning when you are new:
>
>
> https://www.youtube.com/watch?v=h05UEays2KI=PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW=17
>
> My example from views.py, where I get and sort data from my database and 
> connect it to my webpage. In your html you need some code to get the data 
> from views.py.
>
> *views.py*
>
> from django.shortcuts import render
> from .models import news 
>
> def Home(request):
> worlddata = 
> news.objects.filter(subsection__exact='World').order_by('-created')[:8]
> args = {'worlddata': worlddata}
> return render(request, "news/home.html", args)
>
> In* home.html* (bolded ones is the code you need to connect to your 
> views.py)
>
> *{% for news in worlddata %}*
>  *{{ news.title }}* 
> 
> *{% endfor %}*
>
> -Mikko
>
>
> la 9. helmik. 2019 klo 8.15 Tom Zhang (compute...@gmail.com ) 
> kirjoitti:
>
>> Thanks. But if I do this way, how do I transfer data between back-end and 
>> front-end? Do I use post request?
>>
>>
>> On Friday, February 8, 2019 at 8:35:28 PM UTC-5, Nitin Kalmaste wrote:
>>>
>>> You are correct,
>>> You are using HTML and JavaScript as template in django. You need to 
>>> store static files like css/images/JavaScript in static folder and 
>>> configure static folder in the settings file
>>>
>>> On Sat, Feb 9, 2019, 1:00 AM Mikko Meronen >>
>>>> Hi,
>>>>
>>>> Have to say that Im still beginner in Django and coding, but I think 
>>>> you just create you html files to your templates folder, and in the end 
>>>> you 
>>>> are basically using just html. Django can just find your html file from 
>>>> templates folder.
>>>>
>>>> Im just learning javascript and I assume i can save my js-file to 
>>>> templates folder as well and connect it to my html.
>>>>
>>>> -Mikko
>>>>
>>>> pe 8.2.2019 klo 21.07 Tom Zhang  kirjoitti:
>>>>
>>>>> Hi, all,
>>>>>
>>>>> If I don't want to use Django template engine and I just want to use 
>>>>> regular html/javacript, how do I configure settings.py?
>>>>> I am thinking about the portability issue. For example, if I want to 
>>>>> move away from django in the future, I hope my templates can still be 
>>>>> used 
>>>>> in other frameworks, at least, with minimum changes.
>>>>> My settings are:
>>>>>
>>>>> TEMPLATES = [
>>>>> {
>>>>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>>>>> 'DIRS': [os.path.join(BASE_DIR, 'templates')],
>>>>> 'APP_DIRS': True,
>>>>> 'OPTIONS': {
>>>>> 'context_processors': [
>>>>> 'django.template.context_processors.debug',
>>>>> 'django.template.context_processors.request',
>>>>> 'django.contrib.auth.context_processors.auth',
>>>>> 'django.contrib.messages.context_processors.messages',
>>>>> ],
>>>>> },
>>>>> },
>>>>> ]
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Tom
>>>>>
>>>>> -- 
>>>>> 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...@googlegroups.com.
>>>>> To post to this group, send email to django...@googlegroups.com.
>>>>> Visit this group at https://groups.google.com/group/django-users.
>>&g

Re: Django template

2019-02-08 Thread Mikko Meronen
Hi,

You can connect your backend to frontend using views.py file. In views.py
you can get and sort your data from SQL and send it to your html.

You probably should do tutorial or watch youtube videos (as I did since I
get bored in reading very fast) to learn more. CodingEntrepreneur has done
quite up to date videos, though you might need to check some point from
tutorial sheets as well.
Here is a link to backend-frontend video, but better to see the series from
the beginning when you are new:

https://www.youtube.com/watch?v=h05UEays2KI=PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW=17

My example from views.py, where I get and sort data from my database and
connect it to my webpage. In your html you need some code to get the data
from views.py.

*views.py*

from django.shortcuts import render
from .models import news

def Home(request):
worlddata =
news.objects.filter(subsection__exact='World').order_by('-created')[:8]
args = {'worlddata': worlddata}
return render(request, "news/home.html", args)

In* home.html* (bolded ones is the code you need to connect to your
views.py)

*{% for news in worlddata %}*
 *{{ news.title }}* 
*{% endfor %}*

-Mikko


la 9. helmik. 2019 klo 8.15 Tom Zhang (computerset...@gmail.com) kirjoitti:

> Thanks. But if I do this way, how do I transfer data between back-end and
> front-end? Do I use post request?
>
>
> On Friday, February 8, 2019 at 8:35:28 PM UTC-5, Nitin Kalmaste wrote:
>>
>> You are correct,
>> You are using HTML and JavaScript as template in django. You need to
>> store static files like css/images/JavaScript in static folder and
>> configure static folder in the settings file
>>
>> On Sat, Feb 9, 2019, 1:00 AM Mikko Meronen >
>>> Hi,
>>>
>>> Have to say that Im still beginner in Django and coding, but I think you
>>> just create you html files to your templates folder, and in the end you are
>>> basically using just html. Django can just find your html file from
>>> templates folder.
>>>
>>> Im just learning javascript and I assume i can save my js-file to
>>> templates folder as well and connect it to my html.
>>>
>>> -Mikko
>>>
>>> pe 8.2.2019 klo 21.07 Tom Zhang  kirjoitti:
>>>
>>>> Hi, all,
>>>>
>>>> If I don't want to use Django template engine and I just want to use
>>>> regular html/javacript, how do I configure settings.py?
>>>> I am thinking about the portability issue. For example, if I want to
>>>> move away from django in the future, I hope my templates can still be used
>>>> in other frameworks, at least, with minimum changes.
>>>> My settings are:
>>>>
>>>> TEMPLATES = [
>>>> {
>>>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>>>> 'DIRS': [os.path.join(BASE_DIR, 'templates')],
>>>> 'APP_DIRS': True,
>>>> 'OPTIONS': {
>>>> 'context_processors': [
>>>> 'django.template.context_processors.debug',
>>>> 'django.template.context_processors.request',
>>>> 'django.contrib.auth.context_processors.auth',
>>>> 'django.contrib.messages.context_processors.messages',
>>>> ],
>>>> },
>>>> },
>>>> ]
>>>>
>>>> Thanks,
>>>>
>>>> Tom
>>>>
>>>> --
>>>> 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...@googlegroups.com.
>>>> To post to this group, send email to django...@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/237d37a9-a913-430c-8861-eeedb8f6bece%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/237d37a9-a913-430c-8861-eeedb8f6bece%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email 

Re: Django template

2019-02-08 Thread Tom Zhang
Thanks. But if I do this way, how do I transfer data between back-end and 
front-end? Do I use post request?


On Friday, February 8, 2019 at 8:35:28 PM UTC-5, Nitin Kalmaste wrote:
>
> You are correct,
> You are using HTML and JavaScript as template in django. You need to store 
> static files like css/images/JavaScript in static folder and configure 
> static folder in the settings file
>
> On Sat, Feb 9, 2019, 1:00 AM Mikko Meronen   wrote:
>
>> Hi,
>>
>> Have to say that Im still beginner in Django and coding, but I think you 
>> just create you html files to your templates folder, and in the end you are 
>> basically using just html. Django can just find your html file from 
>> templates folder.
>>
>> Im just learning javascript and I assume i can save my js-file to 
>> templates folder as well and connect it to my html.
>>
>> -Mikko
>>
>> pe 8.2.2019 klo 21.07 Tom Zhang > 
>> kirjoitti:
>>
>>> Hi, all,
>>>
>>> If I don't want to use Django template engine and I just want to use 
>>> regular html/javacript, how do I configure settings.py?
>>> I am thinking about the portability issue. For example, if I want to 
>>> move away from django in the future, I hope my templates can still be used 
>>> in other frameworks, at least, with minimum changes.
>>> My settings are:
>>>
>>> TEMPLATES = [
>>> {
>>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>>> 'DIRS': [os.path.join(BASE_DIR, 'templates')],
>>> 'APP_DIRS': True,
>>> 'OPTIONS': {
>>> 'context_processors': [
>>> 'django.template.context_processors.debug',
>>> 'django.template.context_processors.request',
>>> 'django.contrib.auth.context_processors.auth',
>>> 'django.contrib.messages.context_processors.messages',
>>> ],
>>> },
>>> },
>>> ]
>>>
>>> Thanks,
>>>
>>> Tom
>>>
>>> -- 
>>> 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...@googlegroups.com .
>>> To post to this group, send email to django...@googlegroups.com 
>>> .
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/237d37a9-a913-430c-8861-eeedb8f6bece%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/237d37a9-a913-430c-8861-eeedb8f6bece%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAGD0jjJju_32dqxzuz56z1EUqPnGirQFMFgn0RPOP_qWEGznPA%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/django-users/CAGD0jjJju_32dqxzuz56z1EUqPnGirQFMFgn0RPOP_qWEGznPA%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/14ac6d90-7e51-45dc-9a15-7a5938a6a471%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django template

2019-02-08 Thread Nitin Kalmaste
You are correct,
You are using HTML and JavaScript as template in django. You need to store
static files like css/images/JavaScript in static folder and configure
static folder in the settings file

On Sat, Feb 9, 2019, 1:00 AM Mikko Meronen  Hi,
>
> Have to say that Im still beginner in Django and coding, but I think you
> just create you html files to your templates folder, and in the end you are
> basically using just html. Django can just find your html file from
> templates folder.
>
> Im just learning javascript and I assume i can save my js-file to
> templates folder as well and connect it to my html.
>
> -Mikko
>
> pe 8.2.2019 klo 21.07 Tom Zhang  kirjoitti:
>
>> Hi, all,
>>
>> If I don't want to use Django template engine and I just want to use
>> regular html/javacript, how do I configure settings.py?
>> I am thinking about the portability issue. For example, if I want to move
>> away from django in the future, I hope my templates can still be used in
>> other frameworks, at least, with minimum changes.
>> My settings are:
>>
>> TEMPLATES = [
>> {
>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>> 'DIRS': [os.path.join(BASE_DIR, 'templates')],
>> 'APP_DIRS': True,
>> 'OPTIONS': {
>> 'context_processors': [
>> 'django.template.context_processors.debug',
>> 'django.template.context_processors.request',
>> 'django.contrib.auth.context_processors.auth',
>> 'django.contrib.messages.context_processors.messages',
>> ],
>> },
>> },
>> ]
>>
>> Thanks,
>>
>> Tom
>>
>> --
>> 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 this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/237d37a9-a913-430c-8861-eeedb8f6bece%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/237d37a9-a913-430c-8861-eeedb8f6bece%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGD0jjJju_32dqxzuz56z1EUqPnGirQFMFgn0RPOP_qWEGznPA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAGD0jjJju_32dqxzuz56z1EUqPnGirQFMFgn0RPOP_qWEGznPA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKroR%2B3GKOr2zkC%2B6OUjLwcyDMaSr38px0x8nYUgZGh5wRuU_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django template

2019-02-08 Thread Tom Zhang
I will give it a try first. Thanks

On Friday, February 8, 2019 at 2:30:39 PM UTC-5, Mikko wrote:
>
> Hi,
>
> Have to say that Im still beginner in Django and coding, but I think you 
> just create you html files to your templates folder, and in the end you are 
> basically using just html. Django can just find your html file from 
> templates folder.
>
> Im just learning javascript and I assume i can save my js-file to 
> templates folder as well and connect it to my html.
>
> -Mikko
>
> pe 8.2.2019 klo 21.07 Tom Zhang > 
> kirjoitti:
>
>> Hi, all,
>>
>> If I don't want to use Django template engine and I just want to use 
>> regular html/javacript, how do I configure settings.py?
>> I am thinking about the portability issue. For example, if I want to move 
>> away from django in the future, I hope my templates can still be used in 
>> other frameworks, at least, with minimum changes.
>> My settings are:
>>
>> TEMPLATES = [
>> {
>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>> 'DIRS': [os.path.join(BASE_DIR, 'templates')],
>> 'APP_DIRS': True,
>> 'OPTIONS': {
>> 'context_processors': [
>> 'django.template.context_processors.debug',
>> 'django.template.context_processors.request',
>> 'django.contrib.auth.context_processors.auth',
>> 'django.contrib.messages.context_processors.messages',
>> ],
>> },
>> },
>> ]
>>
>> Thanks,
>>
>> Tom
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/237d37a9-a913-430c-8861-eeedb8f6bece%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/237d37a9-a913-430c-8861-eeedb8f6bece%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/493fdb29-83cd-46ea-bde9-cc27d6cecd90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django template

2019-02-08 Thread Mikko Meronen
Hi,

Have to say that Im still beginner in Django and coding, but I think you
just create you html files to your templates folder, and in the end you are
basically using just html. Django can just find your html file from
templates folder.

Im just learning javascript and I assume i can save my js-file to templates
folder as well and connect it to my html.

-Mikko

pe 8.2.2019 klo 21.07 Tom Zhang  kirjoitti:

> Hi, all,
>
> If I don't want to use Django template engine and I just want to use
> regular html/javacript, how do I configure settings.py?
> I am thinking about the portability issue. For example, if I want to move
> away from django in the future, I hope my templates can still be used in
> other frameworks, at least, with minimum changes.
> My settings are:
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [os.path.join(BASE_DIR, 'templates')],
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> },
> },
> ]
>
> Thanks,
>
> Tom
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/237d37a9-a913-430c-8861-eeedb8f6bece%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/237d37a9-a913-430c-8861-eeedb8f6bece%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGD0jjJju_32dqxzuz56z1EUqPnGirQFMFgn0RPOP_qWEGznPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django template

2019-02-08 Thread Tom Zhang
Hi, all,

If I don't want to use Django template engine and I just want to use 
regular html/javacript, how do I configure settings.py?
I am thinking about the portability issue. For example, if I want to move 
away from django in the future, I hope my templates can still be used in 
other frameworks, at least, with minimum changes.
My settings are:

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

Thanks,

Tom

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/237d37a9-a913-430c-8861-eeedb8f6bece%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django template

2019-02-08 Thread Tom Zhang
Hi,

If I don't want to use any Django template and I just want to use regular 
html/javascript, how should I setup the template config in settings.py?

Right now, my settings are:

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

Thanks,

Tom

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e88d65e8-c992-4a57-ac5b-3ed5f60dab24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django template translation not working as expected

2019-01-10 Thread shiva kumar
Can you explain what are django translation

On Thu 10 Jan, 2019 11:59 pm Ashutosh Das  I am using django 2.1 , here is all the settings related to translation:
>
>
> MIDDLEWARE = [
> 'corsheaders.middleware.CorsMiddleware',
> 'django.middleware.security.SecurityMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.locale.LocaleMiddleware',
> 'django.middleware.common.CommonMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> 'debug_toolbar.middleware.DebugToolbarMiddleware',]
>
> LANGUAGE_CODE = 'en'
>
> LANGUAGES = (
> ('en', _('English')),
> ('bn', _('Bengali')))
>
> LOCALE_PATH = (
> os.path.join(BASE_DIR, 'locale'))
>
> TIME_ZONE = 'Asia/Dhaka'
>
> USE_I18N = True
>
> USE_L10N = True
>
> USE_TZ = False
>
> Template tag that I want to translate:
>
>
> {% load i18n %}
>   {% trans "About Us" %}
> I run both ./manage.py makemessages --all ./manage.py compilemessages
> commands , also added translation in .po file after makemessages command:
>
>
> # locale/bn/LC_MESSAGES/django.po#: templates/partials/footer.html:8
> msgid "About Us"
> msgstr "আমাদের সম্পর্কে"
>
> When I changed the language code from en to bn, template string still
> rendering the default english "About Us".
>
> Here are all the codes that I am using for changing language:
>
>
> 
> {% get_current_language as LANGUAGE_CODE %}
> {% if LANGUAGE_CODE == 'en' %}
> ENGLISH
> {% else %}
> বাংলা
> {% endif %}
> 
> 
> ENGLISH
> বাংলা
> 
> 
>
>
> views.py :
>
>
> def change_lan(request):
> allowed_lan = ('en', 'bn')
> get_lan = request.GET.get('lan', 'en')
> if get_lan in allowed_lan:
> translation.activate(get_lan)
> request.session[translation.LANGUAGE_SESSION_KEY] = get_lan
> return redirect(request.META.get('HTTP_REFERER', '/'))
> else:
> return redirect(request.META.get('HTTP_REFERER', '/'))
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3ed3c00a-148e-4817-a470-bada1af10ba3%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMsYeuG%3DB65MCOZAz-z3x40iB94jG4HmR2TY-8Ma3siycQ7EJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django template translation not working as expected

2019-01-10 Thread Ashutosh Das
 

I am using django 2.1 , here is all the settings related to translation:


MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',]

LANGUAGE_CODE = 'en'

LANGUAGES = (
('en', _('English')),
('bn', _('Bengali')))

LOCALE_PATH = (
os.path.join(BASE_DIR, 'locale'))

TIME_ZONE = 'Asia/Dhaka'

USE_I18N = True

USE_L10N = True

USE_TZ = False

Template tag that I want to translate:


{% load i18n %}
  {% trans "About Us" %}
{% get_current_language as LANGUAGE_CODE %}
{% if LANGUAGE_CODE == 'en' %}
ENGLISH
{% else %}
বাংলা
{% endif %}


ENGLISH
বাংলা

 


views.py :


def change_lan(request):
allowed_lan = ('en', 'bn')
get_lan = request.GET.get('lan', 'en')
if get_lan in allowed_lan:
translation.activate(get_lan)
request.session[translation.LANGUAGE_SESSION_KEY] = get_lan
return redirect(request.META.get('HTTP_REFERER', '/'))
else:
return redirect(request.META.get('HTTP_REFERER', '/'))

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3ed3c00a-148e-4817-a470-bada1af10ba3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django template cheat sheet or ebook

2018-07-30 Thread mottaz hejaze
i think docs are very good

On Mon, 30 Jul 2018, 13:41 , 
wrote:

> Hello,
>
> I have found a lot of example on the Django's CookBook, at this url :
> https://code.djangoproject.com/wiki/CookBook
>
> Le lundi 30 juillet 2018 05:44:44 UTC+2, aditya a écrit :
>>
>> Can anyone tell me where I can find Django template cheat sheet or ebook.
>>
>
> A quelle Vitesse surfez-vous ? Testez le Débit de votre Accès internet [Test
> Complet] <https://www.ipexia.com/test-bande-passante/>
>
> <https://www.ipexia.com/test-bande-passante/>
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2e09e0e4-e59e-42d2-b702-7567b77b6897%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/2e09e0e4-e59e-42d2-b702-7567b77b6897%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHV4E-dwQBGVk6GL%3Dtu0SRfuwzg-Lu_UXMNwX2LHgYCdta2d3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django template cheat sheet or ebook

2018-07-30 Thread Rahul Gurung
search or google or pinterest.

On 30 July 2018 at 09:14, aditya gupta  wrote:

> Can anyone tell me where I can find Django template cheat sheet or ebook.
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAKXtCfCKCA_DE%3D5PL%2BZYiNLwp6wyB1KZUE06zboFxQKKJ7
> kn1g%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAKXtCfCKCA_DE%3D5PL%2BZYiNLwp6wyB1KZUE06zboFxQKKJ7kn1g%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANW48XKbQtj0xq_D08ALWNYMbfDy3Cs4oyp7F3r4wH_Ge0Kb1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django template cheat sheet or ebook

2018-07-30 Thread benjamin . bernard-bouissieres
Hello,

I have found a lot of example on the Django's CookBook, at this url 
: https://code.djangoproject.com/wiki/CookBook

Le lundi 30 juillet 2018 05:44:44 UTC+2, aditya a écrit :
>
> Can anyone tell me where I can find Django template cheat sheet or ebook.
>

-- 
A quelle Vitesse surfez-vous ? Testez le Débit de votre Accès internet 
[Test Complet] <https://www.ipexia.com/test-bande-passante/>
 
<https://www.ipexia.com/test-bande-passante/>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2e09e0e4-e59e-42d2-b702-7567b77b6897%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django template cheat sheet or ebook

2018-07-29 Thread aditya gupta
Can anyone tell me where I can find Django template cheat sheet or ebook.

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKXtCfCKCA_DE%3D5PL%2BZYiNLwp6wyB1KZUE06zboFxQKKJ7kn1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to verify if is new record or update record on django template?

2018-07-13 Thread Derek
You can pass in the ID (primary key) of the object from the view to the 
template.

On Thursday, 12 July 2018 15:58:45 UTC+2, Fellipe Henrique wrote:
>
> How to verify if is new record or update record on django template? How 
> can i do that?
>
> Thanks!
>
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/64a75763-cf28-4730-b62a-06a6a833f447%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to verify if is new record or update record on django template?

2018-07-12 Thread Jani Tiainen
Hi.

Usually you know that in a view. Url routing will be different depending if
it's a new record or editing old record.

to 12. heinäk. 2018 klo 16.58 Fellipe Henrique 
kirjoitti:

> How to verify if is new record or update record on django template? How
> can i do that?
>
> Thanks!
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAF1jwZH40f%3D3ATxVSNx8Ku%3DWiG1MxnN%3D89MLw-5%2B-iNuEu9uQA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAF1jwZH40f%3D3ATxVSNx8Ku%3DWiG1MxnN%3D89MLw-5%2B-iNuEu9uQA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91oentkeMFQE5L1uLx%2BdS5JTNu0Otaxzc78HB_srrv4-9Uw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to verify if is new record or update record on django template?

2018-07-12 Thread Fellipe Henrique
How to verify if is new record or update record on django template? How can
i do that?

Thanks!

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF1jwZH40f%3D3ATxVSNx8Ku%3DWiG1MxnN%3D89MLw-5%2B-iNuEu9uQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django template rendering performance

2018-07-10 Thread Andrew Paulsen
No, Django renders the templates.

Masoud,
if you suspect there are negative difference between 2.7 and 3.5, please
try to make a minimal app showing off the problem so the devs can fix it.


On 2018-07-10 09:11, mottaz hejaze wrote:
> i dont think so . rendering templates , though rendering templates us
> a matter of the web server then users browsers
>
> On Tue, 10 Jul 2018, 00:56 Masoud Sadri,  > wrote:
>
> Hi,
> when rendering django(v 1.11) templates, is there any performance
> difference between python 2.7 and 3.5? 
>
> Thanks.
> -- 
> 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 this group, send email to django-users@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> 
> https://groups.google.com/d/msgid/django-users/71ea0ed5-e182-4bcb-9ec6-64970f04f351%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> -- 
> 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 this group, send email to django-users@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHV4E-d%2Bjzs5P-dHBgS_1TYKfWjyZ8DXo%2BXW%2BzVxE9pfNy%3DiRw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1a7b11a8-8679-4833-12e5-2123babedd06%40x76.eu.
For more options, visit https://groups.google.com/d/optout.


Re: django template rendering performance

2018-07-09 Thread mottaz hejaze
i dont think so . rendering templates , though rendering templates us a
matter of the web server then users browsers

On Tue, 10 Jul 2018, 00:56 Masoud Sadri,  wrote:

> Hi,
> when rendering django(v 1.11) templates, is there any performance
> difference between python 2.7 and 3.5?
>
> Thanks.
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/71ea0ed5-e182-4bcb-9ec6-64970f04f351%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHV4E-d%2Bjzs5P-dHBgS_1TYKfWjyZ8DXo%2BXW%2BzVxE9pfNy%3DiRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


django template rendering performance

2018-07-09 Thread Masoud Sadri
Hi,
when rendering django(v 1.11) templates, is there any performance 
difference between python 2.7 and 3.5? 

Thanks.

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/71ea0ed5-e182-4bcb-9ec6-64970f04f351%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Passing Django Template Vars to JS

2018-06-11 Thread Melvyn Sopacua
On maandag 11 juni 2018 20:11:36 CEST Simon Connah wrote:

> I like the idea of the custom attribute. I'll do that then.

The common way is to use a data- attribute[1].
-- 
Melvyn Sopacua


[1] https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/
Use_data_attributes

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2026797.eeRFsSjbx6%40fritzbook.
For more options, visit https://groups.google.com/d/optout.


Re: Passing Django Template Vars to JS

2018-06-11 Thread Simon Connah
Hi Vijay,

Thank you very much for the reply and sorry for the late reply.

You are completely right about not having multiple elements with the
same ID. I completely forgot that an ID was meant to be unique on a
page. I'll change it to a class.

I like the idea of the custom attribute. I'll do that then.

Simon.
On Mon, 11 Jun 2018 at 02:04, Vijay Khemlani  wrote:
>
> I'm not sure why your code does not work (maybe there is a "race condition" 
> between the JS click handlers), but that global variable is a bad idea in 
> general.
>
> You can add the comment ID as an attribute to your button, like
>
> 
>
> and in your event handler obtain the comment id
>
> $("#like_comment_button").click(function (event) {
>var comment_id = event.target.getAttribute('data-comment-id')
>// Call AJAX
> })
>
> That way you don't need the global variable or the other click handler
>
> Finally, it's a bad idea to have multiple elements with the same ID (all 
> comments will have a button with ID "like_comment_button") so it's better to 
> add it as a class rather than an id.
>
> Regards
>
>
>
>
>
> On Sun, Jun 10, 2018 at 11:19 AM Simon Connah  wrote:
>>
>> I know that the standard way to do this is to create a script tag with
>> a global JS variable in your Django template before you import your
>> other JS files but that won't work for my current situation.
>>
>> I have an article detail view which is a single model instance. But I
>> also have a list of comment objects that have a Foreign Key to the
>> article (because that is the article that is being commented on).
>>
>> I need to pass the comment_id to the JS files that I am loading. If
>> you want to see the code I am using then you can see it here:
>>
>> https://gitlab.com/glamorous-systems/seductive/blob/master/blog/templates/blog/article_detail.html
>>
>> I thought I'd use an onclick event on the Like / Dislike button to
>> call a JS function which then passes that value to this JS file:
>>
>> https://gitlab.com/glamorous-systems/seductive/blob/master/blog/static/js/pass_comment_id.js
>>
>> and then I'd just call the return_comment_id() function from my other
>> JS files to get the comment_id of the specific comment the user
>> clicked the Like / Dislike button for. I think the problem is that my
>> jQuery AJAX selectors are also looking for a click event, so they
>> happen in a strange order, but I'm not sure.
>>
>> I'm totally lost on what I should be doing here. Any help would be
>> very much appreciated :).
>>
>> --
>> 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 this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CADNsu1OksTqc2crvX%3DK%3D_Kf_Xz1fCfABTRV-q48htRUikiAtXA%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CALn3ei0ZneJzKAbSyN958_1RCaS7kjQY6VszQb8a%3D-Mxgod-GQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADNsu1PL7dT%2BhXgMc8r9arVZY2pXYxP8hQWywn5u8OqSKaBLHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Passing Django Template Vars to JS

2018-06-10 Thread Vijay Khemlani
I'm not sure why your code does not work (maybe there is a "race condition"
between the JS click handlers), but that global variable is a bad idea in
general.

You can add the comment ID as an attribute to your button, like



and in your event handler obtain the comment id

$("#like_comment_button").click(function (event) {
   var comment_id = event.target.getAttribute('data-comment-id')
   // Call AJAX
})

That way you don't need the global variable or the other click handler

Finally, it's a bad idea to have multiple elements with the same ID (all
comments will have a button with ID "like_comment_button") so it's better
to add it as a class rather than an id.

Regards





On Sun, Jun 10, 2018 at 11:19 AM Simon Connah 
wrote:

> I know that the standard way to do this is to create a script tag with
> a global JS variable in your Django template before you import your
> other JS files but that won't work for my current situation.
>
> I have an article detail view which is a single model instance. But I
> also have a list of comment objects that have a Foreign Key to the
> article (because that is the article that is being commented on).
>
> I need to pass the comment_id to the JS files that I am loading. If
> you want to see the code I am using then you can see it here:
>
>
> https://gitlab.com/glamorous-systems/seductive/blob/master/blog/templates/blog/article_detail.html
>
> I thought I'd use an onclick event on the Like / Dislike button to
> call a JS function which then passes that value to this JS file:
>
>
> https://gitlab.com/glamorous-systems/seductive/blob/master/blog/static/js/pass_comment_id.js
>
> and then I'd just call the return_comment_id() function from my other
> JS files to get the comment_id of the specific comment the user
> clicked the Like / Dislike button for. I think the problem is that my
> jQuery AJAX selectors are also looking for a click event, so they
> happen in a strange order, but I'm not sure.
>
> I'm totally lost on what I should be doing here. Any help would be
> very much appreciated :).
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADNsu1OksTqc2crvX%3DK%3D_Kf_Xz1fCfABTRV-q48htRUikiAtXA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALn3ei0ZneJzKAbSyN958_1RCaS7kjQY6VszQb8a%3D-Mxgod-GQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Passing Django Template Vars to JS

2018-06-10 Thread Simon Connah
I know that the standard way to do this is to create a script tag with
a global JS variable in your Django template before you import your
other JS files but that won't work for my current situation.

I have an article detail view which is a single model instance. But I
also have a list of comment objects that have a Foreign Key to the
article (because that is the article that is being commented on).

I need to pass the comment_id to the JS files that I am loading. If
you want to see the code I am using then you can see it here:

https://gitlab.com/glamorous-systems/seductive/blob/master/blog/templates/blog/article_detail.html

I thought I'd use an onclick event on the Like / Dislike button to
call a JS function which then passes that value to this JS file:

https://gitlab.com/glamorous-systems/seductive/blob/master/blog/static/js/pass_comment_id.js

and then I'd just call the return_comment_id() function from my other
JS files to get the comment_id of the specific comment the user
clicked the Like / Dislike button for. I think the problem is that my
jQuery AJAX selectors are also looking for a click event, so they
happen in a strange order, but I'm not sure.

I'm totally lost on what I should be doing here. Any help would be
very much appreciated :).

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADNsu1OksTqc2crvX%3DK%3D_Kf_Xz1fCfABTRV-q48htRUikiAtXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Having trouble writing loop in Django template

2018-04-02 Thread shawnmhy


Hello guys I am currently working on django views and templates and met 
some problems. I have a model named 'metabolites', which contains: id, 
name, compartment, charge and formula 5 components. I have another model 
named 'Reactionsmeta', which contains: id(reactions), name, metabolie1, 
metabolite2,  metabolite6. The table of this model is not filled 
complete, because sometimes one id corresponds to 5 metabolites, but 
sometimes even 20.

I write a template which can displays all the reaction, when I click on the 
reaction and enter the detail page, I also want to display the metabolites 
that involve in this reactions. My views.py and templates are written as 
below:


reactions_detail.html
{% extends 'Recon/Base.html' %}{% load static %}{% block title %}Reaction 
Details{% endblock %}{% block body %}{{ reactionsmeta.id }}{{ 
reactionsmeta.name}}



{% if reactionsmeta.id %}

{% else %}
No image to display
{% endif %}

{{ reactionsmeta.id }} {{ reactionsmeta.name 
}}



[image: index.html] 

views.pyfrom django.views import genericfrom .models import 
Reactionsmeta,Metabolites,Reactionsfrom django.shortcuts import render

class IndexView(generic.ListView):
template_name = 'Recon/index.html'
context_object_name = 'Reactions_object'
def get_queryset(self):
return Reactionsmeta.objects.all()

class DetailsView(generic.DetailView):
model = Reactionsmeta
template_name = 'Recon/reactions_detail.html'
def get_context_data(self, **kwargs):
context = super(DetailsView, self).get_context_data(**kwargs)
context['metabolite'] = Metabolites.objects.all()
context['reactions'] = Reactions.objects.all()

# And so on for more models
return context

How can I write the loop in reaction_detail.html???

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/76028827-99ad-43a3-8bb1-831f8f6df183%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Template and compating with select option value

2017-10-29 Thread Andréas Kühne
Hi,

I am not really sure what you are trying to accomplish. What you are
writing doesn't make sense.

I think you should check how to write the paginate by properties. You can
find some information here:
https://docs.djangoproject.com/en/1.11/topics/pagination/
https://simpleisbetterthancomplex.com/tutorial/2016/08/03/how-to-paginate-with-django.html

How you are using the paginate by property doesn't seem to make sense or I
don't understand what you are trying to accomplish :-)

Best regards,

Andréas

2017-10-28 19:04 GMT+02:00 Naaim Iss :

> Hello everyone.
> I hace a ListView-based class with attribute `paginate_by = 12`.
> There is in HTML-template a select element with seveeral options, for
> pagination of course. Options come to the page from context. Loks like this:
> `
> 
> {% for item in per_page_options %}
>  {% if request.GET.results_per_page == item or paginate_by == item
> %}
> selected="selected" {% endif %}
> >{{ item }}
> 
> {% endfor %}
> 
> `
>
> When i change value of select attribute `paginate_by` changes succesfully
> and on page another option is selected, according to new value of
> `paginate_by'
> But when i move to another page on this template the value 'selection'
> stops working and in "options" the first value becomes "selected".
> Even tried to check how this template reads the "context" from "view", by
> adding this code next on page
> `
> {% if request.GET.results_per_page == paginate_by %}
> {{ paginate_by }} - {{ request.GET.results_per_page }}
> {% endif %}
> `
> And after changing the page I can see this new string. Like 3 - 3 or 9 -
> 9, etc.
>
> Looks like some bug. But never saw it before.
> Any ideas?
>
> Thanks anyway.
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/bb7eeb52-8a29-474a-9607-3cc9f108b1dd%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCdhao_-SNO3B5s51KxhAwrnvWk9ke-qWKBpDHBKpW9d%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django Template and compating with select option value

2017-10-28 Thread Naaim Iss
Hello everyone.
I hace a ListView-based class with attribute `paginate_by = 12`.
There is in HTML-template a select element with seveeral options, for 
pagination of course. Options come to the page from context. Loks like this:
`

{% for item in per_page_options %}
{{ item }}

{% endfor %}

`

When i change value of select attribute `paginate_by` changes succesfully 
and on page another option is selected, according to new value of 
`paginate_by'
But when i move to another page on this template the value 'selection' 
stops working and in "options" the first value becomes "selected".
Even tried to check how this template reads the "context" from "view", by 
adding this code next on page
`
{% if request.GET.results_per_page == paginate_by %}
{{ paginate_by }} - {{ request.GET.results_per_page }}
{% endif %}
`
And after changing the page I can see this new string. Like 3 - 3 or 9 - 9, 
etc.

Looks like some bug. But never saw it before.
Any ideas?

Thanks anyway.

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bb7eeb52-8a29-474a-9607-3cc9f108b1dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Create Mobile App from Django Template

2017-07-18 Thread carlos
Hi, but is he need stored information offline, the app save data (local
stored) and then synchronize with the databases in django (web databases)
How can you do something like that?

On Mon, Jul 17, 2017 at 1:55 PM, Marsel Xhaxho  wrote:

> Hello,
>
> Django Rest Framework  to the
> rescue. You can use this package to expose your database via a HTTP REST
> api and consume it via swift/java or any other language/platform you might
> think.
>
> This actually is the way web works nowadays, even for web apps.
>
> On 17 Jul 2017, at 22:52, Jani Tiainen  wrote:
>
> Hi,
>
> There are numerous ways to do that. You could create mobile version of
> your site or do called responsive design. That way site would be accessible
> with virtually any device.
>
> If you want to create native app you can write for example rest api to
> provide data for your app.
>
> 17.7.2017 21.54 "Megan Zhao"  kirjoitti:
>
>> My friend and I followed the Django tutorial to create a web blog where
>> the professors can post their office hours and students can access to
>> search and browse. We want to create a mobile app that contains the same
>> info so that when the professors post on the web, the info in the app also
>> updates as well. I think I can use Django to create a mobile app? So I am
>> wondering if there is any way I can create an IOS app through Swift and
>> then access the database that is stored in the Django so that when there is
>> new data in the database the mobile app also updates as well. Thanks!
>>
>> --
>> 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 this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/318f52e1-c804-47fd-8a10-4c49de6cc0e0%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAHn91odUopNTxB5WSdsNttqMAxOLi7KwARDoHk5Xv8j%2Bc-yvUw%
> 40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/1FE3BF0B-F606-4EAE-88E0-729DA0FA6E1B%40gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
att.
Carlos Rocha

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-7rO3KJ0K4cBWEC9xMsT4zMtqD4keoL_1juK-4WkBDcfpnoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Create Mobile App from Django Template

2017-07-17 Thread Marsel Xhaxho
Hello,

Django Rest Framework  to the rescue. 
You can use this package to expose your database via a HTTP REST api and 
consume it via swift/java or any other language/platform you might think.

This actually is the way web works nowadays, even for web apps.

> On 17 Jul 2017, at 22:52, Jani Tiainen  wrote:
> 
> Hi,
> 
> There are numerous ways to do that. You could create mobile version of your 
> site or do called responsive design. That way site would be accessible with 
> virtually any device.
> 
> If you want to create native app you can write for example rest api to 
> provide data for your app.
> 
> 17.7.2017 21.54 "Megan Zhao"  > kirjoitti:
> My friend and I followed the Django tutorial to create a web blog where the 
> professors can post their office hours and students can access to search and 
> browse. We want to create a mobile app that contains the same info so that 
> when the professors post on the web, the info in the app also updates as 
> well. I think I can use Django to create a mobile app? So I am wondering if 
> there is any way I can create an IOS app through Swift and then access the 
> database that is stored in the Django so that when there is new data in the 
> database the mobile app also updates as well. Thanks!
> 
> -- 
> 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 this group, send email to django-users@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/318f52e1-c804-47fd-8a10-4c49de6cc0e0%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .
> 
> -- 
> 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 this group, send email to django-users@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAHn91odUopNTxB5WSdsNttqMAxOLi7KwARDoHk5Xv8j%2Bc-yvUw%40mail.gmail.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1FE3BF0B-F606-4EAE-88E0-729DA0FA6E1B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Create Mobile App from Django Template

2017-07-17 Thread Jani Tiainen
Hi,

There are numerous ways to do that. You could create mobile version of your
site or do called responsive design. That way site would be accessible with
virtually any device.

If you want to create native app you can write for example rest api to
provide data for your app.

17.7.2017 21.54 "Megan Zhao"  kirjoitti:

> My friend and I followed the Django tutorial to create a web blog where
> the professors can post their office hours and students can access to
> search and browse. We want to create a mobile app that contains the same
> info so that when the professors post on the web, the info in the app also
> updates as well. I think I can use Django to create a mobile app? So I am
> wondering if there is any way I can create an IOS app through Swift and
> then access the database that is stored in the Django so that when there is
> new data in the database the mobile app also updates as well. Thanks!
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/318f52e1-c804-47fd-8a10-4c49de6cc0e0%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91odUopNTxB5WSdsNttqMAxOLi7KwARDoHk5Xv8j%2Bc-yvUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Create Mobile App from Django Template

2017-07-17 Thread Megan Zhao
My friend and I followed the Django tutorial to create a web blog where the 
professors can post their office hours and students can access to search 
and browse. We want to create a mobile app that contains the same info so 
that when the professors post on the web, the info in the app also updates 
as well. I think I can use Django to create a mobile app? So I am wondering 
if there is any way I can create an IOS app through Swift and then access 
the database that is stored in the Django so that when there is new data in 
the database the mobile app also updates as well. Thanks!

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/318f52e1-c804-47fd-8a10-4c49de6cc0e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Show HTML tags in list in Django template

2017-04-16 Thread ludovic coues
I don't understand where the [] symbol in your example come from.
Have you tried to get a detailed view of tags_hx, with {{ tags_hx|pprint }} ?

2017-04-15 22:40 GMT+02:00 Moreplavec <stanislav.va...@gmail.com>:
> Greetings,
>
> i'm trying to parse HTML website and present same basic info about it. I'm
> using BeuatifulSoup4 and Python3. Code is simple, but i have problem to
> force Django template show variables in my list. For example this simple
> code in template:
>
>> {{ tags_hx }}
>> Tags H1 - H7
>> 
>> {% for tag in tags_hx %}
>> 
>> {% autoescape off %}{{ tag|safe }}{% endautoescape
>> %}
>> 
>> {% endfor %}
>> 
>
>
>  while {{ tags_hx }} prints lists exactly i have:
>
>> [Beginners English Tests 1, Grammar, Beginners
>> ESL, For Kids, Reading Skills, Major Exams,
>> Writing  Vocab]
>
>
> but i can't get or force Django template to show each tag in table. All i
> get is:
>
>> Tags H1 - H7
>> [Beginners English Tests 1]
>> []
>> []
>> []
>> []
>> []
>> []
>
>
> I know, when i insert html code in template it will be used by browser, but
> just makes me mad i can't get to work it :) Autoescape or |safe doesn't
> help. Please, can you help me how to force simple output tags in cycle
> regardless of the consequences?
>
> Thanks!
>
> --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/23ba36b8-b550-4eb8-acda-382f0cd7e481%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Ludovic Coues
+33 6 14 87 43 42

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEuG%2BTZukFjaqUV9dcZNFaEwZJ7qXzVh_i6bfeNC8C3t-1KVzw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Show HTML tags in list in Django template

2017-04-15 Thread Moreplavec
Greetings,

i'm trying to parse HTML website and present same basic info about it. I'm 
using BeuatifulSoup4 and Python3. Code is simple, but i have problem to 
force Django template show variables in my list. For example this simple 
code in template:

{{ tags_hx }}
> Tags H1 - H7
> 
> {% for tag in tags_hx %}
> 
> {% autoescape off %}{{ tag|safe }}{% endautoescape 
> %}
> 
> {% endfor %}
> 


 while {{ tags_hx }} prints lists exactly i have:

[Beginners English Tests 1, Grammar, 
> Beginners ESL, For Kids, Reading Skills, 
> Major Exams, Writing  Vocab]


but i can't get or force Django template to show each tag in table. All i 
get is:

Tags H1 - H7
> [Beginners English Tests 1]
> []
> []
> []
> []
> []
> [] 


I know, when i insert html code in template it will be used by browser, but 
just makes me mad i can't get to work it :) Autoescape or |safe doesn't 
help. Please, can you help me how to force simple output tags in cycle 
regardless of the consequences?

Thanks!

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23ba36b8-b550-4eb8-acda-382f0cd7e481%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Iframe'd page in Django template can't find it's Javascript or CSS files, 404 error

2017-03-05 Thread Melvyn Sopacua
On Friday 03 March 2017 20:37:29 Tom Tanner wrote:
> When the iframe requests
> `/interactive`, it loads `interactive-1/index.html`.

But the iframe still loads /interactive. So it's base url is /interactive and a 
request for scripts/main.js is /interactive/scripts/main.js.

Unless you either:
1/ Do a redirect, which is the simplest
2/ Request your resources incorporating the session id

I still would go for 1/, simply because that fixes the disconnect between 
template path / view path and requested url.
-- 
Melvyn Sopacua

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1534032.trWzQqoBk9%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: Iframe'd page in Django template can't find it's Javascript or CSS files, 404 error

2017-03-05 Thread chris rose
there is a lack of information here, though you last post suggests maybe 
you missed a couple of template tags

at the start of you index.html add:

{% load staticfiles %}

and then when adding you scripts use:



-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a87d42ff-b73d-4c59-b384-e77a5a52971d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Iframe'd page in Django template can't find it's Javascript or CSS files, 404 error

2017-03-04 Thread Daniel Roseman
On Saturday, 4 March 2017 15:57:49 UTC, Tom Tanner wrote:
>
> >How are you referring to the assets in the template?
>
> In `interactive/index.html`, in the `` tag, I have ` src="scripts/main.js">`
>

Well, if you wanted to load the scripts from 
/interactive-1/scripts/main.js, then that's what you should use as the src, 
surely?
-- 
DR.

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5fe5c543-8d35-4521-836b-163de1554a72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   4   5   6   >