I'm a bit surprised by the error message showing
(?P<faculty_id>[-\w]+) with two \ while your url only use one.

If you want to try quickly different arguments for your reverse tag,
you can use the django shell.

python manage.py shell
>>> from django.urls import reverse
>>> reverse('rrs_class_lists_faculty', kwargs={"faculty_id": 1})

Good luck

2017-05-08 12:16 GMT+02:00 miguel vfx <[email protected]>:
> I got it to work but with a different approach by not passing arguments:
>>
>> <a href="{% url 'rrs_class_lists_summary' %}{{ faculty_name.1 }}/"
>> target="_blank">{{ faculty_name.0 }}
>
>
>>     url(r'^class_lists_summary/$',
>> rrs_views.requires_login(rrs_views.class_lists_summary),
>> name="rrs_class_lists_summary"),
>>
>>     url(r'^class_lists_summary/(?P<faculty_id>[-\w]+)/$',
>> rrs_views.requires_login(rrs_views.class_lists_faculty),
>> name="rrs_class_lists_summary"),
>
>
> Does this make any sense? I would like to use the first one since it's much
> cleaner.
>
>
> On Monday, May 8, 2017 at 5:53:54 PM UTC+8, miguel vfx wrote:
>>
>> Hi,
>>
>> It used to work but after my recent upload, it stopped. Does anyone
>> encountered this kind of error before?
>>
>> It's working fine in my local machine using runserver but not in the
>> production server. I'm basically drag and dropping files. Then renaming the
>>>
>>> os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sym.settings') in views.
>>> I only have that in views.py.
>>
>>
>> After that, I restart the app in supervisorctl.
>>
>> The production server is using gunicorn, nginx. The Django version is
>> 1.10.5 with python 3.5. My local machine is using the same django version (I
>> just updated it) but with python 3.4.
>>
>> Error page:
>>
>>> Exception Type:
>>> NoReverseMatch
>>> Exception Value:
>>> Reverse for 'rrs_class_lists_faculty' with arguments '()' and keyword
>>> arguments '{'faculty_id': ''}' not found. 1 pattern(s) tried:
>>> ['rrs/class_lists_faculty/(?P<faculty_id>[-\\w]+)/$']
>>
>>
>>> <td class="col-xs-12">{{ forloop.counter }}. <a href="{% url
>>> 'rrs_class_lists_faculty' faculty_id=faculty_name.1 %}" target="_blank">{{
>>> faculty_name.0 }}</a></td>
>>
>>
>>>  return render(request, 'rrs_class_list_summary.html', {'errorLS':
>>> errorLS,
>>>
>>>                                                            'feedbackLS':
>>> feedbackLS,
>>>
>>>
>>> 'faculty_link_name_list': faculty_link_name_list,
>>>
>>> ...
>>>
>>>                                                            })
>>
>> urls.py
>>
>>>
>>>      url(r'^class_lists_faculty/(?P<faculty_id>[-\w]+)/$',
>>> rrs_views.requires_login(rrs_views.class_lists_faculty),
>>> name="rrs_class_lists_faculty"),
>>
>>
>> views.py
>>>
>>> def class_lists_faculty(request, faculty_id=''):
>>
>>
>> I have been stuck on this for half a day now. My biggest trouble is its
>> working fine in runserver which really leaves me clueless on what's
>> happening on the web server. I would really appreciate any help. Thank you
>> in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/619b3527-0e30-4fae-ba6c-0d273d336c6d%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Ludovic Coues
+33 6 14 87 43 42

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEuG%2BTZ40%2B-yeQ1x1h42%3DR7s_ivw6QwtvzB31oDUw-5eiviRaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to