Thanks Daniel and Scott for the replies. It certainly has given me a better sense of how to implement something like this in Django, as well as an overall better understanding of Django in general.
This will certainly be a fun project and I can't wait to get started on it as I learn more about the intricacies of django. Thanks again, Bryan On Jul 3, 9:18 am, "Scott Moonen" <[EMAIL PROTECTED]> wrote: > Bryan, here's one way that you might approach it: > > 1. From a model perspective, you probably want to have a model like > Account or Person or Blog that corresponds to the first component of the > URL > path. Then you can have a model like BlogPost or somesuch (maybe other > models like BlogStaticPage, BlogCalendarEntry) that has a ForeignKey > relating back to the top-level Blog model > 2. Create a single Django project and give it responsibility for your web > root. > 3. Now you can have URL dispatching and view methods that consume both > the first component of the url (/friend1) and also the blog page component > (e.g., /post-3). > 4. The tricky part is that you'll need some special logic in the view > method that pulls in the appropriate user-specific template. There are > various ways you can approach that; e.g., have paths to the view template > specified in the Blog model, or perhaps even have the view templates for a > blog contained directly within the database. > > There may be some challenges (esp. #4) with implementing this as a single > Django project, but I think that overall you'll find it a much better > solution than cloning your Django projects. > > -- Scott > > > > On Thu, Jul 3, 2008 at 8:50 AM, bbeaudreault <[EMAIL PROTECTED]> wrote: > > > Hey Daniel, > > > Thanks for the reply. ... Duh! I don't know why I didn't think of > > that. There are so many foreign aspects of this to me (yes I come > > from a mod_perl, php background). > > > I can give some more information to hopefully help me grasp this just > > that bit more. > > > Basically I am creating my own custom blog site for me and a few of my > > friends. We have wanted our own for a while, but I also have been > > wanting a project to work on so I don't want to use an already created > > one (I have a few ideas of my own that I haven't seen in others that I > > want to attempt). I started it in PHP, but then noticed django and > > decided to try a new approach to the whole thing. > > > So basically when I roll it out, the website would have no blogs on > > it, just a front page welcoming me and possibly displaying some > > statistics or news on it and allowing register/login. So if I were > > the first to create an account, I would gain access to > >www.mysite.com/bbeaudreault > > or whatever and the corresponding apps therein. If my friend > > registered they would get the same,www.mysite.com/friend1 > > > The kicker is I want them to be able to completely customize the look > > of their blog. From positioning of the different modules (like recent > > posts, calendar, etc being moved from left to right to top) to color > > scheme, to images on it, and of course disabling certain modules (if > > they don't want a calendar). Sure this may be more complicated than a > > blog has to be, but these will be added over time and will present a > > nice little project for myself in adding them as I go. > > > I guess now that I think of it more (if I am hopefully gaining a > > better grasp), when a new user is created I would have to automate an > > adding of a new url to the urls.py file. And I could probably store > > the resulting CSS from moving modules around, as well as flags for > > enabled/disabled modules in the DB for each user as well. > > > Does this sound more in line with django's design philosophy? > > > Oh, and yea I went through the tutorial, and it is great for the > > simple website kinda thing. I am just having a hard time > > extrapolating that to what I have in mind for this site (explained > > above) > > > Thanks again, > > Bryan > > > On Jul 3, 3:33 am, Daniel Hepper <[EMAIL PROTECTED]> wrote: > > > Hi Bryan, > > > > maybe I don't quite get what you are trying to do. > > > > URLs > > > likewww.mysite.com/Foo/don't<http://likewww.mysite.com/Foo/don%27t>relate > > > to filesystem paths > > > (like /home/django/Foo). They are mapped to python functions. This might > > > confuse you if you come from a PHP background. Usually you don't clone > > > project, apps or any kind of code for each user. You have one project > > > which consists of several apps, the information for each user is taken > > > from the database. > > > > Have you gone through the tutorial? > >http://www.djangoproject.com/documentation/tutorial01/ > > > > Maybe you can explain what kind of site you have in mind if you really > > > think you have to clone apps or projects. > > > > Regards, > > > Daniel > > > > Am Mittwoch, den 02.07.2008, 21:42 -0700 schrieb bbeaudreault: > > > > > Hello all, > > > > > I just recently started playing around with django, and I am > > > > interested in using it to create a site I have in mind. I would > > > > appreciate any help in understanding if I have wrapped my head around > > > > the idea of projects and apps properly. > > > > > Basically, the site would have a main page that displays generic info > > > > from the DB and allows uers to login/register. > > > > > When a new user registers, it would create a new subfolder of the > > > > domain, which would be a clone of some django app/project (the part I > > > > dont get). > > > > > So, if I understand this correctly (and I probably don't :) ), I would > > > > have the following: > > > > > /home/django/website (would contain the basic info from the DB, > > > > registering/logging in, etc) > > > > /home/django/default (would contain a bunch of apps for the various > > > > functions a user would have access to) > > > > > So let's say the user "Foo" registers .. I would clone the default > > > > project to > > > > > /home/django/Foo > > > > > so the person would be able to access their specific site > > atwww.mysite.com/Foo/. > > > > > Now hopefully you understand where I am going with this, whether or > > > > not I have it correctly. Now, the other way I thought this might > > > > happen is like this, with 1 parent project and a bunch of apps and sub- > > > > apps that are all cloned instead of separate projects > > > > > /home/django/mysite (the default site, would contain such apps as > > > > "login" or whatever) > > > > /home/django/mysite/default (an app inside mysite project, containing > > > > various sub-apps?) > > > > /home/django/mysite/Foo (the default app was cloned to a new app named > > > > after the user) > > > > > Now, I am having a hard time figuring out which way is the right way, > > > > or if it is even possible to have "sub-apps" ... Should I be working > > > > with separate projects here, or separate apps within 1 parent project. > > > > > The actual cloning process is probably a problem for another day, but > > > > I am really just looking for some guidance or information as to which > > > > of these methods is possible/preferred. > > > > > Thanks, and if I haven't explained myself properly please feel free to > > > > ask for clarification. Like I said, I am still trying to grok the > > > > whole thing. > > > > > -Bryan > > --http://scott.andstuff.org/|http://truthadorned.org/ --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---