Hi,

On Thu, Sep 11, 2008 at 9:41 AM, msagas <[EMAIL PROTECTED]> wrote:
>
> Hello everyone  :)
>
> A newbie here ! coming from PHP and trying to learn django... i bought
> the Apress Definitive Guide to Django book.. and im stuck in chapter
> 4... in the template stuff... i do understand the things the expose on
> the book, but im trying to do some more elaborated examples rather
> than the simple one of the books. As you realise.... im not good at
> english :P ... but i will try to explain the best i can.
>
> Ok.. I have a HTML site in my /home/lampp/htdocs/mysite/template
> there i have the index.html , the /css/style.css and the /images/*
> directory with the images of the web page.
>
> What i want to do is.. to show the user the index.html with the web
> menu in english:
>
> home | download | documentation | .....   (a common web menu)
>
> if the user enter my website  localhost:8000  i want to show it in
> english, but if he enter localhost:8000/es/   y want to show it in
> spanish...
>
> what i did is :
>
> 0000000000000000000 urls.py 00000000000000000000000000
> from django.conf.urls.defaults import *
> from mysite.views import es
> urlpatterns = patterns('',
>        (r'es/$',es),
> )
>
> 0000000000000000000 views.py 00000000000000000000000000
> from django.shortcuts import render_to_response
>
> def es(request):
>        menu =
> {'home':'inicio','download':'descarga','source':'cod.fuente','documentation':'documentacion'}
>
>        return render_to_response('index.html',
> {'home':menu['home'],'download':menu['download'],'source':menu['source'],'documentation':menu['documentation']})
>
> 0000000000000000000 settings.py 00000000000000000000000000
> TEMPLATE_DIRS = (
>        '/opt/lampp/htdocs/mysite/template',
> )
>
> 0000000000000000000 ..template/index.html 00000000000000000000000000
> (...) // all html and css and js import , head and body tags also
>
>
>  <tr>
>
>        <td width="400" height="40" valign="bottom"><span
> class="menu">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ home }}  |
> {{ download }} |  {{ source }} | {{ documentation }}</span></td>
>
> (...)
>
> PLEASE NOTE THAT DJANGO SITE is in /opt/lampp/htdocs/mysite/
>
> AND THE TEMPLATE IS IN /opt/lampp/htdocs/mysite/template
>
> AND ALSO THE index.html USES IMAGES AND CSS STORED IN  /opt/lampp/
> htdocs/mysite/template/images   and  /opt/lampp/htdocs/mysite/template/
> css
>
> The problem im having is that nor css neither images are shown..
> because when i enter: http://localhost:8000/es/   the html is looking
> the files in  localhost/es/  directory :S
>
> i include a IFRAME with a src="features.html"  to test.. and the error
> given is:
>
> Page not found (404)
> Request Method:         GET
> Request URL:    http://localhost:8000/es/features.html
>
> Sorry for the megapost.. but i dont know what im doing wrong =(  i
> just want to have the localhost:8000 with the index in english and
> localhost:8000/es/ with the index in spanish  ... and i have this url
> mapping problems.
>
> The translation is working good... but i have the url mapping problems
> and cannot use images or css or import anything.
>
> Help me please !
>

Have a look at that:
http://docs.djangoproject.com/en/dev/howto/static-files/#howto-static-files

It seems this will solve most of your problems.


Matthias

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to