On 5 February 2012 17:16, Tom Lesters <[email protected]> wrote:
> hi all,
>
> I installed an app called idios into python2.6/site-packages/idios dir,
>
> now I need to make a small change, adding the following line(just for
> purpose of explaining this question)
> @login_required
> to one of the functions defined in idios/views.py
>
> The way I can think of is I can copy all the app's source .py files into my
> project/apps dir, then I can make whatever changes I want,
> but seems that's against the principle of using those apps as library.
> is there a better way of doing that?
>
> or it's just the nature of any django apps:
> if you need to modify anything in the urls.py ,views.py or models.py,
> you just grab the source and make is as a local project app?
>
> I know for template files I can just copy individual file into my project
> dir and leave the rest under /site-packages,
> but how about the .py files?
>

One way you could do this is to copy the urls.py from idios into your
urls.py and wrap just that url pattern with
login_required:


url(r'^blah/$', login_required(views.blah), name = 'idios_blah')


HTH
Dan




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



-- 
Dan Hilton
============================
www.twitter.com/danhilton
www.DanHilton.co.uk
============================

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

Reply via email to