Re: how to make a small change for apps installed under /site-packages dir
On Feb 5, 6:16 pm, Tom Lesters <tomlest...@gmail.com> wrote:
> hi all,
>
> I installed an app called idios into python2.6/site-packages/idios dir,
Which is possibly not a great idea... as you now know <g>.
Generally speaking, using virtualenv (no-site-packages) + pip (with a
requirement file you keep in your project) is a GoodPractice(tm) when
it comes to dependencies.
> 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
Daniel already provided the simplest solution for this problem. For
more involved changes and assuming you prefer not to mess with the
third part app's code, you can also monkeypatch the relevant functions
in your own app.
> 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?
Depends on how much you need to modify the third part app. Forking the
app is sometimes the best solution, but it means you'll have a hard
time keeping in sync with the original code when bugfixes and new
features will be released. Monkeypatching doesn't totally solve this
problem but from experience it makes for easier updates.
My 2 cents...
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home