我正在写一个视图,它接受一个电子邮件作为url传递的参数
url(r'^admin/detail_consultant_service/((?P<consultant_id>\[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}))/$',
'admin_tool.views.consultant_service_detail', name="consultant_service_detail"),
Run Code Online (Sandbox Code Playgroud)
这是我的模板的内容
{% for consultant in list_consultants %}
<li>
{{consultant.id}}
<a href="{% url consultant_service_detail consultant.id %}">{{ consultant|disp_info }}</a> <br/>
</li>
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
BUt当我访问网址时,我收到错误
everse for 'consultant_service_detail' with arguments '(u'rahul183@gmail.com',)' and keyword arguments '{}' not found.
Run Code Online (Sandbox Code Playgroud)
请帮助我在我的正则表达式中我做错了为什么它不接受这封邮件.这是问题还是其他什么?
有没有办法从django视图进行RESTful api调用?
我试图从django视图传递URL和参数.我在半小时内谷歌搜索,但找不到任何有趣的东西.
任何帮助,将不胜感激
在发布这个问题之前我读了几个帖子,遗憾的是我无法找到适合我的问题的答案.
所以这是我的代码片段
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<!--<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"></script>
<script src="http://goessner.net/download/prj/jsonxml/xml2json.js"></script>
-->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB1Wwh21ce7jnB6yDbjVGN3LC5ns7OoOL4&sensor=false">
</script>
<link rel="stylesheet" type="text/css" href="bd_css">
<!-- javascript code for triggering the download for csv file of businesses-->
<script type="text/javascript">
function populateIframe(id)
{
var ifrm = document.getElementById(id);
ifrm.src = "business_data_to_excel";
}
</script>
<script>
function showCategories(str)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && …
Run Code Online (Sandbox Code Playgroud) 我有一张像..
| id | name | meetingID | meeting_type | status | recurring_time | attendee_passwd | moderator_passwd | date_created | timezone | meeting_datetime | reminder | duration | created_by_id | sms_no | conferenceID | meeting_logout_url | max_participants | participants_id |
+----+------------------+-----------+--------------+--------+----------------+-----------------+------------------+---------------------+-----------+---------------------+----------+----------+---------------+--------+--------------+--------------------+------------------+-----------------+
| 7 | 6august | REG_524 | | NULL | | 90200 | 18614 | 0000-00-00 00:00:00 | GMT 5.45 | 2012-08-06 03:00:00 | 0 | 60 | 1 | 12356 | NULL | http://log.com | 20 | NULL …
Run Code Online (Sandbox Code Playgroud)