Performance / Memory/CPU Usage of A Django App with 10,000+ Models in a High Traffic Site

2008-01-13 Thread Sebastian Macias

Hi,

I already posted this on the django developers group and wanted to get
feedback as well from the community as well.

I'm developing a  large webapp using django. One of my requirements
is
that it needs to be able to handle 10,000+ different entities or
models that need to be associated with a user. A single user have
needs to be able to to associate himself with any of the existing
models and have one record per model. Each model will have an average
of 30 fields (each need to be searchable). There will be several
hundred thousands and in some occasions millions of records per model
and we expect to have millions of users using the webapp.

My questions are:

1) Do you recommend using a django model per entity or should I try a
different approach?

2) Will django initiate all of my models on each request? Should I be
concerned about CPU and memory usage?

Thanks a lot in advance.

Sebastian
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Django Quizzes or Questionnaires App

2008-01-08 Thread Sebastian Macias

Basically what I'm looking forward is be able to have a schema-less
model.

Sebastian Macias wrote:
> Hello,
>
> I need to be able to build custom questionnaires with yes/not options,
> multiple options and free text options. The answers must be
> searchable:
>
> I need to query users that took quiz 1 and selected option a and b in
> question x, took quiz 2 and selected option c or d for in question y.
>
> Performance must be really good.
>
> Does anyone know if there is a Django Quizzes or Questionnaires App
> code available anywhere??
>
> If there isn't what would be the best way to achieve something like
> this so saving and searching is fast as if each quiz had its own model
> and table?
>
> Sebastian
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Django Quizzes or Questionnaires App

2008-01-08 Thread Sebastian Macias

Hello,

I need to be able to build custom questionnaires with yes/not options,
multiple options and free text options. The answers must be
searchable:

I need to query users that took quiz 1 and selected option a and b in
question x, took quiz 2 and selected option c or d for in question y.

Performance must be really good.

Does anyone know if there is a Django Quizzes or Questionnaires App
code available anywhere??

If there isn't what would be the best way to achieve something like
this so saving and searching is fast as if each quiz had its own model
and table?

Sebastian
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Looking to Hire 2-3 django Rockstars in San Diego, Solana Beach, CA ...And Remotely.

2007-10-22 Thread Sebastian Macias

Guys,

We at Positive Digital Solutions are looking to hire 2-3 django
rockstars to initially port one of our apps from PHP to django as well
as build some additional awesome features and maintain the app.

Check out the job description and send us an email if you are
interested.

http://sandiego.craigslist.org/eng/454040216.html

Best,

Sebastian Macias
CTO
Positive Digital Solutions
http://www.positivedigitalsolutions.com/


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



ObjectPaginator Performance in Busy Sites

2007-08-31 Thread Sebastian Macias

I'm building an app that requires pagination. I looked at the
official
pagination documentation I found at:

http://www.djangoproject.com/documentation/models/pagination/

I followed the tutorial and basically: paginator =
ObjectPaginator(Article.objects.all(), 5) is where all the "magic"
happens.

What I'm concerned about is that Article.objects.all() will return a
query_set with all of the records. If I have millions of records it
means the returned query_set will be huge and I'm affraid performance
will be poor in and very busy site.

Should I be concerned about this? What are your thoughs?

Thanks,

Sebastian Macias


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Best Practices to Make your Apps Portable

2007-07-27 Thread Sebastian Macias

I just added it to the wiki:

http://code.djangoproject.com/wiki/BestPracticesToWorkWith3rdPartyAppsAndMakingYoursPortable

It's available in the resources page.

http://code.djangoproject.com/wiki/DjangoResources


Best,

Sebastian Macias


On Jul 26, 12:36 pm, Carl Karsten <[EMAIL PROTECTED]> wrote:
> Sebastian Macias wrote:
> > Thanks a lot for the feedback everyone.
>
> > I have come up a perfect setup  and folder structure  (at least
> > perfect for my needs) that will allow me to work on generic apps and
> > project specific apps efficiently and just wanted to share it with
> > everyone in case it can save a anyone a headache.
>
> > *Folder structure for a django project*
>
> > /var/django_root/my_project_name/
> >urls.py
> >settings.py
> >apps/
> >my_project_specific_app_1/
> >my_project_specific_app_2/
> >my_project_specific_app_3/
>
> > *Folder structure for generic/portable apps*
>
> > /var/django_root/shared/
> >my_generic_portable_app_1/
> >my_generic_portable_app_2/
> >my_generic_portable_registration_app/
>
> > *Development Setup*
>
> > I added the following to the top  of my_project_name/settings.py so it
> > appends the portable/generic apps folder to the python path.
>
> > DEVELOPMENT = True
>
> > if DEVELOPMENT:
> > import sys
> > sys.path.append('/var/django_root/shared')
>
> > For extended convenience I symlinked my portable/generic apps folder
> > to my django project so I can quickly make changes to my generic apps
> > without having to go outside my django project folder structure
>
> > ln -s `pwd`/var/django_root/shared /var/django_root/my_project_name/
> > shared
>
> > *Production Setup*
>
> > My Apache conf file:
>
> > 
> >   ServerName championsound.local
> >   ServerAlias *.championsound.local
> >   SetHandler python-program
> >   PythonPath "['/var/django_root', '/var/django_root/shared'] +
> > sys.path"
> >   PythonHandler django.core.handlers.modpython
> >   SetEnv DJANGO_SETTINGS_MODULE championsound.settings
> >   PythonDebug On
> > 
>
> > Note how '/var/django_root' and '/var/django_root/shared' are added to
> > the PythonPath
>
> > Enjoy it!
>
> > Sebastian Macias
>
> Can you post this to the wiki?  or tell me to.  one of us should. :)
>
> Carl K


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Best Practices to Make your Apps Portable

2007-07-25 Thread Sebastian Macias

Thanks a lot for the feedback everyone.

I have come up a perfect setup  and folder structure  (at least
perfect for my needs) that will allow me to work on generic apps and
project specific apps efficiently and just wanted to share it with
everyone in case it can save a anyone a headache.


*Folder structure for a django project*

/var/django_root/my_project_name/
urls.py
settings.py
apps/
my_project_specific_app_1/
my_project_specific_app_2/
my_project_specific_app_3/

*Folder structure for generic/portable apps*

/var/django_root/shared/
my_generic_portable_app_1/
my_generic_portable_app_2/
my_generic_portable_registration_app/


*Development Setup*

I added the following to the top  of my_project_name/settings.py so it
appends the portable/generic apps folder to the python path.

DEVELOPMENT = True

if DEVELOPMENT:
import sys
sys.path.append('/var/django_root/shared')

For extended convenience I symlinked my portable/generic apps folder
to my django project so I can quickly make changes to my generic apps
without having to go outside my django project folder structure

ln -s `pwd`/var/django_root/shared /var/django_root/my_project_name/
shared


*Production Setup*

My Apache conf file:


  ServerName championsound.local
  ServerAlias *.championsound.local
  SetHandler python-program
  PythonPath "['/var/django_root', '/var/django_root/shared'] +
sys.path"
  PythonHandler django.core.handlers.modpython
  SetEnv DJANGO_SETTINGS_MODULE championsound.settings
  PythonDebug On


Note how '/var/django_root' and '/var/django_root/shared' are added to
the PythonPath

Enjoy it!

Sebastian Macias

On Jul 25, 6:19 am, "Adrian Holovaty" <[EMAIL PROTECTED]> wrote:
> On 7/24/07, Sebastian Macias <[EMAIL PROTECTED]> wrote:
>
> > My dilemma is... what is the point of having projects and apps if the
> > applications created for my project won't be portable in other
> > projects (becase the namespaces will always start with the project
> > name). I can't just copy and app from one project to another.
>
> Personally I never use "projects" -- they were just a quick thing we
> made up just before we open-sourced Django, with the thinking being
> "projects" would make it quicker and easier for people to get started.
> They are *not* a good method to use if you want to distribute your
> application, however.
>
> We need better documentation about best practices to make apps portable.
>
> Adrian
>
> --
> Adrian Holovaty
> holovaty.com | djangoproject.com


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Best Practices to Make your Apps Portable

2007-07-24 Thread Sebastian Macias

Today I had issues getting django registration to work in my django
project without having to modify every namespace inside django
registration. Basically what I ended up having to do is adding django
registration to my site-packages folder so I don't get errors like "No
module named registration.urls" and avoid having to change every
namespace in django registration to start with my project name This is
a pain for me as I'm making lots of changes to the django-registration
core. I also looked for help on IRC and was told that any third party
django apps are supposed to be added to the python path or put under
site-packages. This could end up being a tedious task as you would
have to remember what folders need to be copied to site-packages,
symlinked, etc when moving your project to a production server.
Wouldn't it be nice if you can just upload the project and all apps
(3rd party and your own) are inside of it?

My dilemma is... what is the point of having projects and apps if the
applications created for my project won't be portable in other
projects (becase the namespaces will always start with the project
name). I can't just copy and app from one project to another.

Basically what I see is that if I'm developing a web site (a django
project)  and three apps that will be used on it (i.e. a blog, a poll
system, a rating system) and if I want to re use any of these apps in
the future in other projects or make them opensource I need to have a
django project for each app.

I'm still new to python and django (and loving them) and maybe these
are concerns that are easily addressed by methods I'm still not aware
of.

Any thoughts will be greatly appreciated.

Thanks,

Sebastian Macias
digital-telepathy inc


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Please Help with Namespace Issue.

2007-07-24 Thread Sebastian Macias

Hello I'm having this strange problem and was wondering if anyone
knows what might be causing it.

I'm working on a django project called championsound. I integrated
django registration the "regular" way: copied the app folder to my
project folder and added (r'', include('marketing.urls')), to my
project URLs.

When I run the app with the development server everything is fine, I
can go to http://localhost:8000/accounts/login/ and I get no errors
but when I test it using apache/mod_python I get the following error.

ImportError at /
No module named registration.urls

I tried changing (r'', include('registration.urls')),  to (r'',
include('championsound.registration.urls')), and I got one step
further. Now the registration.urls is found but got the following
error.

ImportError at /accounts/login/
No module named registration.views

Then I opened registartion.urls and changed from registration.views
import activate, register, login_with_email with from
championsound.registration.views import activate, register,
login_with_email.

That solved the problem but of course that's not the way of doing
things as I would have to change the namespaces of every single app I
add to my project.

Any help will be appreciated.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Is there any way to custom group models in the admin panel?

2007-07-18 Thread Sebastian Macias

I just opened a ticket for this.

http://code.djangoproject.com/ticket/4918

Sebastian Macias


On Jul 12, 6:37 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 7/12/07,SebastianMacias <[EMAIL PROTECTED]> wrote:
>
>
>
> > By default models are grouped by app. I really need to be able to
> > break down that grouping a little bit more. I will have an app with
> > probably 40-50 models and would like togroupthose logically instead
> > of having them all listed under my app name.
>
> This isn't possible at present. You can collect the fields on an
> individual model into groups, but there isn't currently a mechanism 
> togroupmodels other than by application.
>
> It is an interesting idea though. I would suggestion opening a ticket
> requesting this feature - we are currently rewriting the admin views
> to use newforms. This particular feature probably won't be a target
> for the initial release, but its worth documenting it to make sure we
> don't code ourselves into a corner.
>
> Yours,
> Russ Magee %-)


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Modifying Model Field Attributes on Run Time

2007-07-18 Thread Sebastian Macias

Is there anyway to modify model field attributes on run time.. What
I'm trying to do is to build some logic that will decide whether a
model that is related to other model should be edited or not inline in
the admin.

Basically: "client = models.ForeignKey(Client, unique=True,
edit_inline = True, core=True)" should be changed to client =
models.ForeignKey(Client, unique=True, edit_inline = False) on run
time.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Is there any way to custom group models in the admin panel?

2007-07-11 Thread Sebastian Macias

By default models are grouped by app. I really need to be able to
break down that grouping a little bit more. I will have an app with
probably 40-50 models and would like to group those logically instead
of having them all listed under my app name.

Thanks,

Sebastian


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: User Friendly Parent Categories in Admin Panel

2007-06-13 Thread Sebastian Macias

Thanks Chris. I think this is going to help a lot. I might simplify
the model a little and update the wiki so others with the same
question can find a quick solution.

Sebastian Macias

On Jun 12, 6:33 am, "Chris Moffitt" <[EMAIL PROTECTED]> wrote:
> You can see the category model we use in Satchmo here 
> -http://www.satchmoproject.com/trac/browser/satchmo/trunk/satchmo/prod...
>
> Here's a template tag we use to build an HTML hierarchy of the categories 
> -http://www.satchmoproject.com/trac/browser/satchmo/trunk/satchmo/shop...
>
> You can see the various parts in action on the demo store here 
> -http://www.satchmoproject.com/shop/
>
> I hope this helps.
>
> -Chris


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



User Friendly Parent Categories in Admin Panel

2007-06-11 Thread Sebastian Macias

Hello Guys, I'm pretty new to django. I'm coming from cakephp. I have
been searching all over for a way to do this but since I didn't find a
solution I though I would ask.

I did find this http://code.djangoproject.com/wiki/CookBookCategoryDataModel
but I tried and it didn't work, the code is out of date.

So here is the deal..

I created this model:

class ProductCategory(models.Model):
shop = models.ForeignKey(Shop)
parent_category = models.ForeignKey('self', blank=True, null=True,
related_name='child')
name = models.CharField(maxlength=200)
slug = models.SlugField(prepopulate_from=('name',))
description = models.TextField(blank=True)
def __str__(self):
return self.name
class Admin:
pass

As you can see the parent_category is the model itself. When I go to
the admin panel I can add new categories and everything works fine
however I would like to be able to use some kind of indentations such
as:

Category 1
Category 1 :: Sub Category 2
Category 3 :: Sub Category 4

Can  anybody spare some knowledge and help me out finding out a way to
archive this.

I can update the wiki with the solution for other django newbies

Thanks,

Sebastian Macias


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---