Re: about DJANGO_SETTINGS_MODULE

2007-08-26 Thread Graham Dumpleton



On Aug 27, 11:53 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 8/26/07, z_axis <[EMAIL PROTECTED]> wrote:
>
> >   File "d:\app\python\Lib\site-packages\django\db\__init__.py", line 7, in 
> >  > le>
> > if not settings.DATABASE_ENGINE:
>
> The lines above tell you what the problem is: Django stores data in a
> database, but you have not filled in the settings which tell Django
> what type of database to use or how to connect to it.

That is not the problem. The problem is that they tried to define an
absolute path for the settings file rather than a dotted Python module
path. The OP should reread the documentation as to what
DJANGO_SETTINGS_MODULE should be set to.

Graham


--~--~-~--~~~---~--~~
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: Help with Django installation on OSX 10.4.10

2007-08-26 Thread Brandon Taylor

Hi Joe,

Thanks for your help. I don't know how I missed it before, but I
grabbed the Python 2.5.1 Universal installer for OS X and replaced my
earlier version. I grabbed the 0.96 tarball and installed it into
2.5.1 and viola, it works!

Now I'm on to the first tutorial. I'm very excited to see how Django
compares to Rails. I'm a senior presentation layer developer with
Avenue A | Razorfish in Austin, and Rails is quite the buzz, despite
the slow Ruby interpreter speeds. So, I thought I would try Django
since Python is so much faster.

I would love to be able to use Django as an alternative to Java for a
really fast, one-stop-shop open-source framework.

Again, many thanks,
Brandon

On Aug 26, 11:00 pm, "Joseph Heck" <[EMAIL PROTECTED]> wrote:
> Use the path settings from my earlier post - that fits perfectly with
> MacPorts and should do you.
>
> -joe
>
> On 8/26/07, Brandon Taylor <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi everyone,
>
> > I scrapped my custom install of Python 2.4.4 and Django in favor of an
> > install from MacPorts. So, now I have Python 2.5.1 and Django
> > installed.
>
> > But, now when I run python in bash, I get version 2.3.5. Mac Ports has
> > insalled everything to /opt/local/var/macports/software
>
> > I have django-admin.py, python2.5, python2.5-config, smtpd2.5.py and
> > pydoc2.5 in /opt/local/bin
>
> > Can someone help me get the correct path settings in bash_profile,
> > profile, bash_login or whatever files I need to edit? I would really
> > appreciate the help. I'm anxious to get started with Python and
> > Django.
>
> > TIA,
> > Brandon
>
> > On Aug 26, 1:34 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> > > On 26-Aug-07, at 11:51 AM, Brandon Taylor wrote:
>
> > > > -bash: django-admin.py: command not found
>
> > > what happens if you run /usr/local/bin/django-admin.py, that is, with
> > > the full path name. If it runs, then it means your path does not
> > > contain /usr/local/bin. If it doesnt run, your alias is borked.
>
> > > --
>
> > > regards
> > > kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/


--~--~-~--~~~---~--~~
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: Help with Django installation on OSX 10.4.10

2007-08-26 Thread Joseph Heck

Use the path settings from my earlier post - that fits perfectly with
MacPorts and should do you.

-joe

On 8/26/07, Brandon Taylor <[EMAIL PROTECTED]> wrote:
>
> Hi everyone,
>
> I scrapped my custom install of Python 2.4.4 and Django in favor of an
> install from MacPorts. So, now I have Python 2.5.1 and Django
> installed.
>
> But, now when I run python in bash, I get version 2.3.5. Mac Ports has
> insalled everything to /opt/local/var/macports/software
>
> I have django-admin.py, python2.5, python2.5-config, smtpd2.5.py and
> pydoc2.5 in /opt/local/bin
>
> Can someone help me get the correct path settings in bash_profile,
> profile, bash_login or whatever files I need to edit? I would really
> appreciate the help. I'm anxious to get started with Python and
> Django.
>
> TIA,
> Brandon
>
>
> On Aug 26, 1:34 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> > On 26-Aug-07, at 11:51 AM, Brandon Taylor wrote:
> >
> > > -bash: django-admin.py: command not found
> >
> > what happens if you run /usr/local/bin/django-admin.py, that is, with
> > the full path name. If it runs, then it means your path does not
> > contain /usr/local/bin. If it doesnt run, your alias is borked.
> >
> > --
> >
> > regards
> > kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/
>
>
> >
>

--~--~-~--~~~---~--~~
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: Help with Django installation on OSX 10.4.10

2007-08-26 Thread Brandon Taylor

Hi everyone,

I scrapped my custom install of Python 2.4.4 and Django in favor of an
install from MacPorts. So, now I have Python 2.5.1 and Django
installed.

But, now when I run python in bash, I get version 2.3.5. Mac Ports has
insalled everything to /opt/local/var/macports/software

I have django-admin.py, python2.5, python2.5-config, smtpd2.5.py and
pydoc2.5 in /opt/local/bin

Can someone help me get the correct path settings in bash_profile,
profile, bash_login or whatever files I need to edit? I would really
appreciate the help. I'm anxious to get started with Python and
Django.

TIA,
Brandon


On Aug 26, 1:34 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> On 26-Aug-07, at 11:51 AM, Brandon Taylor wrote:
>
> > -bash: django-admin.py: command not found
>
> what happens if you run /usr/local/bin/django-admin.py, that is, with  
> the full path name. If it runs, then it means your path does not  
> contain /usr/local/bin. If it doesnt run, your alias is borked.
>
> --
>
> regards
> kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/


--~--~-~--~~~---~--~~
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 40 MB RAM enough?

2007-08-26 Thread Kenneth Gonsalves

Hi,

I have a site on WebFaction with 40 MB RAM. It is a very small site  
in the sense that it is used for administering an organisation, so  
would have just 2-3 users at a time, mainly doing admin stuff. The  
only load is when pdf reports are being generated. Leaving apache  
untweaked, the RAM usage shoots up - well over the 40 MB limit. I set  
MaxRequestsPerChild to 3. Even then, the limit gets crossed pretty  
fast. The question is: do I go on trying to tweak Apache? Or do I go  
in for more RAM?
-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



--~--~-~--~~~---~--~~
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: about DJANGO_SETTINGS_MODULE

2007-08-26 Thread James Bennett

On 8/26/07, z_axis <[EMAIL PROTECTED]> wrote:
>   File "d:\app\python\Lib\site-packages\django\db\__init__.py", line 7, in 
>  le>
> if not settings.DATABASE_ENGINE:

The lines above tell you what the problem is: Django stores data in a
database, but you have not filled in the settings which tell Django
what type of database to use or how to connect to it.


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

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



about DJANGO_SETTINGS_MODULE

2007-08-26 Thread z_axis

hi, friends:
I am a newbie of django. I want to learn it in python shell.
f:\set DJANGO_SETTINGS_MODULE=f:\z\temp\blog\settings.py
f:\python
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>>sys.path.append('f:/z/temp/blog')
>>> from django.db import models
Traceback (most recent call last):
  File "", line 1, in 
  File "d:\app\python\Lib\site-packages\django\db\__init__.py", line 7, in 
if not settings.DATABASE_ENGINE:
  File "d:\app\python\Lib\site-packages\django\conf\__init__.py", line 28, in __
getattr__
self._import_settings()
  File "d:\app\python\Lib\site-packages\django\conf\__init__.py", line 55, in _i
mport_settings
self._target = Settings(settings_module)
  File "d:\app\python\Lib\site-packages\django\conf\__init__.py", line 83, in __
init__
raise EnvironmentError, "Could not import settings '%s' (Is it on sys.path?
Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)
EnvironmentError: Could not import settings 'f:\z\temp\blog\settings.py' (Is it
on sys.path? Does it have syntax errors?): No module named f:\z\temp\blog\settin
gs.py

 Any suggestion is appreciated!
--
z_axis
2007-08-27



--~--~-~--~~~---~--~~
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: How to create different person models that share a profile model?

2007-08-26 Thread Ariel Mauricio Nunez Gomez
I can't think of any "clean solutions" right now.

Dirty one's include adding a Role class, or applying the constraints on the
database.

If you come up with something, please let me know.

Ariel.

On 8/25/07, Ed Hagen <[EMAIL PROTECTED]> wrote:
>
>
>
> That will work -- assigning roles to Users makes sense. But, using
> your setup, is there any way to enforce a single role per User? As it
> is now, a single User could be assigned both a student and teacher
> role.
>
> Many thanks for your help.
>
> Ed.
>
>
> >
>


-- 
Ariel Mauricio Núñez Gómez

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



IntegrityError: datatype mismatch

2007-08-26 Thread Alex

Hello all,
I am having an issue with django models and the auto-generated admin
page:

I apologize if this has already been answered somewhere.

/reg/models.py:
'''
from django.db import models
class Space(models.Model):
name = models.CharField(max_length=100, )#unique=True)

def __unicode__(self):
return self.name

class Admin:
pass

class Workshop(models.Model):
name = models.CharField(max_length=100, )#unique=True)

def __unicode__(self):
return self.name

class Admin:
pass

class Event(models.Model):
space = models.ForeignKey(Space, edit_inline=models.TABULAR)
workshop = models.ForeignKey(Workshop, edit_inline=models.STACKED)

start = models.DateTimeField(core=True)

end = models.DateTimeField()

class Admin:
pass
'''

http://example.com/admin/reg/workshop/add/ works properly:  I can add
workshops with their associated events.

However, when I attempt to add an event to a workshop that already
exists, for example at http://example.com/admin/reg/workshop/1/, by
selecting a space and filling in both the start and end date/time
forms:

"IntegrityError at /admin/reg/workshop/1/
datatype mismatch"

I can provide the entire error message if so desired.

thanks
-Alex


--~--~-~--~~~---~--~~
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: URL dispatcher with filter

2007-08-26 Thread Ned Batchelder
I would think the simplest thing to do is combine the get_object_or_404 
and the user_can_access_c calls:

def get_allowed_c(request, cid):
c = get_object_or_404(C, pk=cid)
if user_can_access_c(request.user, c):
return c
else:
# not allowed; act as if user got the wrong url
raise Http404

@login_required
def foo(request, cid):
c = get_allowed_c(request, cid)
# Do whatever you want with c...

This means that each view function has a single line in common with the 
others, just as it used to before your access checking.

--Ned.

Tim Chase wrote:
>> What I currently have to do is to define each view (such as to handle
>> "foo" above) as:
>>
>> @login_required
>> def foo(request, cid):
>> c = get_object_or_404(C, pk=cid)
>> if user_can_access_c(request.user, c):
>> # do something that's allowed
>> # ...
>> else:
>> # not allowed; act as if user got the wrong url
>> raise Http404
>>
>> ... and then I have to repeat this above codes for "bar" and "abc"
>> views. This feels rather excessive for me. Going with the don't-repeat-
>> yourself principle, I'd rather have a single place that does this
>> instead of sprinkling this codes for every view under /c/(?P\d
>> +)/...
>>
>> Any pointer you can give me would be greatly appreciated.
>> 
>
> There are at least two suggestions that I can think of:
>
> In a similar situation, I found that the easiest way for me was
> to add a "get_allowable_objects_for_user" sort of method to the
> class in question:
>
> class C(Model):
>   # class definition
>   def get_allowed(self, user):
> # complex logic here
> if problems:
>   raise SomeException
> return C.objects.filter(...)
>
> This may be overkill as it still requires some checking in each
> view function.  However, for more complex access-control schemes,
> this can be useful to prevent awkward syntax from propagating
> across your views.py.
>
> Alternatively, you could use a double-dispatch sort of pattern.
> Your urls.py could pass in that second part
>
>   /c/(?P\d+)/(Pfoo|bar|abc) -> dispatch
>
> and then your view(s) would look something like:
>
>
> def foo(request, cid, c):
> # do something foo'ish with c
> def bar(request, cid, c):
> # do something bar'ish with c
> def abc(request, cid, c):
> # do something abc'ish with c
>
> action_mapping = {
>   'foo': foo,
>   'bar': bar,
>   'abc': abc,
>   }
>
> @login_required
> def dispatch(request, cid, whatever):
> c = get_object_or_404(C, pk=cid)
>
> if user_can_access_c(request.user, c):
> action_mapping[whatever](request, cid, c)
> else:
> # not allowed; act as if user got the wrong url
> raise Http404
>
>
> That action_mapping bit can be cleaned up some if you keep a
> tight reign on your regexp for the definition of "whatever".  In
> the above case, because we only explicitly allow "foo|bar|abc",
> it can be rewritten simply as
>
>if user_can_access_c(request.user, c):
>  eval(whatever)(request, cid, c)
>else:
>  raise Http404
>
> without the need for the action_mapping.
>
> Just a couple ideas for DRY'ing the code.
>
> -tim
>
>
>
>
>
>
>
> >
>
>   

-- 
Ned Batchelder, http://nedbatchelder.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
-~--~~~~--~~--~--~---



Re: URL dispatcher with filter

2007-08-26 Thread Tim Chase

> What I currently have to do is to define each view (such as to handle
> "foo" above) as:
> 
> @login_required
> def foo(request, cid):
> c = get_object_or_404(C, pk=cid)
> if user_can_access_c(request.user, c):
> # do something that's allowed
> # ...
> else:
> # not allowed; act as if user got the wrong url
> raise Http404
> 
> ... and then I have to repeat this above codes for "bar" and "abc"
> views. This feels rather excessive for me. Going with the don't-repeat-
> yourself principle, I'd rather have a single place that does this
> instead of sprinkling this codes for every view under /c/(?P\d
> +)/...
> 
> Any pointer you can give me would be greatly appreciated.

There are at least two suggestions that I can think of:

In a similar situation, I found that the easiest way for me was
to add a "get_allowable_objects_for_user" sort of method to the
class in question:

class C(Model):
  # class definition
  def get_allowed(self, user):
# complex logic here
if problems:
  raise SomeException
return C.objects.filter(...)

This may be overkill as it still requires some checking in each
view function.  However, for more complex access-control schemes,
this can be useful to prevent awkward syntax from propagating
across your views.py.

Alternatively, you could use a double-dispatch sort of pattern.
Your urls.py could pass in that second part

  /c/(?P\d+)/(Pfoo|bar|abc) -> dispatch

and then your view(s) would look something like:


def foo(request, cid, c):
# do something foo'ish with c
def bar(request, cid, c):
# do something bar'ish with c
def abc(request, cid, c):
# do something abc'ish with c

action_mapping = {
  'foo': foo,
  'bar': bar,
  'abc': abc,
  }

@login_required
def dispatch(request, cid, whatever):
c = get_object_or_404(C, pk=cid)

if user_can_access_c(request.user, c):
action_mapping[whatever](request, cid, c)
else:
# not allowed; act as if user got the wrong url
raise Http404


That action_mapping bit can be cleaned up some if you keep a
tight reign on your regexp for the definition of "whatever".  In
the above case, because we only explicitly allow "foo|bar|abc",
it can be rewritten simply as

   if user_can_access_c(request.user, c):
 eval(whatever)(request, cid, c)
   else:
 raise Http404

without the need for the action_mapping.

Just a couple ideas for DRY'ing the code.

-tim







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



URL dispatcher with filter

2007-08-26 Thread tt

I have a unique situation that the traditional urls.py config does not
handle very well.

Imagine I have URL patterns like this:
/c/(?P\d+)/foo
/c/(?P\d+)/bar
/c/(?P\d+)/abc
...

I'm using Django authentication to ensure the user is logged in. But I
have to do a custom check to ensure if that each logged-in user has
access to a specific cid object (each user can see exactly one cid,
and not allowed to see another cid).

What I currently have to do is to define each view (such as to handle
"foo" above) as:

@login_required
def foo(request, cid):
c = get_object_or_404(C, pk=cid)
if user_can_access_c(request.user, c):
# do something that's allowed
# ...
else:
# not allowed; act as if user got the wrong url
raise Http404

... and then I have to repeat this above codes for "bar" and "abc"
views. This feels rather excessive for me. Going with the don't-repeat-
yourself principle, I'd rather have a single place that does this
instead of sprinkling this codes for every view under /c/(?P\d
+)/...

Any pointer you can give me would be greatly appreciated.
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
-~--~~~~--~~--~--~---



Re: Validation problem with newforms and initial value for URLField

2007-08-26 Thread Shev

Yes, I've created a custom clean method to deal with this for now,
thanks.

Perhaps the docs should be updated to have a note on that example.  On
my page, I wanted to include an initial "http://; value so users would
not be confused as to what was expected in the field, but the field
was also optional.



On Aug 26, 3:23 am, "Peter Melvyn" <[EMAIL PROTECTED]> wrote:
> On 8/26/07, Shev <[EMAIL PROTECTED]> wrote:
>
> > But neither should an initial field value raise an error when
> > the POSTed data is exactly the same as the starting value;
> > it should just be ignored and the value discarded.
>
> Even if you supply a valid inital value? It does not sound well for me...
>
> If you need such behaveour, should not you sublass a field and
> override the clean() method?
>
> Peter


--~--~-~--~~~---~--~~
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: loaddata issue

2007-08-26 Thread Drasty

It seems like it was an issue with the transition from MySQL to
PostgreSQL; I had been using build 6001 (as I noted at the end, sorry
it wasn't very obvious), but I just ran svn update and was able to
loaddata, although the project will remain on MySQL.

On Aug 26, 9:16 am, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 8/26/07, Drasty <[EMAIL PROTECTED]> wrote:
>
>
>
> > Loading 'courses' fixtures...
> > Installing xml fixture 'courses' from '/../eeyore/courses/fixtures'.
> > Problem installing fixture '/../eeyore/courses/fixtures/courses.xml':
> >  node is missing the 'name' attribute
>
> This sounds like there is an attribute missing in the output XML. Can
> you provide an example model and data that causes this problem to
> occur?
>
> > I receive this error if I dumpdata as JSON and attempt loaddata:
>
> > Installing json fixture 'courses' from '/../eeyore/courses/fixtures'.
> > Problem installing fixture '/../eeyore/courses/fixtures/courses.json':
> > column "enable_comments" is of type boolean but expression is of type
> > integer
>
> This sounds like the data is not getting output correctly for a given
> field type. Again, can you provide sample data?
>
> On top of the sample data, can you also please provide the version of
> Django you are using (SVN revision or release number), and any other
> configuration details - in particular, the source and target database.
>
> 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
-~--~~~~--~~--~--~---



Re: loaddata and object query does not exist

2007-08-26 Thread Russell Keith-Magee

On 8/26/07, Kai Kuehne <[EMAIL PROTECTED]> wrote:
>
> Hi list,
> I cannot load my data into the postgres db.
> I dumped it on the production server and want to
> load it on the dev machine (both SVN 6020):
>
> $ python manage.py loaddata dump.json
> Loading 'dump' fixtures...
> Installing json fixture 'dump' from absolute path.
> Problem installing fixture 'dump.json': DVD matching query does not exist.

This indicates that something in the data loading process is
performing a query somewhere over data that may not be loaded. Are you
using any custom managers or other variations on a 'basic' model?
Anything else that could be performing a query over DVD objects?

Of course, the best way to sort out this problem would be to provide
us with a minimal test case - a small model and dataset that
replicates the problem.

> I alredy read #4459 and #4431 and I also tried to remove the overriden
> save()-methods in the models... restarted apache. But still doesn't work.

Issue #4459 should be resolved in the SVN release you are using.

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



Re: Using SQL aggregates

2007-08-26 Thread Russell Keith-Magee

On 8/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> How can I display a table of groups and counts, using the DB API?  Can
> this be wrapped around a model that is tied to a database view?

The short answer is that aggregates are a planned, but not yet
implemented feature. The ticket discussing the issue is #3566.

The longer answer is that there are some ways to get aggregates into
Django, but they aren't as 'pretty' as the rest of Django. One
approach is to make raw SQL calls. Another approach is to bend the
existing query commands (like extra()) in unintended ways. This will
hopefully get better in the very near future, as one of the Django
core developers is working on a rewrite of the internal query
composing interface.

Yet another way to approach the problem is using views. Django models
can be made to wrap around existing database tables - they are also
largely compatible as wrappers around database views that have been
constructed externally to Django. Django doesn't currently have a
representation for views, so you will need to contruct the view
yourself, and Django won't provide any protection to ensure you are
using the view correctly, but you can use a view to access aggregate
data using the Django ORM. This technique (and how to do it) has been
discussed previously on the Django-users lists.

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



Re: Integrating Selenium unit-tests into Django

2007-08-26 Thread Russell Keith-Magee

On 8/26/07, bsdlogical <[EMAIL PROTECTED]> wrote:
>
> I can't figure out how to use Django's management code to spawn a
> runserver process without calling ./django-admin.py first. I also
> can't
> figure out how to resolve the double database issue. I've examined the
> patch in #2879 and the explanations in #2867, but I've been unable to
> recreate their steps.
>
> Does anyone have any suggestions to point me in the right direction? I
> apologize for the long email, and hopefully I'm not missing anything
> fundamental.

You're not missing anything fundamental (at least, not that I am aware
of). The tickets you refer to were contributed a while back, but the
individual that contributed them disappeared before they were
complete. Handling selenium and other 'live server' tests is an issue
I'm certainly interested in addressing, but I've had other priorities
of late so I haven't looked at the problem seriously.

If you're just looking for a 'how do I make this work' set of
instructions, unfortunately there's not much I can offer at this
point.

However, if you're offering to dig in and help out, I would suggest
that you might want to look at Adrian's recently added
'django-admin.py testserver' command. That command performs a test
database setup similar to that used by the test framework, and then
invokes the runserver management command to run an server. There will
be some extra thread-spawning work required, but that should give you
some idea of what should be possible.

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



Re: loaddata issue

2007-08-26 Thread Russell Keith-Magee

On 8/26/07, Drasty <[EMAIL PROTECTED]> wrote:
>
> Loading 'courses' fixtures...
> Installing xml fixture 'courses' from '/../eeyore/courses/fixtures'.
> Problem installing fixture '/../eeyore/courses/fixtures/courses.xml':
>  node is missing the 'name' attribute

This sounds like there is an attribute missing in the output XML. Can
you provide an example model and data that causes this problem to
occur?

> I receive this error if I dumpdata as JSON and attempt loaddata:
>
> Installing json fixture 'courses' from '/../eeyore/courses/fixtures'.
> Problem installing fixture '/../eeyore/courses/fixtures/courses.json':
> column "enable_comments" is of type boolean but expression is of type
> integer

This sounds like the data is not getting output correctly for a given
field type. Again, can you provide sample data?

On top of the sample data, can you also please provide the version of
Django you are using (SVN revision or release number), and any other
configuration details - in particular, the source and target database.

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



Re: inteactive shell, threads & debug

2007-08-26 Thread sandro dentella

As often happens, writing the questions gave me the answer at least
to the main problem if not to the single questions on threading.

I ended up writing (interactively) a variable in django.conf.settings
and modified get user to test for INTERACTIVE_USER if it does not
find
any user defined in the thread.

I'd like to make this happen only if I'm running in the interactive
shell
or the development server. How can I test this?

sandro
*:-)


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



inteactive shell, threads & debug

2007-08-26 Thread sandro dentella

Hi,

   First the question, then the explanation why a ask this...

   1. Are all the commands issued in an interactive shell run in the
same
  thread?

   2. Is it possible to make functions (eg: Model.objects.all())
called
  within the interactive shell read variables in the interactive
shell's
  namespace?

   3. Is there a way to test if I'm running in an interactive
environment?

   I use interactive shell for debugging. That works normally well
   unless I use a model manager that checks the user in the thread
(via
   thread_local) to grant different permissions.

   When using interactive shell I never ended to a suitable solution,
since
   thread_local does not work, I don't know how to write a variable
that
   could be read from within the manager (or any other function...),

Thanks

sandro
*:-)


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



loaddata and object query does not exist

2007-08-26 Thread Kai Kuehne

Hi list,
I cannot load my data into the postgres db.
I dumped it on the production server and want to
load it on the dev machine (both SVN 6020):

$ python manage.py loaddata dump.json
Loading 'dump' fixtures...
Installing json fixture 'dump' from absolute path.
Problem installing fixture 'dump.json': DVD matching query does not exist.

I alredy read #4459 and #4431 and I also tried to remove the overriden
save()-methods in the models... restarted apache. But still doesn't work.

An idea anyone?
Thanks four your time!

Kai

--~--~-~--~~~---~--~~
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: Can Django be run on 1and1 ?

2007-08-26 Thread Amirouche



On Aug 25, 8:19 pm, john <[EMAIL PROTECTED]> wrote:
> On Aug 25, 7:07 am, Amirouche <[EMAIL PROTECTED]> wrote:
>
> > As a general advice don't run anything on 1and1.com ; )
>
> we have been using 1and1 for email and static type web
> hosting for a long time with excellent reliability and low cost.

right, it's good for this kind of things, the day you run in trouble
you can forget their support number (they have ?)

But your are completly right, I should not make this kind of
comments :)


--~--~-~--~~~---~--~~
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: TyneMCE-like for math, You know one?

2007-08-26 Thread Amirouche

On Aug 26, 1:00 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Thanks. This mathdonalds seens to be very good. Maybe doing some
> modifications it should work for what I need.
>
> I liked an editor named Xina,http://xinha.webfactional.com/wiki/Examples,
> good with an math plugin.
> This article (http://www.geniisoft.com/showcase.nsf/WebEditors)
> compare several editors, maybe interesting.

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



Re: problems with syncdb

2007-08-26 Thread Amirouche

Looks like the problem comes from the OneToOneField...


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



problems with syncdb

2007-08-26 Thread Paul Rauch

Hello *
I'm using django svn, revision 5991.
when trying to save this model,

from django.db import models

from django.contrib.auth.models import User
# Create your models here.

class mg_user(models.Model):
 userid = models.PositiveIntegerField()
 name = models.CharField(max_length=255)
 server = models.PositiveIntegerField()
 class Admin:
  pass

class sitting(models.Model):
 user = models.OneToOneField(mg_user,related_name='gets_sitted')
 sitter = models.ForeignKey(mg_user,related_name='sittet')
 start = models.DateTimeField()
 end = models.DateTimeField()
 committed = models.DateTimeField()
 committed_by = models.OneToOneField(User,related_name='commited_sittings')
 last_edited = models.DateTimeField()
 last_edited_by = models.OneToOneField(User,related_name='edited_sittings')
 comment = models.TextField()
 class Admin:
  pass

I get an error:

./manage.py syncdb
Creating table hp_mg_user
Creating table hp_sitting
Traceback (most recent call last):
  File "./manage.py", line 11, in 
execute_manager(settings)
  File
"/usr/lib64/python2.5/site-packages/django/core/management/__init__.py",
line 180, in execute_manager
utility.execute(argv)
  File
"/usr/lib64/python2.5/site-packages/django/core/management/__init__.py",
line 124, in execute
command.execute(*args[1:], **options.__dict__)
  File
"/usr/lib64/python2.5/site-packages/django/core/management/base.py",
line 33, in execute
output = self.handle(*args, **options)
  File
"/usr/lib64/python2.5/site-packages/django/core/management/base.py",
line 115, in handle
return self.handle_noargs(**options)
  File
"/usr/lib64/python2.5/site-packages/django/core/management/commands/syncdb.py",
line 66, in handle_noargs
cursor.execute(statement)
  File "/usr/lib64/python2.5/site-packages/django/db/backends/util.py",
line 19, in execute
return self.cursor.execute(sql, params)
  File "/usr/lib64/python2.5/site-packages/MySQLdb/cursors.py", line
163, in execute
self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.5/site-packages/MySQLdb/connections.py", line
35, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1068, 'Multiple primary key defined')

then I asked it to print the sql it wanted to use:

./manage.py sqlreset hp
BEGIN;
DROP TABLE `hp_mg_user`;
CREATE TABLE `hp_mg_user` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`userid` integer UNSIGNED NOT NULL,
`name` varchar(255) NOT NULL,
`server` integer UNSIGNED NOT NULL
)
;
CREATE TABLE `hp_sitting` (
`user_id` integer NOT NULL PRIMARY KEY REFERENCES `hp_mg_user` (`id`),
`sitter_id` integer NOT NULL REFERENCES `hp_mg_user` (`id`),
`start` datetime NOT NULL,
`end` datetime NOT NULL,
`committed` datetime NOT NULL,
`committed_by_id` integer NOT NULL PRIMARY KEY REFERENCES
`auth_user` (`id`),
`last_edited` datetime NOT NULL,
`last_edited_by_id` integer NOT NULL PRIMARY KEY REFERENCES
`auth_user` (`id`),
`comment` longtext NOT NULL
)
;
CREATE INDEX `hp_sitting_user_id` ON `hp_sitting` (`user_id`);
CREATE INDEX `hp_sitting_sitter_id` ON `hp_sitting` (`sitter_id`);
CREATE INDEX `hp_sitting_committed_by_id` ON `hp_sitting`
(`committed_by_id`);
CREATE INDEX `hp_sitting_last_edited_by_id` ON `hp_sitting`
(`last_edited_by_id`);
COMMIT;

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



SUN PROTECTION

2007-08-26 Thread Salah U Shamsi
* Effective Skin Care, Eye Care Products
CLICK TO READ:


 
http://www.12three.info/sun-protection/


--

 *

--~--~-~--~~~---~--~~
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 wait to avoid collision before inserting a record?

2007-08-26 Thread Kugutsumen

I am using django latest trunk and postgresql 8.2

The domain relation contains 180 million records.

class Domain(models.Model):
name = models.CharField("domain name", maxlength=255, unique=True)
source = models.ForeignKey(History, verbose_name="Source")

CREATE TABLE "DNS_domain" (
"id" serial NOT NULL PRIMARY KEY,
"name" varchar(255) NOT NULL UNIQUE,
"source_id" integer NOT NULL REFERENCES "Log_history" ("id")
DEFERRABLE INITIALLY DEFERRED
);

1/ If I try to catch an integrityerror exception, all subsequent
inserts will still fail. Why not use a savepoint and rollback to
recover from an integrity error exception.

2/ If you check that an object exists before a save, there is a race
condition that may generate an exception if the object is created
independently by another process.

3/ Django probably need a simple and fast method to check if an object
exists. This would be really useful when doing bulk inserts; I don't
care about the existing objects I just want to avoid collision.

4/ Why is my select is 2 times faster than objects.get(name=domain)?
What is causing the overhead?

d = Domain.objects.get(name=domain) [...]
Checked 9 domains at 1434 domain/s

Now if instead I just do:

cursor.execute("""SELECT id,name from "DNS_domain" WHERE name='%s' """
% domain)
row = cursor.fetchone()

Checked 9 domains at 3659 domain/s

Thanks,
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: Validation problem with newforms and initial value for URLField

2007-08-26 Thread Peter Melvyn

On 8/26/07, Shev <[EMAIL PROTECTED]> wrote:

> But neither should an initial field value raise an error when
> the POSTed data is exactly the same as the starting value;
> it should just be ignored and the value discarded.

Even if you supply a valid inital value? It does not sound well for me...

If you need such behaveour, should not you sublass a field and
override the clean() method?


Peter

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

2007-08-26 Thread Paul Rauch

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Sasha Weberov schrieb:
> 
> 
> On Aug 23, 9:32 pm, Sasha Weberov <[EMAIL PROTECTED]> wrote:
>> I recently setup mod_scgi and found some configuration examples on a
>> RoR site to get it working. It seems pretty nice so far, much easier
>> to setup then FastCGI, but the configuration is non existant. I was
>> able to find 1 Directive for Apache, and 4 parameters with manage.py.
>> My question is, are there any docs out there with more configuration
>> examples/directives. Also, has anyone had any sucess with it on large
>> sites in comparison with mod_python or FastCGI?
> 
> Anyone?
> 
> 

http://www.djangoproject.com/documentation/fastcgi/

this might help you, though I don't know for sure.

greetz Paul Rauch
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iQIVAwUBRtEpTBG67lyyQrltAQL/Xg/8CrX93RVPVpPfXYophY1w035DNFl6H3Wm
vdo3jlru1nygXmwN2SIt+DCge0JJ64nMInz/Wiy+GBR6ONWUhv+1JBpYPLom9Ux8
xoC9dG1K6tKScaecNxtkYQ57Q5/YSCeqtOZvGZePskbpUc6Uls9CfOk5fKWwNhIU
l3dKuZTrKisaSHxQ1wVtzOJNIJM5KKPjycRetf15scsAzm5a2SrxiMD13nCFeASt
dDsJOIMwXit12bmCz8y3XAlr/2Tjn0NvpnxCq+TFJoGl1+rJz8ZLxkhjlj/FRu/A
V+KeNlSZd3MjYeEcCBH7tGwgfNzQsRfhxYh1GrAEju9UMdg2CYESko9BcvmWrddl
7gKxDfjG/j5Qg5t25zeN9dcqLuvF5rGwd07NclZjb9z3zmB1jmo7F/ZyOg2CzHQw
fZ7i92RKjhVKrWbQDwze6yhDqhjm/Es0OEhmCISnWcu3g0dztMCokuVGOG5R8LHj
bmSZI3Kur/cEs+1vJMGTa1u5gMWmwrCpEw5rK92WDB5QZiF3T8k2gwMQ4qtkhTx9
JgjzvTIGK2SWbZwD6UfPFkNMWNuxntjUuYWQmNZkFjZSor2w+AqAuBcKQnARGXWn
7Om1AX68vNEuNoBL1JNyuG462NlhKlpFjyfY7GgirJG+2/7bbR6KU1N2IughnnWg
tiP4+UDKnTo=
=WFbQ
-END PGP SIGNATURE-

--~--~-~--~~~---~--~~
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: CRUD generic views and new forms

2007-08-26 Thread Nathaniel Whiteinge

The CRUD generic views haven't been updated for newforms yet. In the
meantime you can try using this snippet:

http://www.djangosnippets.org/snippets/99/

- whiteinge


--~--~-~--~~~---~--~~
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: TyneMCE-like for math, You know one?

2007-08-26 Thread Nathaniel Whiteinge

Depending on your ultimate output needs, ASCIIMathML.js may be a good
solution:

http://www1.chapman.edu/~jipsen/mathml/asciimathdemo.html


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

2007-08-26 Thread Joseph Heck

For anyone interested, I've made available the code (using Django) to
a project that implements a message queue for use with Django (or
anything, really) projects. The brilliantly conceived name is "Django
Queue Service", and the source is available at
http://django-queue-service.googlecode.com/. I've written up the
background at my blog
(http://www.rhonabwy.com/wp/2007/08/25/django-queue-service/) and just
wanted to let you all know it was there if you wanted or needed such a
critter.

The code was hacked up in a few evenings at OSCON 2007. Like so many
other folks, I've run into "I want to run some background processing
that is initiated from a django project, but I didn't see any
brilliant queueing solutions that I could take and run with. Hence
this was born, intending to replicate over Amazon's Simple Queue
Service REST API.

It is not set up as a drop-down-and-run service, but there isn't too
much more that's needed to use it directly if you're interested. I've
also included a pure python WSGI server from CherryPy within the
source - which I found was a very effective way to run the code. I've
been wanting to do a pure python server for a while, and this really
did the trick for me.

-joe

--~--~-~--~~~---~--~~
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: Help with Django installation on OSX 10.4.10

2007-08-26 Thread Kenneth Gonsalves


On 26-Aug-07, at 11:51 AM, Brandon Taylor wrote:

> -bash: django-admin.py: command not found

what happens if you run /usr/local/bin/django-admin.py, that is, with  
the full path name. If it runs, then it means your path does not  
contain /usr/local/bin. If it doesnt run, your alias is borked.

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



--~--~-~--~~~---~--~~
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: 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: Help with Django installation on OSX 10.4.10

2007-08-26 Thread Joseph Heck

It is most likely an improper reference in django-admin.py to the
location of python - or the "wrong" python.

If you invoke python in your terminal, which do you get?

BTW: I used the MacPorts install of Python, and I keep the following
in my .profile:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

which does the trick for my installation.

-joe

On 8/25/07, Brandon Taylor <[EMAIL PROTECTED]> 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
-~--~~~~--~~--~--~---



Help with Django installation on OSX 10.4.10

2007-08-26 Thread Brandon Taylor

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