Is there a tool to check which views are used?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there a tool to check which views are used?

Ale-24
Hi,

I have inherited an old project which I believe has unused views
(useless code), does anyone know of a tool to check which views are
being used? I think it shouldn't be too hard to make one using resolve
but maybe there is one already or maybe I'm talking nonsense.

It doesn't have tests, so I can't check the coverage or find data from there.


Thanks,
--
Alejandro Peralta
Developer and Project Manager
http://www.machinalis.com/

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

Reply | Threaded
Open this post in threaded view
|

Re: Is there a tool to check which views are used?

Sven Bröckling
Hi,

> I have inherited an old project which I believe has unused views
> (useless code), does anyone know of a tool to check which views are
> being used? I think it shouldn't be too hard to make one using resolve
> but maybe there is one already or maybe I'm talking nonsense.
> It doesn't have tests, so I can't check the coverage or find data
> from there.
The django-extensions
(https://github.com/django-extensions/django-extensions) app provide a
command to get all urls from a project, maybe that is a good starting
point :

./manage.py show_urls

hth
  Sven

--
http://djangopeople.net/thejester/

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

Reply | Threaded
Open this post in threaded view
|

Re: Is there a tool to check which views are used?

Jirka Vejrazka
In reply to this post by Ale-24
Unless someone comes up with a smarter idea (I'm sure they will :),
I'd take website logs for the last month or so (depending on your
site), build a list of all successful requests URL's on your site and
then map those to views on your site using standard URL resolver. That
should tell you what views *are* being used with some 99% certainity.

Also, if your site is relatively small, you could insert a small
logging code to the beginning of every view. Just a thought :)

  HTH

    Jirka

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