Understanding Pinax

13 views
Skip to first unread message

ptone

unread,
Nov 3, 2009, 9:49:38 AM11/3/09
to Pinax Users
I'm taking some time to understand how Pinax is put together before I
commit to it for a project. I wanted to know how the pinax apps
depended on each other, so I wrote a script that uses the modulefinder
module to graph out where the the apps use each other in a stock
social project:

http://ptone.com/temp/pinax_graph.json (best viewed in firefox's
native json viewer)

I then used pygraphviz to graph this visually:

http://www.ptone.com/temp/pinax-dot.png

http://www.ptone.com/temp/pinax-circo.png

The ultimate goal is to help come up with some docs that help answer
the perennial question "if I start with basic project, how can I add
certain apps from social project in". So eventually I want to look
into how to introspect urls.py files and template tag usage.

-Preston

James Tauber

unread,
Nov 3, 2009, 9:53:29 AM11/3/09
to pinax...@googlegroups.com
First of all, thanks for doing this.

Couple of comments:

1. need to distinguish *requirements* from *optionally supported* —
lots of apps CAN use mailer or notification but don't require them
2. some of these dependencies are really bugs in our apps that we
should fix for 0.9

James

sste...@gmail.com

unread,
Nov 3, 2009, 10:08:52 AM11/3/09
to pinax...@googlegroups.com, ptone

On Nov 3, 2009, at 9:49 AM, ptone wrote:

Wow...that's flippin' awesome.

I would love to use that tool to analyze some of my projects that
incorporate some libraries with dependencies I don't really have a
good grasp of.

Would you consider making a github or bitbucket project of it?

Thanks,

S

ptone

unread,
Nov 3, 2009, 11:17:34 AM11/3/09
to Pinax Users


On Nov 3, 6:53 am, James Tauber <jtau...@jtauber.com> wrote:
> First of all, thanks for doing this.
>
> Couple of comments:
>
> 1. need to distinguish *requirements* from *optionally supported* —  
> lots of apps CAN use mailer or notification but don't require them

What sorts of approaches do you suggest for distinguishing between
these? - is it just a matter of looking at the code?

Also a flaw as I see it for my purposes, is that modulefinder will
list implicit exports - that is, if x imports notifications.models,
then it's graphed adjacent to mailer, but its really that mailer is
adjacent to notifications.

> 2. some of these dependencies are really bugs in our apps that we  
> should fix for 0.9

Well, hopefully some refinement of this little tool can eventually
help you guys out ;-)

>
> James
>
> On Nov 3, 2009, at 9:49 AM, ptone wrote:
>
>
>
>
>
> > I'm taking some time to understand how Pinax is put together before I
> > commit to it for a project.  I wanted to know how the pinax apps
> > depended on each other, so I wrote a script that uses the modulefinder
> > module to graph out where the the apps use each other in a stock
> > social project:
>
> >http://ptone.com/temp/pinax_graph.json(best viewed in firefox's

ptone

unread,
Nov 3, 2009, 11:19:18 AM11/3/09
to Pinax Users


On Nov 3, 7:08 am, "sstein...@gmail.com" <sstein...@gmail.com> wrote:
> On Nov 3, 2009, at 9:49 AM, ptone wrote:
>
>
>
>
>
>
>
> > I'm taking some time to understand how Pinax is put together before I
> > commit to it for a project.  I wanted to know how the pinax apps
> > depended on each other, so I wrote a script that uses the modulefinder
> > module to graph out where the the apps use each other in a stock
> > social project:
>
> >http://ptone.com/temp/pinax_graph.json(best viewed in firefox's
> > native json viewer)
>
> > I then used pygraphviz to graph this visually:
>
> >http://www.ptone.com/temp/pinax-dot.png
>
> >http://www.ptone.com/temp/pinax-circo.png
>
> > The ultimate goal is to help come up with some docs that help answer
> > the perennial question "if I start with basic project, how can I add
> > certain apps from social project in".  So eventually I want to look
> > into how to introspect urls.py files and template tag usage.
>
> Wow...that's flippin' awesome.
>
> I would love to use that tool to analyze some of my projects that  
> incorporate some libraries with dependencies I don't really have a  
> good grasp of.
>
> Would you consider making a github or bitbucket project of it?

Sure - its a bit hackish and not very optimized right now - but I'll
see if I can get it cleaned up a bit more.

-Preston

>
> Thanks,
>
> S

ptone

unread,
Nov 3, 2009, 12:18:01 PM11/3/09
to Pinax Users
OK - I've updated the graphs and data to only include explicitly
imported apps - but it still doesn't check if something is required -
that's OK for me as I'm interested in how apps might be using other
apps. The dot format graph is now much cleaner - I simply updated the
existing links.

http://ptone.com/temp/pinax_graph.json
http://www.ptone.com/temp/pinax-dot.png
http://www.ptone.com/temp/pinax-circo.png

Also I put the two files up on github - the use of modulefinder makes
the first step run pretty slow, but I think in the end is easier the
writing a custom parser or regex tool

http://gist.github.com/225231

On Nov 3, 8:19 am, ptone <pres...@ptone.com> wrote:
> On Nov 3, 7:08 am, "sstein...@gmail.com" <sstein...@gmail.com> wrote:
>
>
>
>
>
> > On Nov 3, 2009, at 9:49 AM, ptone wrote:
>
> > > I'm taking some time to understand how Pinax is put together before I
> > > commit to it for a project.  I wanted to know how the pinax apps
> > > depended on each other, so I wrote a script that uses the modulefinder
> > > module to graph out where the the apps use each other in a stock
> > > social project:
>
> > >http://ptone.com/temp/pinax_graph.json(bestviewed in firefox's

sste...@gmail.com

unread,
Nov 3, 2009, 12:33:27 PM11/3/09
to pinax...@googlegroups.com
On Nov 3, 2009, at 12:18 PM, ptone wrote:

>
> OK - I've updated the graphs and data to only include explicitly
> imported apps - but it still doesn't check if something is required -
> that's OK for me as I'm interested in how apps might be using other
> apps. The dot format graph is now much cleaner - I simply updated the
> existing links.
>
> http://ptone.com/temp/pinax_graph.json
> http://www.ptone.com/temp/pinax-dot.png
> http://www.ptone.com/temp/pinax-circo.png
>
> Also I put the two files up on github - the use of modulefinder makes
> the first step run pretty slow, but I think in the end is easier the
> writing a custom parser or regex tool
>
> http://gist.github.com/225231

Awesome! I'm applying it to a graph of a web site map -- I'll send
over any improvements/changes when I get it working.

Pretty cool stuff...

S

ptone

unread,
Nov 3, 2009, 12:42:23 PM11/3/09
to Pinax Users
Sorry to keep piling on this thread - but for anyone else working to
learn pinax - I'll share the output of the django-extensions
graph_models output in case you don't have the required bits
installed:

http://www.ptone.com/temp/pinax-social-models.png

-Preston

sste...@gmail.com

unread,
Nov 3, 2009, 1:51:34 PM11/3/09
to pinax...@googlegroups.com

On Nov 3, 2009, at 12:42 PM, ptone wrote:

>
> Sorry to keep piling on this thread - but for anyone else working to
> learn pinax - I'll share the output of the django-extensions
> graph_models output in case you don't have the required bits
> installed:
>
> http://www.ptone.com/temp/pinax-social-models.png

Was this generated with the same code up on github?

S

ptone

unread,
Nov 3, 2009, 2:37:59 PM11/3/09
to Pinax Users
No this is stock in pinax - its part of django-extensions which is
part of the standard pinax requirements - from your pinax project:

./manage.py graph_models -a -g -o my_project_visualized.png

However you need a working graphviz/pygraphviz install - and I figured
some people didn't, so I figured I'd post.

At some point one of these for each project type could/should be
posted in the docs (could all be automated of course - when everyone
gets extra days in the week ;-)

-Preston

>
> S

sste...@gmail.com

unread,
Nov 3, 2009, 6:01:33 PM11/3/09
to pinax...@googlegroups.com

On Nov 3, 2009, at 2:37 PM, ptone wrote:
>>
>>> http://www.ptone.com/temp/pinax-social-models.png
>>
>> Was this generated with the same code up on github?
>
> No this is stock in pinax - its part of django-extensions which is
> part of the standard pinax requirements - from your pinax project:
>
> ./manage.py graph_models -a -g -o my_project_visualized.png
>
> However you need a working graphviz/pygraphviz install - and I figured
> some people didn't, so I figured I'd post.
>
> At some point one of these for each project type could/should be
> posted in the docs (could all be automated of course - when everyone
> gets extra days in the week ;-)

The things ya' learn just hangin' out on mailing lists...

Thanks!

S

ptone

unread,
Nov 4, 2009, 5:17:17 PM11/4/09
to Pinax Users
Another quick little tool to scan and look for use of "settings.*" in
apps to determine what settings could be used:

http://www.ptone.com/misc/pinax_settings

-Preston


On Nov 3, 6:49 am, ptone <pres...@ptone.com> wrote:
> I'm taking some time to understand how Pinax is put together before I
> commit to it for a project.  I wanted to know how the pinax apps
> depended on each other, so I wrote a script that uses the modulefinder
> module to graph out where the the apps use each other in a stock
> social project:
>
> http://ptone.com/temp/pinax_graph.json(best viewed in firefox's

James Tauber

unread,
Nov 8, 2009, 8:06:05 AM11/8/09
to pinax...@googlegroups.com
This is great and will help with http://code.pinaxproject.com/tasks/task/176/
Reply all
Reply to author
Forward
0 new messages