Re: Help with Django installation on OSX 10.4.10

2007-08-26 Thread Duc Nguyen

Not sure if this is the solution, but I put my PATH settings in  
~/.profile instead of .bash_profile.
I didn't make an alias of django_admin.py in /usr/local/bin.  I just  
made sure $DJANGOHOME/bin
was part of my PATH.

-- Duc


On Aug 25, 2007, at 11:21 PM, Brandon Taylor wrote:

>
> Hi everyone,
>
> I'm just getting started with Django/Python. I have installed Python
> 2.4.4, and Django from the latest build. I can run 'python' and
> 'import django' from bash and it does not error out, so I'm assuming
> my installs are correct.
>
> I have made an alias of 'django-admin.py' and placed it in my '/usr/
> local/bin'. When I attempt to run 'django-admin.py startproject foo',
> bash gives me an error:
>
> -bash: django-admin.py: command not found
>
> What can I do to resolve this error? All of my .bash_profile
> and .bash_login PATH settings seem to be pointing in the right place
> for my django installation.
>
> Thanks in advance,
> Brandon
>
>
> >


--~--~-~--~~~---~--~~
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 cloning Facebook in Django feasible?

2007-07-27 Thread Duc Nguyen

John DeRosa wrote:
> Ick!  Why would you want to?  Isn't one facebook in the world enough? :-)
>   

One facebook in america is enough.  There is plenty of room for 
competition in other countries.

--~--~-~--~~~---~--~~
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 cloning Facebook in Django feasible?

2007-07-27 Thread Duc Nguyen

You can clone facebook in any programming language using any framework 
you want.  Django is one of the many frameworks which you can use to do 
it. 

And yes, facebook has been cloned in other countries, many, many times.  
The most famous one is from china: http://xiaonei.com/  Not only did 
they clone the features, they cloned the interface.  It even got 
acquired for lots of money.



[EMAIL PROTECTED] wrote:
> Is it possible to develop a Facebook functional clone in Django? What
> parts of it are provided out of the box? Any third-party contributions?
>
>
> >
>   


--~--~-~--~~~---~--~~
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: newbie question: generating javascript, avoiding trailing comma

2007-07-19 Thread Duc Nguyen

It would probably be easier if you processed crime_list in your view and 
generated a 'crimes' variable for use in your template.

cjl wrote:
> DU:
>
> I am a newbie, and I'm working on a simple tutorial for other
> newbies.  I am trying to generate some javascript, and I have the
> following code in my template:
>
> var crimes =  [
>  {% for crime in crime_list %}
>  [ {{crime.longitude}},
> {{ crime.latitude }},'{{ crime.address }}','{{ crime.type }}','{{ crime.date 
> }}'],
>  {% endfor %}
> ];
>
> When this template is rendered to a webpage, I can get something like
> the following:
>
> var crimes = [
> [-78.817828,42.904851,'17 Rapin
> Place','homicide','2006-01-05'],
> [-78.889458,42.897707,'155 Pennsylvania
> Street','homicide','2006-04-17'],
> [-78.884766,42.915257,'446 West
> Ferry','homicide','2006-01-10'],
> ];
>
> This is fine, but I think the trailing comma in the final array item
> is causing a javascript error in IE. Is there a way to rewrite my
> template code to avoid the trailing comma?
>
> Thanks in advance,
> cjl
>
>
> >
>   


--~--~-~--~~~---~--~~
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: memcached setup

2007-05-29 Thread Duc Nguyen

Could it possibly be due to the fact that your python shell has the 
correct PYTHONPATH set (with the memcached python bindings) and that 
your django configuration doesn't have the correct PYTHONPATH?

omat wrote:
> Hi all,
>
> I have installed memcached and python bindings on Fedora Core 4. Using
> the python shell I am able to use cache with django:
>
>   
 from django.conf import settings
 settings.configure(CACHE_BACKEND = 'memcached://127.0.0.1:11211/')
 from django.core.cache import cache
 cache.set('test', 'abc')
 cache.get('test')
 
> 'abc'
>
> But when I put CACHE_BACKEND = 'memcached://127.0.0.1:11211/' in the
> settings.py I get:
>
> InvalidCacheBackendError: Memcached cache backend requires either
> 'memcached' or 'cmemcached' libraries
>
>
> Any ideas?
>
> oMat
>
>
> >
>   


--~--~-~--~~~---~--~~
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: Setting up my application

2007-05-20 Thread Duc Nguyen

Just put those other one urls before the catch-all, for example:

...
(r'^aboutus/', 'views.aboutus'),
(r'^history/', 'views.history'),
(r'^contactinfo/', 'views.contactinfo'),
(r'(?P\w+)/', 'views.whatever),
...


Greg wrote:
> Duc,
> Because sometimes the word will be be a manufacturer.  Some example
> possible url's of my site could be:
>
> www.mysites.com/milliken/
> www.mysites.com/mohawk/
> www.mysites.com/aboutus/
> www.mysites.com/history/
> www.mysites.com/contactinfo/
>
> So sometimes it wouldn't be a manufacturer.  How would I solve that
> problem?
>
>
> On May 19, 11:55 pm, Duc Nguyen <[EMAIL PROTECTED]> wrote:
>> Why can't it just be a "catch-all" url like:
>>
>> (r'(?P\w+)/', 'theview')
>>
>> and then in your view:
>>
>> def theview(request, manufacturer):
>> if manufacturer in my_manufacturers:
>>do_something()
>> else:
>># error out with unknown manufacturer msg?
>>
>>
>>
>> Greg wrote:
>>> I'm working on creating an e-commerce site in Django.  I have a
>>> website that sells area rugs from 20 different manufacturers.  I am
>>> wondering what the best way to configure my urls.py file.  I've been
>>> thinking of a couple of different ways to accomplish this.
>>> 1) Contained all in one url line
>>> (r'^(mohawk|milliken|shaw|sphinx|etc...))/$', 'theview'),
>>> My 'theview' function would then find out what variable was passed to
>>> it.  And then query that manufacturer table.   So my url can get
>>> pretty long depending on how many manufacturers I have.  Also, if I
>>> did it this way how would I setup my view?  Would it be something like
>>> this
>>> def theview(request, manufacturer):
>>>rec = manufacturer.objects.all()
>>>return render_to_response('dispaly_manu.html', {'manu_records':
>>> rec})
>>> 2) Creating a separate url for each manufacturer
>>> (r'^/mohawk/$', 'django.views.generic.list_detail.object_list',
>>> mohawk_dict),
>>> (r'^/milliken/$', 'django.views.generic.list_detail.object_list',
>>> milliken_dict),
>>> (r'^/shaw/$', 'django.views.generic.list_detail.object_list',
>>> shaw_dict),
>>> (r'^/sphinx/$', 'django.views.generic.list_detail.object_list',
>>> sphinx_dict),
>>> This way seems like a waste.  Would I need to create a unique
>>> dictionary for each manufacturer?  Is there a way I can use the same
>>> dictionary for every manufacturer?
>>> Or does somebody have a better solution than what I came up with
>>> above?
>>> Thanks- Hide quoted text -
>> - Show quoted text -
>
>
> >


--~--~-~--~~~---~--~~
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: Setting up my application

2007-05-19 Thread Duc Nguyen

Why can't it just be a "catch-all" url like:

(r'(?P\w+)/', 'theview')

and then in your view:

def theview(request, manufacturer):
if manufacturer in my_manufacturers:
   do_something()
else:
   # error out with unknown manufacturer msg?




Greg wrote:
> I'm working on creating an e-commerce site in Django.  I have a
> website that sells area rugs from 20 different manufacturers.  I am
> wondering what the best way to configure my urls.py file.  I've been
> thinking of a couple of different ways to accomplish this.
>
> 1) Contained all in one url line
> (r'^(mohawk|milliken|shaw|sphinx|etc...))/$', 'theview'),
>
> My 'theview' function would then find out what variable was passed to
> it.  And then query that manufacturer table.   So my url can get
> pretty long depending on how many manufacturers I have.  Also, if I
> did it this way how would I setup my view?  Would it be something like
> this
>
> def theview(request, manufacturer):
>rec = manufacturer.objects.all()
>return render_to_response('dispaly_manu.html', {'manu_records':
> rec})
>
> 2) Creating a separate url for each manufacturer
> (r'^/mohawk/$', 'django.views.generic.list_detail.object_list',
> mohawk_dict),
> (r'^/milliken/$', 'django.views.generic.list_detail.object_list',
> milliken_dict),
> (r'^/shaw/$', 'django.views.generic.list_detail.object_list',
> shaw_dict),
> (r'^/sphinx/$', 'django.views.generic.list_detail.object_list',
> sphinx_dict),
>
> This way seems like a waste.  Would I need to create a unique
> dictionary for each manufacturer?  Is there a way I can use the same
> dictionary for every manufacturer?
>
> Or does somebody have a better solution than what I came up with
> above?
>
> Thanks
>
>
> >


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