Re: New to django cms and shop!

63 views
Skip to first unread message

Arthur Maciel

unread,
Oct 19, 2013, 5:17:06 PM10/19/13
to djang...@googlegroups.com
Tomas, I can't believe it was that easy to fix! Really thanks!

BTW, I've found this portuguese translation .po file (https://www.transifex.com/projects/p/django-shop/language/pt_BR/), but I still haven't found any documentation on where to place it within my app source tree. Could you please enlighten me more?

Best wishes,
Arthur


2013/10/19 Tomáš Peterka <pres...@gmail.com>
You have done a lot of dark magic. I recommend you to start over again and just put your application before "shop" in your INSTALLED_APPS. Then create the customized templates again and everything should be ok.

Cheers, Tomas

On Friday, October 18, 2013 3:57:38 PM UTC+2, Arthur Gonçalves wrote:
Dear Gordon, hello!

I'm trying to override django-shop templates (especially the base.html) but following your advice bellow causes no changes (django-shop still uses its default templates).

What I've done so far:

$ django-admin startproject testshop
$ cd testshop
$ django-admin startapp myshop

According to http://django-shop.readthedocs.org/en/latest/getting-started.html, I've correctly created a virtualenv with all dependencies installed with pip, edited testshop/settings.py and testshop/urls.py and synced/migrated the database. Then,

$ cp -Rf ~/.virtualenvs/shop/lib/python2.7/site-packages/shop/templates myshop/

Then, I've edited testshop/myshop/templates/shop/base.html, but nothing happens. I tried to rename testshop/myshop/templates/shop to testshop/myshop/templates/myshop and nothing happened too.

What am I doing wrong?

Kind regards,
Arthur

On Tuesday, September 25, 2012 7:51:46 PM UTC-3, gordon wrote:
Hi Gordon,
Thanks for replying. I'm new to django, so not sure how to override the templates? Is it the same way we override Admin base templates when we launch a production site? Or we just create templates and then use http://django-shop.readthedocs.org/en/latest/templatetags.html in our templates? Pardon my ignorance, I just want to get some things right. :)  
Best Regards, 
Maximilian Jackson

Max,

Yes, it would be the same way as the admin.  For example, you could adjust the base shop template by copying "shop/templates/shop/base.html" to "yourapp/templates/shop/base.html" and changing the markup.  Just make sure to define the same blocks.  You need to make sure that "yourapp" is listed after "shop" in INSTALLED_APPS in your settings.py file.

Thanks,
Gordon

--
You received this message because you are subscribed to the Google Groups "django-shop" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-shop...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Tomáš Peterka

unread,
Oct 20, 2013, 1:50:34 PM10/20/13
to djang...@googlegroups.com
The protuguese translation is already included in django-shop distribution, isn't it? It's in django-shop/shop/locale/pt_BR. You have to have .mo file, which is generated from .po file using 'django-admin.py compilemessages' within the 'shop' directory. Just read some stuff about internationalization at django documentation. Be always i18n enabled.

Cheers

Arthur Maciel

unread,
Oct 21, 2013, 6:29:54 AM10/21/13
to djang...@googlegroups.com
Tomáš, thank you so much! It was a matter of just changing LANGUAGE_CODE in settings.py. Indeed I need to study more about Django.

Cheers,
Arthur


2013/10/20 Tomáš Peterka <pres...@gmail.com>
Reply all
Reply to author
Forward
0 new messages