25 views
Skip to first unread message

Torbjörn Lundquist

unread,
Dec 21, 2012, 12:38:09 PM12/21/12
to 0133...@swipnet.se, a_m_...@hotmail.com, aja.he...@hotmail.com, Anders Petterson (anders.o.pettersson@saabgroup.com), andreas....@motorola.com, Anette Ahlström, Anna Akerlind, Anna SJOLUND, Anna Sjölund, anna...@areteadsl.se, anna.m....@passagen.se, anna...@mail.se, Annica Hellström (aja.hellstrom@gmail.com), asa.m...@kriminalvarden.se, Bengt From, Björn Wesén, Cajsa Grenner, Camilla Karlborg, carina....@lkpg.visit.se, cath...@djandersonassociates.com, Cenneth....@linkoping.se, Charles Fox, christe...@telia.com, Dag Helstad, django...@googlegroups.com, Elin, Emil, emma...@tele2.se, Erik Berglund, erik....@comhem.se, Eriksson Joacim, Ewa Wallander, Fam Larsson, familje...@telia.com, fotbol...@hotmail.com, Fredrik Jeppsson, goran.b...@saabgroup.com, Helena, helenet...@hotmail.com, Henrik Vennerberg, henrik....@telia.com, Henrik.S...@hotmail.se, henrik....@saabgroup.com, Holmstrom Owen-OHO001, Hägglund

vinoth kumar renganathan

unread,
Dec 21, 2012, 11:46:16 PM12/21/12
to django...@googlegroups.com
i am new user to  django .and i don't know how to add     .html   files (template dirs ) to  the apps folders  .what are the things want to change in settings.py
 

            the error will be templatedoesnotexist
       /polls
          /admin.py
          /__init__.py
         /models.py
         /tests.py
          /urls.py
          /views.py
          /template
                   /polls
                            /index.html

and this order will be correct or not     
           
for example this will be codings 

 {% if latest_poll_list %}
    <ul>
    {% for poll in latest_poll_list %}
        <li><a href="/polls/{{ poll.id }}/">{{ poll.question }}</a></li>
    {% endfor %}
    </ul>
{% else %}
    <p>No polls are available.</p>
{% endif %}


is it necessary to add htmltag ,header tag and doctype before this html codings


Lachlan Musicman

unread,
Dec 22, 2012, 1:56:37 AM12/22/12
to django...@googlegroups.com
Do you have the template_dirs setting in your settings.py pointing to
project/app/templates/ ?
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.



--
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”

http://www.warrenellis.com/?p=14314

vinoth kumar renganathan

unread,
Dec 22, 2012, 3:22:55 AM12/22/12
to django...@googlegroups.com
in  my TEMPLATE_DIRS = '/home/projectname/polls/template'
i written like this is it correct or not

Ivan Ivanov

unread,
Dec 22, 2012, 3:32:41 AM12/22/12
to django...@googlegroups.com
Just a little hint – it woud be good, when you put an informative title
of your emails, so the people can orient what the topic of the email is.

Best wishes!

Ivan

На Sat, 22 Dec 2012 10:16:16 +0530
vinoth kumar renganathan <vinoth.vi...@gmail.com> написа:

djangobie

unread,
Dec 22, 2012, 4:38:45 AM12/22/12
to django...@googlegroups.com
My recommendations (as you're at the starting point, 'd be easy to adjust), don't place your 'Templates' folder in app folder, but place it one level up i.e.

Basic Project map:
----------------------------------------------------------------------
     myproject/- 
                     --myproject/- (project file container)
                                           - __init__.py
                                           - settings.py
                                           - urls.py
                                           - wsgi.py
                    
                     --myapp1/- 
                                           - models.py
                                           - views.py
                                           - admin.py
                                           - __init__.py
                                           - test.py
                    --myapp2/- 
                                           - models.py
                                           - views.py
                                           - __init__.py
                                           - test.py

                     -- manage.py-

                     --Templates/-
                                         - myapp1/- (use a seperate folder for every app)
                                                       - base.html
                                                       - index.html
                                                       - view_category.html
                                                       - view_posts.html

                                        - myapp2/ -

set your Temp dir: /home/machinename/myproject/Templates/

djangobie

unread,
Dec 22, 2012, 4:41:00 AM12/22/12
to django...@googlegroups.com
as you're practicing the exactly the 'building the first app' tutorial, you've placed your templates wrong.
Move your 'Templates' folder one directory UP.


On Saturday, December 22, 2012 9:46:16 AM UTC+5, vinoth kumar renganathan wrote:

vinoth kumar renganathan

unread,
Dec 22, 2012, 10:51:46 AM12/22/12
to django...@googlegroups.com
thank you bro it is working
  
             i tested so many times. but in the previous cases   i didn't added machine name  to the TEMPLATE_DIR in the settings.py
             
Reply all
Reply to author
Forward
0 new messages