Noob question

11 views
Skip to first unread message

Jason Mayfield

unread,
Sep 25, 2008, 7:25:22 PM9/25/08
to django-hotclub
Sorry if the answer to this question is completely obvious, but...

I just watched the Djangocon Pinax video, and it looks like Pinax
could provide a nice base platform for a social networking site that
I'm working on. After all, it already includes lots of the individual
apps that I was looking at including. However, I haven't seen any
description or documentation of how to incorporate one's particular
domain-specific objects into Pinax in such a way that it will play
nicely with others. James mentioned "django-things" in the video, but
there's no there there.

It's relatively easy to download Pinax and get it running, but then
what?

That is, while I am comfortable with Django in general, I'm not seeing
how to connect the dots in this particular situation.

Thanks in advance,
Jason

Milan Andric

unread,
Sep 26, 2008, 3:10:49 PM9/26/08
to django-...@googlegroups.com
On Thu, Sep 25, 2008 at 4:25 PM, Jason Mayfield <jwmay...@gmail.com> wrote:
>
> Sorry if the answer to this question is completely obvious, but...
>
> I just watched the Djangocon Pinax video, and it looks like Pinax
> could provide a nice base platform for a social networking site that
> I'm working on. After all, it already includes lots of the individual
> apps that I was looking at including. However, I haven't seen any
> description or documentation of how to incorporate one's particular
> domain-specific objects into Pinax in such a way that it will play
> nicely with others. James mentioned "django-things" in the video, but
> there's no there there.
>

Jason, I for one don't understand what you mean by
domain-specific-objects. Can you enlighten us a little, maybe I'm not
the only one.

The idea is you have to integrate your application with Pinax. Pinax
has established some conventions that work in 20+ apps, but if you
develop something then you have to make it Pinax compatible so it will
work like the other apps.

Hope this helps,

--
Milan

Jason Mayfield

unread,
Sep 26, 2008, 3:50:02 PM9/26/08
to django-...@googlegroups.com
On Sep 26, 2008, at 3:10 PM, Milan Andric wrote:

> Jason, I for one don't understand what you mean by
> domain-specific-objects. Can you enlighten us a little, maybe I'm not
> the only one.

It's a phrase used by James in his presentation at Djangocon to
describe the specific thing that you're socially-networking about.
For instance, for Quisition, it's flashcards. It's the layer that you
put on top of Pinax.

> The idea is you have to integrate your application with Pinax. Pinax
> has established some conventions that work in 20+ apps, but if you
> develop something then you have to make it Pinax compatible so it will
> work like the other apps.

This may be what I'm trying to do, although it doesn't feel right. Is
there any actual description anywhere of these conventions? What I've
seen so far is folks saying that there are some, but never quite what
they are. I may be looking in the wrong place.

Thanks,
Jason

Milan Andric

unread,
Sep 26, 2008, 6:09:36 PM9/26/08
to django-...@googlegroups.com

At this point in time the conventions are in the code. ;) So you have
to find another app to prototype your app from. I think wikiapp is
pretty well designed, but that's just my opinion. I'd recommend
taking a look at the popular apps and making a judgment call on which
one looks most mature. Then model your app after that.

Pinax is under heavy development at the moment, especially with all
the changes from Django 1.0. So the best way to get answers at the
moment is the IRC channels; #pinax and #django-hotclub.

--
Milan

bobhaugen

unread,
Sep 27, 2008, 7:24:58 AM9/27/08
to django-hotclub
On Sep 26, 5:09 pm, "Milan Andric" <mand...@gmail.com> wrote:
> At this point in time the conventions are in the code. ;) So you have
> to find another app to prototype your app from.

Blogs are another one you could emulate. Simpler than wikiapp.

Trey Piepmeier

unread,
Sep 29, 2008, 8:45:43 PM9/29/08
to django-hotclub
Where in the folder structure should one put their own additional apps
where it won't get in the way of the rest of the internal and external
apps in the SVN repository?

Trey Piepmeier

unread,
Sep 29, 2008, 8:49:36 PM9/29/08
to django-hotclub
> Where in the folder structure should one put their own additional apps
> where it won't get in the way of the rest of the internal and external
> apps in the SVN repository?

Actually, let me clarify that a bit more. I know applications can
live anywhere, but what do people tend to do when working with Pinax?
Not only in regards to their own apps, but also media and templates?
I know all of those things can live anywhere, but it's nice to have
all the files for a site live in or near the same area on the
filesystem.

I'm also interested in hearing about how other people incorporate all
the bits and pieces they use for a particular site into a repository
for deployment.

James Tauber

unread,
Sep 29, 2008, 9:18:42 PM9/29/08
to django-...@googlegroups.com
On Sep 29, 2008, at 8:49 PM, Trey Piepmeier wrote:

>
>> Where in the folder structure should one put their own additional
>> apps
>> where it won't get in the way of the rest of the internal and
>> external
>> apps in the SVN repository?
>
> Actually, let me clarify that a bit more. I know applications can
> live anywhere, but what do people tend to do when working with Pinax?
> Not only in regards to their own apps, but also media and templates?
> I know all of those things can live anywhere, but it's nice to have
> all the files for a site live in or near the same area on the
> filesystem.

For cloud27 we just have our own project containing urls.py,
settings.py, site_media and templates and don't use the 'pinax'
directory. Everything else we use exactly as is.

James

Milan Andric

unread,
Sep 29, 2008, 9:21:01 PM9/29/08
to django-...@googlegroups.com


I would probably put it in the pinax/ directory unless it's a
"standalone" or "pluggable" app. From what I gather Pinax is just a
Django project and thusly can be composed simply of a settings.py and
urls.py file. Pinax aims to be that simple one day. The apps that
are still inside of pinax/ are still in the "incubator" as some have
termed it.

I don't see anything wrong with putting your own apps that you are
working on in pinax/ until they are ready to live in their own
separate apps directory/custom site-packages folder. I just had a peak
and that's what these docs (fresh off the presses) suggests, so I may
have guessed right.
http://pinaxproject.com/docs/customization.html

I had a related post last week as well which might prove useful,
relating to template and media dirs.

http://groups.google.com/group/django-hotclub/browse_thread/thread/371df955bd1a6883/3a1676c395ca6ac9?#3a1676c395ca6ac9

Also, this doc seems helpful for working on new applications:
http://code.djangoproject.com/wiki/DosAndDontsForApplicationWriters

The developers are still working on documentation and breathing life
into Pinax, part of that is developing formalized conventions, which
have yet to fully emerge.

Hope this helps,

Milan

Trey Piepmeier

unread,
Sep 29, 2008, 9:55:13 PM9/29/08
to django-hotclub
Milan,

That sounds great. The new official documentation is exactly what I
was looking for. Thanks!

The only thing I would be slightly concerned about is that things
inside the pinax/ folder are changing so often, that I won't get all
the hotness without manually adding it back in.

-Trey

Trey Piepmeier

unread,
Sep 29, 2008, 9:57:21 PM9/29/08
to django-hotclub
> For cloud27 we just have our own project containing urls.py,  
> settings.py, site_media and templates and don't use the 'pinax'  
> directory. Everything else we use exactly as is.

No pinax/ directory at all. Interesting. So the whole point of that
directory is just to show an example of what can be done? Any
development of Pinax proper is outside of that?

Trey Piepmeier

unread,
Sep 29, 2008, 10:17:09 PM9/29/08
to django-hotclub
So your custom project folder should live alongside the original
pinax/ folder inside of the django-hotclub checkout?

So in your deployment you might have: /home/username/public_html/
example_com/public/django-hotclub/custom_project/

Does that sound about right?

Milan Andric

unread,
Sep 30, 2008, 12:06:45 AM9/30/08
to django-...@googlegroups.com

Trey,

Definitely keep it out of your public_html directory. Something like:

/home/<username>/sites/<domain.name>/libs/django-hotclub/
/home/<username>/sites/<domain.name>/logs/
/home/<username>/sites/<domain.name>/etc/
/home/<username>/sites/<domain.name>/uploads/
...

Then there's several ways to deal with the libs/ directory so all the
apps and pinax are on your python path. Take your pick. If you use
the mod_wsgi deploy script from the pinax/deploy/pinax.wsgi then your
paths get setup with modifications to sys.path.
http://code.google.com/p/django-hotclub/source/browse/trunk/pinax/deploy/pinax.wsgi

--
Milan

Trey Piepmeier

unread,
Sep 30, 2008, 12:50:35 AM9/30/08
to django-...@googlegroups.com
> Definitely keep it out of your public_html directory. Something like:

OK, that example was a little confusing. In my setup (based on the
wisdom of the guides on articles.slicehost.com), all of my sites live
in /home/username/public_html/, but the VirtualHost information for
each site is configured to point to
/home/username/public_html/<domain.name>/public/ or similar (with
other folders adjacent to public/ such as log/). So I'm not actually
talking about putting the Django project in the DocumentRoot or
anything foolish like that.

That being said, are you saying that once I make a copy of the
django-hotclub/pinax folder to use for my own project, it should live
in

/home/<username>/sites/<domain.name>/libs/django-hotclub/my_django_project_copied_from_the_pinax_folder

?

Man, it's easy for me to get hung up on these kinds of details! :)
Thanks for your patience.

-Trey

James Tauber

unread,
Sep 30, 2008, 7:07:26 AM9/30/08
to django-...@googlegroups.com

On Sep 29, 2008, at 9:57 PM, Trey Piepmeier wrote:
> No pinax/ directory at all. Interesting. So the whole point of that
> directory is just to show an example of what can be done? Any
> development of Pinax proper is outside of that?

There's not actually much under that directory -- only starter
templates and icons and CSS under site_media. If you're building your
own site you'd want to modify those anyway. All the reusable code is
under separate directories.

James

Trey Piepmeier

unread,
Sep 30, 2008, 8:25:45 PM9/30/08
to django-hotclub

James Tauber

unread,
Sep 30, 2008, 9:04:43 PM9/30/08
to django-...@googlegroups.com
One suggestion:

Don't copy settings.py to localsettings.py

Just use localsettings.py to override settings.py with stuff that is
environment-specific

For example, database, email server info, timezone

James

Milan Andric

unread,
Sep 30, 2008, 9:07:09 PM9/30/08
to django-...@googlegroups.com
On Tue, Sep 30, 2008 at 7:25 PM, Trey Piepmeier <tpiep...@gmail.com> wrote:
>
> Does this sound about right?
>
> http://solutions.treypiepmeier.com/2008/09/30/django-project-using-pinax/

One minor thing you might want to change is

From:
cp settings.py localsettings.py

To:
echo "ROOT_URLCONF = '[name_of_project].urls'" > localsettings.py

You don't need to copy all of settings.py to localsettings.py ... just
specify the overrides. Similarly other settings would get modified.
The localsettings trick is one that makes the production/development
switch easier as well. Typically localsettings.py does not going into
your repo, while settings.py does.

Otherwise looks grand.

I have a django bootstrap script that I could see modifying to work
with Pinax/mod_wsgi someday.
http://snipplr.com/view/5786/bootstrap-a-django-fastcgi-setup/

(Just saw James' post come through, I'll post this anyway since
there's a couple additional tips.)

--
Milan

Justin Lilly

unread,
Sep 30, 2008, 9:50:07 PM9/30/08
to django-...@googlegroups.com
You might also find this bash script useful for taking care of project
setup boilerplate.

http://github.com/justinlilly/webdev_boilerplate/tree/master

I would welcome any input on what needs to be done to make it pinax compatible.

-justin

--
Justin Lilly
Web Developer/Designer
http://justinlilly.com

Trey Piepmeier

unread,
Sep 30, 2008, 9:51:53 PM9/30/08
to django-...@googlegroups.com
> From:
> cp settings.py localsettings.py
>
> To:
> echo "ROOT_URLCONF = '[name_of_project].urls'" > localsettings.py

Very cool. Thanks for the feedback, guys! I've updated the post with that.

BTW, it's cool that you're using Snipplr--I actually work at the
company that does that site.

-Trey

Reply all
Reply to author
Forward
0 new messages