url_dir

13 views
Skip to first unread message

Satvir Toor

unread,
Jun 6, 2012, 10:32:11 AM6/6/12
to django...@googlegroups.com
I installed a application source code downloaded from Internet .
Please explain me the following code that exists in urls.py file of
the project.
url(r'^pyrheology/plot/str/(?P<str_tmc_id>\d+).png$',\
'pyrheology.views.str_tmc_plot_img',\
name='pyrheology-str-tmc-plot-img'),

--
Satvir Kaur
satveerkaur.blogspot.in

kooliah

unread,
Jun 6, 2012, 10:36:27 AM6/6/12
to django...@googlegroups.com
On 06/06/2012 12:32 PM, Satvir Toor wrote:
> I installed a application source code downloaded from Internet .
> Please explain me the following code that exists in urls.py file of
> the project.
> url(r'^pyrheology/plot/str/(?P<str_tmc_id>\d+).png$',\
> 'pyrheology.views.str_tmc_plot_img',\
> name='pyrheology-str-tmc-plot-img'),
>
>

https://docs.djangoproject.com/en/1.3/topics/http/urls/

bruno desthuilliers

unread,
Jun 6, 2012, 10:38:54 AM6/6/12
to Django users
On Jun 6, 12:32 pm, Satvir Toor <toor.satvi...@gmail.com> wrote:

> Please explain me the following code that exists in urls.py file of
> the project.
> url(r'^pyrheology/plot/str/(?P<str_tmc_id>\d+).png$',\
>         'pyrheology.views.str_tmc_plot_img',\
>         name='pyrheology-str-tmc-plot-img'),


https://docs.djangoproject.com/en/1.3/topics/http/urls/

Please come back if you still have questions after you've read the
above.

kenneth gonsalves

unread,
Jun 6, 2012, 10:39:09 AM6/6/12
to django...@googlegroups.com
On Wed, 2012-06-06 at 16:02 +0530, Satvir Toor wrote:
> I installed a application source code downloaded from Internet .
> Please explain me the following code that exists in urls.py file of
> the project.
> url(r'^pyrheology/plot/str/(?P<str_tmc_id>\d+).png$',\
> 'pyrheology.views.str_tmc_plot_img',\
> name='pyrheology-str-tmc-plot-img'),

it captures a name of the pattern 'a number of digits'.png and stores it
in a variable called 'str_tmc_id' and sends the same to a view function
called 'str_tmc_plot_img'

(as mentioned before, *please* do the tutorial)
--
regards
Kenneth Gonsalves

yati sagade

unread,
Jun 6, 2012, 10:39:57 AM6/6/12
to django...@googlegroups.com
it says that request to a path(after the project specific url parts are stripped) starting with "pyrheology/plot/str/" followed by one or more digits followed by ".png" (example: pyrheology/plot/str/123.png) will be handled by the view 'pyrheology.views.str_tmc_plot_img' and the number(in the example, 123) will b passed to that view as a keyword parameter called `str_tmc_id`. The last part (name=...) is the name of the url pattern itself.


--
Satvir Kaur
satveerkaur.blogspot.in

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.




--
Yati Sagade

Twitter: @yati_itay

Organizing member of TEDx EasternMetropolitanBypass
http://www.ted.com/tedx/events/4933
https://www.facebook.com/pages/TEDx-EasternMetropolitanBypass/337763226244869


Satvir Toor

unread,
Jun 6, 2012, 10:50:54 AM6/6/12
to django...@googlegroups.com
I read the link
https://docs.djangoproject.com/en/1.3/topics/http/urls/

above unable to understand what is regular expression in url pattern
e.g r'^pyrheology/plot/tensile/(?P<tensile_id>\d+).png$'





--
Satvir Kaur
satveerkaur.blogspot.in

yati sagade

unread,
Jun 6, 2012, 11:02:58 AM6/6/12
to django...@googlegroups.com
it means 1 or more digits (0-9)






 --
 Satvir Kaur
 satveerkaur.blogspot.in

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

bruno desthuilliers

unread,
Jun 6, 2012, 11:53:27 AM6/6/12
to Django users
On Jun 6, 12:50 pm, Satvir Toor <toor.satvi...@gmail.com> wrote:
> I read the linkhttps://docs.djangoproject.com/en/1.3/topics/http/urls/
>
> above unable to understand what is regular expression in url pattern
> e.g r'^pyrheology/plot/tensile/(?P<tensile_id>\d+).png$'

Do you mean "I don't understand where's the regular expression part in
the whole url pattern" or "I don't understand what this regular
expression means" or "I don't understand how it used by the
framework" ?

Daniel Roseman

unread,
Jun 6, 2012, 12:20:12 PM6/6/12
to django...@googlegroups.com
On Wednesday, 6 June 2012 11:50:54 UTC+1, Satvir Kaur wrote:
I read the link
https://docs.djangoproject.com/en/1.3/topics/http/urls/

above unable to understand what is regular expression in url pattern
e.g r'^pyrheology/plot/tensile/(?P<tensile_id>\d+).png$'


Please take the time to formulate your question properly. If you're expecting people to take the time to answer you, it's the very least you can do.
--
DR. 

Satvir Toor

unread,
Jun 6, 2012, 12:36:18 PM6/6/12
to django...@googlegroups.com
> Please take the time to formulate your question properly. If you're
> expecting people to take the time to answer you, it's the very least you can
> do.
sure Sir



--
Satvir Kaur
satveerkaur.blogspot.in
Reply all
Reply to author
Forward
0 new messages