> I followed the doc and installed Pinax and cloned my (social)
> project.
>
> Now I'm at a loss. The doc is not exactly clear on what to do next.
[writing this after writing response] You've illustrated some
excellent questions we should improve upon in documentation. Hopefully
I've answered them at some level of detail. Let me know if you have
further questions.
> 1) under ~/virtualenv/pinax-env/myproject/apps there are only 3 apps:
> about, friends_app, tag_app. Where do all other apps (eg. django-
> timezones, django-threadedcomments) live? And why aren't they all in 1
> place?
The apps you are seeing in your project are apps that are project-
specific. They are not required by anything other than the project
itself (social_project). When you installed Pinax (running pinax-
boot.py) it created a virtual Python environment. You named it pinax-
env (as the documentation tells you). This directory is intended for
the Python environment only. You cloned the social_project inside the
environment directory. This isn't a great idea as it has a conceptual
flaw. You wouldn't clone projects in /usr would you (effectively the
root of the global Python environment)? That aside, pinax-boot.py has
a list of external apps it must install to create a functional Python
environment for Pinax projects. Let's say that list contains only the
apps django-tagging and django-timezones. Under the hood it runs the
equivalent of:
pip install django-tagging
pip install django-timezones
inside the virtual environment. It doesn't run those commands as-is as
we've made some modifications to allow for the environment to be
created without requiring an Internet connection. The result being
they are installed in the environment for you.
>
> 2) Same with the templates ~/virtualenv/pinax-env/myproject/templates
> dir, which only contains templates for about, account, notification,
> photos, tags. Where are the templates for all other apps?
Similar to project specific apps these are project specific templates.
Back in the day we use to have a ton of duplicated templates at the
project level. This made it a headache for us to keep them up to date
as we added new projects. They've since been refactored as default
base templates. We are working on better documentation that documents
each template. The idea is if you need to make a customization to a
template you simply override it at the project level. This is how
Django's template loading works. If you look at your TEMPLATE_DIRS
setting you can see exactly the order and where Pinax templates live.
Additionally, look at the TEMPLATE_LOADERS setting which outlines
which template loaders to use and in what order. TEMPLATE_DIRS is tied
to the django.template.loaders.filesystem.load_template_source
template loader.
>
> 3) In the doc (http://pinaxproject.com/docs/0.7/customization.html),
> it states that:
> "In the sample projects, templates/base.html is intended for overall
> page structure whereas templates/site_base.html is intended for adding
> site-specific content that is to be found on all pages"
> I only see site_base.html but no base.html under the templates dir. Am
> I missing something?
As I mentioned above, we did a refactor of the templates that used to
live at the project level into default base templates. At the time
when more templates were in the project base.html was one of them. The
section you are reading in the customization documentation is dated.
We certainly need to update it to reflect current state.
Essentially, what it should say that if you want to modify overall
site structure you should likely override these blocks or override the
entire template in your project. At present I don't have that list of
blocks to override, but take a look at the default base.html — http://github.com/pinax/pinax/blob/0.7.X/pinax/templates/default/base.html
>
> 4) If I want to write my own features, where should i put the views,
> models, templates? In a normal django project I'd use the "manage.py
> startapp" command to create an app directory. Do I do the same in
> Pinax, in the ~/virtualenv/pinax-env/myproject/ dir?
Nothing really changes here. The only issue is that we recommend you
put project specific apps in the project apps/ directory and startapp
creates them project directory level. The reason this is critical is
because many people end up relying that their project directory is put
on the sys.path. This is true in manage.py, but isn't the case in any
other environment (such as deployment with mod_python or mod_wsgi).
This can lead to deployment issues and questions such as, "It worked
in runserver, but mod_wsgi can't find my apps".
>
> 5) If I want to add an external apps to Pinax what's the best way to
> do it? For example I'm interested in adding django-socialauth (http://
> github.com/uswaretech/Django-Socialauth). How would I integrate that
> into Pinax?
Installation should be as easy as using pip to install them in your
environment. We've tried very hard to ensure many Django external apps
follow Python packaging guidelines allowing them to be installed with
pip. We've done this with all external apps installed by Pinax. Be
sure to read the app's documentation regarding installation and if it
doesn't involve using easy_install (yuck) or pip then the app author
should be notified to add such support or at least document it!
Integration is going to be very specific to the app. The particular
app you mention may need to interact with Pinax specific stuff to
work. I've never looked at it so I cannot comment if this is true.
However, I can say we will be adding more authentication types
(Facebook and Twitter) in the near future. We already support OpenID
out of the box. It may be worth waiting.
>
> 6)What do I need to do to change the look and feel of Pinax?
I don't normally do this sort of modifications to Pinax installation I
work on. I will say that it should be as easy as coordinating some
template changes with CSS. I'll leave this question to those who have
better working knowledge of this.
>
> There're a great number of files installed by Pinax and I'm a bit
> overwhelmed. Is there a "guided tour to Pinax" that can give me a
> sense of the structure of Pinax and how everything relates to each
> other?
Not quite yet. We are continually improving the documentation and
suggestions like this (though more specific ones are better) are
greatly appreciated. If you head on over to http://
code.pinaxproject.com (create an account) file some tasks to help
improve Pinax!
Brian Rosner
http://oebfare.com
http://twitter.com/brosner
I don't know if I'm very clear but I don't get why my-project
directory shouldn't be in the same directory as pinax-env since it's
anyway in the same virtualenv otherwise my-project is just an empty
shell.