Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Is there a tool to check which views are used? [RSS Feed]

#1 Jan. 27, 2011 15:02:50

A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Is there a tool to check which views are used?


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 Managerhttp://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 django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 27, 2011 15:05:44

Sven B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Is there a tool to check which views are used?


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 django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Jan. 27, 2011 15:25:32

Jirka V.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Is there a tool to check which views are used?


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 django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » Is there a tool to check which views are used? [RSS Feed]

Board footer

Moderator control

Enjoy the 17th of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support