Generate django project API docs
It was not as easy as I expected but I found it out. Creating the a django project’s API doc is pretty easy once you know how! Unfortunately there is a bug in the django integrated doc that you can reach via the admin interface by /admin/doc/ but it is also far less complete (if it would entirely work) than what a pydoc offers.
One problem with both tries the django admin doc and the pydoc was that we are using a lot of decorators for view functions. Decorators such as “login_required” or “transaction.commit_on_success” and the doc generators both either ignored those functions or linked wrong (django admin doc).
So I decided I want the real API docs and done, that is what most devs are best familiar with. But to get that you need to fiddle a little bit with the setup of django and export some variables in order to properly make doc generation work. We used epydoc for generating the docs, it throws out the nice frame-based javadoc like view, I find that quite handy.
Here is how it goes:
export PYTHONPATH=$PYTHONPATH:/Users/wolfram/projectname/trunk/- extend the python path so that it also find your projectexport DJANGO_SETTINGS_MODULE=projectname.settings- set the required django variable/Library/Frameworks/Python.framework/Versions/2.4/bin/epydoc --html --parse-only --docformat plaintext re -v projectnamemake epydoc generate the docs
epydoc will create a directory named “html” and put all the docs in there, open the index.html in your browser and you are all fine. Happy doc reading …
SmileyChris said,
June 16, 2007 at 7:41 am
If you’re running Django trunk on a local dev server, you should check out my Django docs app - then you can access the latest docs (it updates the html if the .txt file is newer) looking all pretty and nice using the Django admin CSS.
http://smileychris.tactful.co.nz/ramblings/django-documentation/
Hugo Pineda said,
July 31, 2009 at 6:17 am
Thanks a lot!!!!!! You saved mi life!
James Pearce said,
September 4, 2009 at 8:22 am
Very useful. I found this didn’t get me into any of the apps though.
For me, this was more comprehensive:
epydoc –html –parse-only –docformat plaintext -v /Users/James/…/projectname/apps/* projectname
(The file wildcard argument gets each of the apps)
In fact, if you pass the project folders in as arguments, I’m not even sure you need the exports.
Shawn Marzolf said,
November 21, 2010 at 12:08 am
Nicely stated. I hardly ever believed I would concur with this opinion, but I’m starting to view things from a different view. I’ve to study more on this since it looks really exciting. A single matter I really don’t recognize nevertheless is how every thing is related together.
samochody z niemiec said,
December 6, 2011 at 1:42 pm
Hello.Excellent post, really educational. I surprise why the opposite specialists in this sector do not recognize this. You must proceed your producing.Best regards from Italy.
tabletki odchudzające said,
December 24, 2011 at 10:37 pm
Hi There is obviously a lot to know about this. I think you made some good points in Features also.Keep working ,great job!Best regards from Italy.
moncler spaccio said,
December 25, 2011 at 4:55 pm
In the great pattern of things you receive an A+ just for effort. Where exactly you misplaced everybody ended up being on your specifics. You know, they say, the devil is in the details… And it could not be much more correct in this article. Having said that, permit me tell you just what exactly did give good results. The authoring is definitely highly persuasive and that is most likely the reason why I am making the effort in order to opine. I do not make it a regular habit of doing that. Secondly, while I can certainly notice the jumps in reason you come up with, I am not sure of how you seem to unite the ideas that make your conclusion. For now I shall subscribe to your issue however hope in the future you actually link the facts much better.
Cheap Johnathan Joseph Jersey said,
January 12, 2012 at 7:50 am
Thanks for your sharing! I agree it could possibly be improved with some a lot more breathing space above, fortunately that space is dark and may be completed simply with PP when required.
Risa Lulow said,
January 18, 2012 at 2:43 pm
I just couldn’t depart your web site before suggesting that I extremely enjoyed the standard information a person provide for your visitors? Is going to be back often in order to check up on new posts
Alene Ouye said,
February 8, 2012 at 3:35 pm
Superb review. Mirrored my own emotions in the most spooky means!
doradztwo zawodowe said,
February 20, 2012 at 10:26 am
od dawna w skali globalnej,
Fotoksiążka said,
March 15, 2012 at 10:25 pm
Oh my goodness! an amazing article dude. Thank you Nonetheless I am experiencing difficulty with ur rss . Don’t know why Unable to subscribe to it. Is there anyone getting similar rss drawback? Anyone who is aware of kindly respond. Thnkx
obiavi said,
April 21, 2012 at 5:23 pm
Thank you for each of your effort on this web site. My niece really likes participating in investigation and it’s really obvious why. A number of us hear all about the compelling form you make both useful and interesting solutions by means of this web blog and encourage participation from some other people about this subject matter then our simple princess is without question understanding a lot. Take pleasure in the remaining portion of the year. Your conducting a brilliant job.
cupones para hostgator said,
May 24, 2012 at 6:29 pm
e, connection between diflucan, retin-a.internet, most affordable propecia costs, celebrex, prednisolone acetate ophthalmic revocation,
Logan Cairns said,
August 4, 2012 at 12:57 am
Aw, this was a really nice post. In concept I wish to put in writing like this moreover – taking time and actual effort to make a very good article… but what can I say… I procrastinate alot and not at all appear to get one thing done.
Aasia Cairns said,
August 5, 2012 at 2:47 am
I’m not sure the place you’re getting your information, however great topic. I needs to spend some time studying much more or understanding more. Thanks for fantastic info I used to be looking for this info for my mission.
Grace356AD said,
September 11, 2012 at 12:50 pm
ÿþT
nirmhaicync said,
September 19, 2012 at 7:07 pm
snsdpmrf sac longchamp qvneholuqr sac longchamp pas cher liyless
schudniecie said,
April 15, 2013 at 6:28 pm
Having read this I thought it was very enlightening. I appreciate you taking the time and energy to
put this short article together. I once again find myself
personally spending way too much time both reading and commenting.
But so what, it was still worthwhile!
null said,
May 2, 2013 at 9:46 pm
I constantly emailed this weblog post page to all my associates,
as if like to read it then my contacts will too.