NoReverseMatch at /polls/1/

2015-10-04 Thread jahan
Hi Django group,

I'm following the tutorial and get stuck on *part 3, Removing hardcoded 
URLs in templates*

I read through the topics that discuss this, but can't find the issue in my 
case.

my *detail.html* template looks like 

{{ question.question_text }}

{% for choice in question.choice_set.all %}
{{ choice.choice_text }}

{% endfor %}



in my urls.py for the polls project I have 

urlpatterns = [
 url(r'^$', 'index', name="index"),
 url(r'^(?P\d+)/$', views.detail, name="detail"),
 url(r'^(?P\d+)/results/$', 'results', name="results"),
 url(r'^(?P\d+)/vote/$', 'vote', name="vote"),
]

Thanks for any suggestion,
jack

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/298b2f49-8374-4e54-bfd3-639a7de3af7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: NoReverseMatch at /polls/1/

2015-10-04 Thread jahan
Hi James,

This is the error

NoReverseMatch at /polls/1/ 

Reverse for 'detail' with arguments '(1,)' and keyword arguments '{}' not 
found. 0 pattern(s) tried: []

Request Method: GET Request URL: http://localhost:8000/polls/1/ Django 
Version: 1.8.4 Exception Type: NoReverseMatch Exception Value: 

Reverse for 'detail' with arguments '(1,)' and keyword arguments '{}' not 
found. 0 pattern(s) tried: []

Exception Location: 
/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py 
in _reverse_with_prefix, line 496 Python Executable: /usr/bin/python Python 
Version: 2.7.3 Python Path: 

['/var/www/django/mysite',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PIL',
 '/usr/lib/python2.7/dist-packages/gst-0.10',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
 '/usr/lib/python2.7/dist-packages/ubuntuone-installer',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']

Server time: Sun, 4 Oct 2015 19:31:13 + 
Error during template rendering 

In template /var/www/django/mysite/polls/templates/polls/detail.html, error 
at line *4*
Reverse for 'detail' with arguments '(1,)' and keyword arguments '{}' not 
found. 0 pattern(s) tried: [] 1 {{ question.question_text }} 2  
3 {% for choice in question.choice_set.all %} 4 {{ choice.choice_text }} 5 {% endfor %} 6 
 
7 


On Sunday, October 4, 2015 at 9:04:48 PM UTC+2, James Schneider wrote:
>
> Can you paste the entire error? 
>
> Also, read through the error page, it should show you which line is 
> causing the problem.
>
> -James
> On Oct 4, 2015 9:24 AM, "jahan" > wrote:
>
>> Hi Django group,
>>
>> I'm following the tutorial and get stuck on *part 3, Removing hardcoded 
>> URLs in templates*
>>
>> I read through the topics that discuss this, but can't find the issue in 
>> my case.
>>
>> my *detail.html* template looks like 
>>
>> {{ question.question_text }}
>> 
>> {% for choice in question.choice_set.all %}
>> {{ choice.choice_text }}
>> 
>> {% endfor %}
>> 
>>
>>
>> in my urls.py for the polls project I have 
>>
>> urlpatterns = [
>>  url(r'^$', 'index', name="index"),
>>  url(r'^(?P\d+)/$', views.detail, name="detail"),
>>  url(r'^(?P\d+)/results/$', 'results', name="results"),
>>  url(r'^(?P\d+)/vote/$', 'vote', name="vote"),
>> ]
>>
>> Thanks for any suggestion,
>> jack
>>
>> -- 
>> 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 django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/298b2f49-8374-4e54-bfd3-639a7de3af7f%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/298b2f49-8374-4e54-bfd3-639a7de3af7f%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/370a3815-c5c7-4eb7-bd50-cfd689a44c96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: NoReverseMatch at /polls/1/

2015-10-04 Thread jahan
This is my mysite/url,py

from django.contrib import admin

urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^polls/', include('polls.urls',namespace = "polls")),
].



On Sunday, October 4, 2015 at 9:43:46 PM UTC+2, James Schneider wrote:
>
> My guess it's that your polls/urls.py file is not being processed/included 
> properly since none of your URL patterns were even tried.
>
> What does your mysite/urls.py file look like?
>
> -James
> On Oct 4, 2015 12:35 PM, "jahan" > wrote:
>
>> Hi James,
>>
>> This is the error
>>
>> NoReverseMatch at /polls/1/ 
>>
>> Reverse for 'detail' with arguments '(1,)' and keyword arguments '{}' not 
>> found. 0 pattern(s) tried: []
>>
>> Request Method: GET Request URL: http://localhost:8000/polls/1/ Django 
>> Version: 1.8.4 Exception Type: NoReverseMatch Exception Value: 
>>
>> Reverse for 'detail' with arguments '(1,)' and keyword arguments '{}' not 
>> found. 0 pattern(s) tried: []
>>
>> Exception Location: 
>> /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py 
>> in _reverse_with_prefix, line 496 Python Executable: /usr/bin/python Python 
>> Version: 2.7.3 Python Path: 
>>
>> ['/var/www/django/mysite',
>>  '/usr/lib/python2.7',
>>  '/usr/lib/python2.7/plat-linux2',
>>  '/usr/lib/python2.7/lib-tk',
>>  '/usr/lib/python2.7/lib-old',
>>  '/usr/lib/python2.7/lib-dynload',
>>  '/usr/local/lib/python2.7/dist-packages',
>>  '/usr/lib/python2.7/dist-packages',
>>  '/usr/lib/python2.7/dist-packages/PIL',
>>  '/usr/lib/python2.7/dist-packages/gst-0.10',
>>  '/usr/lib/python2.7/dist-packages/gtk-2.0',
>>  '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
>>  '/usr/lib/python2.7/dist-packages/ubuntuone-client',
>>  '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
>>  '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
>>  '/usr/lib/python2.7/dist-packages/ubuntuone-installer',
>>  '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
>>
>> Server time: Sun, 4 Oct 2015 19:31:13 + 
>> Error during template rendering 
>>
>> In template /var/www/django/mysite/polls/templates/polls/detail.html, 
>> error at line *4*
>> Reverse for 'detail' with arguments '(1,)' and keyword arguments '{}' not 
>> found. 0 pattern(s) tried: [] 1 {{ question.question_text }} 2  
>> 3 {% for choice in question.choice_set.all %} 4 {{ choice.choice_text }} 5 {% endfor 
>> %} 6  7 
>>
>>
>> On Sunday, October 4, 2015 at 9:04:48 PM UTC+2, James Schneider wrote:
>>>
>>> Can you paste the entire error? 
>>>
>>> Also, read through the error page, it should show you which line is 
>>> causing the problem.
>>>
>>> -James
>>> On Oct 4, 2015 9:24 AM, "jahan"  wrote:
>>>
>>>> Hi Django group,
>>>>
>>>> I'm following the tutorial and get stuck on *part 3, Removing 
>>>> hardcoded URLs in templates*
>>>>
>>>> I read through the topics that discuss this, but can't find the issue 
>>>> in my case.
>>>>
>>>> my *detail.html* template looks like 
>>>>
>>>> {{ question.question_text }}
>>>> 
>>>> {% for choice in question.choice_set.all %}
>>>> {{ choice.choice_text 
>>>> }}
>>>> {% endfor %}
>>>> 
>>>>
>>>>
>>>> in my urls.py for the polls project I have 
>>>>
>>>> urlpatterns = [
>>>>  url(r'^$', 'index', name="index"),
>>>>  url(r'^(?P\d+)/$', views.detail, name="detail"),
>>>>  url(r'^(?P\d+)/results/$', 'results', name="results"
>>>> ),
>>>>  url(r'^(?P\d+)/vote/$', 'vote', name="vote"),
>>>> ]
>>>>
>>>> Thanks for any suggestion,
>>>> jack
>>>>
>>>> -- 
>>>> 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

Re: NoReverseMatch at /polls/1/

2015-10-05 Thread jahan
Hi James,

That was it! thanks a bunch for pointing that out.

cheers,
Jack


On Sunday, October 4, 2015 at 11:03:03 PM UTC+2, James Schneider wrote:
>
> > This is my mysite/url,py
> >
> > from django.contrib import admin
> >
> > urlpatterns = [
> > url(r'^admin/', include(admin.site.urls)),
> > url(r'^polls/', include('polls.urls',namespace = "polls")),
> > ].
> >
>
> Oh, yep, there's the problem. You added a namespace called 'polls' but you 
> aren't referencing it in your template, so the URL resolver isn't using 
> your polls/urls.py file for that {% url %} call. You probably forgot to 
> update the {% url %} tag after the tutorial portion that added the 
> namespace to the mysite/urls.py file.
>
> You need to update your {% url %} tag to use 'polls:detail' rather than 
> just 'detail'. 
>
> See the last code box on that tutorial page: 
> https://docs.djangoproject.com/en/1.8/intro/tutorial03/#namespacing-url-names
>
> -James
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a03945b3-6522-4ed1-ae2d-40b12eeebb8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Live video streaming from ffserver

2016-05-26 Thread Jahan Balasubramaniam
Hi

I have setup a ffserver which provides live video stream in the local 
network over http.

What I want is django app which enables me to do some authentication stuff 
and stream from local network to outside world.

I have more than decent amount of knowledge in Django and have done dozen 
projects using django framework.

I m very much clueless and even wondering how to begin with this.

If anyone with knowledge on how to accomplish this sort of stuff could 
provide some guidance would be helpful.

Even just a hint or starting tip off would be of great help.

Regards
Jahan

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/01b0be1b-cc37-41c9-b747-d7e329407a92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Live video streaming from ffserver

2016-05-27 Thread Jahan Balasubramaniam
Thanks. This worked like charm.. It was so easy and simple to setup.

On Thursday, 26 May 2016 21:51:39 UTC+8, Stefano Probst wrote:
>
> Hi,
> eventual something like X-Accel-Redirect can help to do this without a 
> performance penalty. See 
> https://wellfire.co/learn/nginx-django-x-accel-redirects/ Serving 
> protected upstream services
>
>
> Am Donnerstag, 26. Mai 2016 13:44:02 UTC+2 schrieb Jahan Balasubramaniam:
>>
>> Hi
>>
>> I have setup a ffserver which provides live video stream in the local 
>> network over http.
>>
>> What I want is django app which enables me to do some authentication 
>> stuff and stream from local network to outside world.
>>
>> I have more than decent amount of knowledge in Django and have done dozen 
>> projects using django framework.
>>
>> I m very much clueless and even wondering how to begin with this.
>>
>> If anyone with knowledge on how to accomplish this sort of stuff could 
>> provide some guidance would be helpful.
>>
>> Even just a hint or starting tip off would be of great help.
>>
>> Regards
>> Jahan
>>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/fb709e1b-7363-4d12-8948-71aee56de460%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Live video streaming from ffserver

2016-05-27 Thread Jahan Balasubramaniam
Thanks. However dint try this because solution provided by Stefano was 
simple and easy to implement and dint affect the performance much.

On Thursday, 26 May 2016 19:48:27 UTC+8, Javier Rivera wrote:
>
> You can try to use a proxy. Maybe not the most performance-wise idea in 
> the world, but it could work. 
>
> You can try this: 
>
> http://django-http-proxy.readthedocs.io/en/stable/ 
>
> Best regards, 
>
> Javier. 
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/218b51fb-b25c-4b05-ba4b-6a25e79a5206%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.