我是django的n00b,我做过民意测验教程,没有太多。我想建立一个与闪电快铺(LFS)的在线商店,这几乎是我需要做的任何事情。我知道最好有一个更好的django基地..。
我想要做的第一步之一是定制一些模板。以下是关于如何做到这一点的解释:
http://play.pixelblaster.ro/blog/archive/2009/09/17/customizing-django-lfs-lightning-fast-shop-for-the-non-django-developer
正确安装了FLS框架:我可以打开站点,定义产品,将产品添加到购物车,等等。
我已经配置了settings.TEMPLATE_DIRS,以便它指向项目中的一个内部文件夹。似乎我做对了,因为当我删除一个模板base.html时,我得到了以下错误:
NoReverseMatch at /
'url' requires a non-empty first argument. The syntax changed in Django 1.5, see the docs.
... a lot of information...
Error during template rendering
In template c:\development\......\lfs-installer\lfs_project\theme\templates\lfs\base.html, error at line 47
'url' requires a non-empty first argument. The syntax changed in Django 1.5, see the docs.
37 <script type="text/javascript" src="{{ STATIC_URL }}jquery/lightbox/jquery.lightbox-0.5.js"></script>
38 <script type="text/javascript" src="{{ STATIC_URL }}js/lfs.js"></script>
39 {% endcompress %}
40
41 </head>
42 <body class="{% block section %}lfs{% endblock %}">
43 <div id="header">
44 <div class="container">
45 {% block header %}
46 <div class="span-6 logo">
47 <a href="{% url lfs.core.views.shop_view %}">
48 <img class="logo"
49 src="{{ STATIC_URL }}img/logo.jpg"
50 alt="Logo" />
51 </a>
52 </div>
53 <div class="span-18 search last">
54 {% if user.is_authenticated %}
55 {% if user.first_name %}
56 <span>{{ user.first_name }} {{user.last_name}}</span>
57 {% else %}我尝试从from包中复制整个模板,但是它仍然不起作用。
对纯django的这个主题有很好的解释,但是FLS是一个额外的复杂层,我无法正确理解它。提前谢谢。
编辑--这是我的虚拟版本的freeze:
Django==1.6.5
Pillow==1.7.5
South==0.7.3
django-appconf==0.6
django-compressor==1.1.1
django-countries==1.5
django-lfs==0.7.8
django-lfstheme==0.7.4
django-pagination==1.0.7
django-paypal==0.1.2
django-piston==0.2.3
django-portlets==1.1.1
django-postal==0.92
django-reviews==0.2.1
django-tagging==0.3.1
lfs-contact==1.0
lfs-order-numbers==1.0b1
six==1.7.3发布于 2014-07-19 10:07:48
由于回溯状态,第47行中的url标记应该如下所示
{% url 'lfs.core.views.shop_view' %}在Django 1.5中,这一情况已经改变。
还请确保在LFS 0.7.*中使用Django 1.3.*。如果你这样做,上面的错误就根本不会出现。
不过,LFS0.9(目前处于alpha状态)正在使用Django 1.6.*。
https://stackoverflow.com/questions/24838520
复制相似问题