Problems getting started

30 views
Skip to first unread message

Clark

unread,
Mar 7, 2012, 9:36:09 AM3/7/12
to Django users
After installing Django I am attempting to start a new project. After
creating a directory for this, I tried using the command: "django-
admin.py startproject mysite".

but I'm getting the message "-bash: django-admin.py: command not found
".

So, I've tried running this:

"sudo ln -s library/python/2.6/site-packages/django/bin/django-
admin.py /usr/local/bin/django-admin.py" in which i get "file exists"
and I still get the same problem when running the startproject.

Only other piece of info is that during installation I had a "error: /
usr/local/bin/django-admin.py: No such file or directory". But I can
cd into that directory and see the django-admin.py file.

Thanks!

Sandro Dutra

unread,
Mar 7, 2012, 12:53:54 PM3/7/12
to django...@googlegroups.com
I don't know how it's works on a Linux box, but on Windows we've to put Python/Scripts on PATH variable to use the command directly.


2012/3/7 Clark <ccr...@gmail.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...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.


Andre Terra

unread,
Mar 7, 2012, 12:56:06 PM3/7/12
to django...@googlegroups.com
On Wed, Mar 7, 2012 at 2:53 PM, Sandro Dutra <hex...@gmail.com> wrote:
I don't know how it's works on a Linux box, but on Windows we've to put Python/Scripts on PATH variable to use the command directly.


Or you can use virtualenv like I mentioned in the other thread.


Cheers,
AT

backdoc

unread,
Mar 7, 2012, 4:28:10 PM3/7/12
to Django users
I think you might need to install as root or sudo.

From memory.....

sudo python setup.py install

Also, try executing "which django-admin.py" at the terminal. That
will tell you the location of the executable. Basically, I'm curious
if it will even find it, as I'm thinking it didn't install at all. I
just installed the 1.4 rc last night on Debian. I didn't have any
issues.

Andre Terra

unread,
Mar 7, 2012, 5:21:47 PM3/7/12
to django...@googlegroups.com
Again, don't install as root, use virtualenv. This will save you headaches in the future, and unless you have an inexcusable reason to have Django run as root, you shouldn't.


Sincerely,
AT

Shawn Milochik

unread,
Mar 7, 2012, 5:26:14 PM3/7/12
to django...@googlegroups.com
On 03/07/2012 05:21 PM, Andre Terra wrote:
> Again, don't install as root, use virtualenv. This will save you
> headaches in the future, and unless you have an inexcusable reason to
> have Django run as root, you shouldn't.
>
>
> Sincerely,
> AT

+1. Also, there is no excusable reason to need to do it as root, and
many good reasons not to.


backdoc

unread,
Mar 7, 2012, 6:48:18 PM3/7/12
to Django users
I've never set up virtualenv, so I can't speak to that. But, how is
installing Django the same way that I install any other application
more of a risk? If an installer tries to write to /usr/local/bin/,
then it needs elevated permissions to do so. I would assume from that
point on, the remainder of the time, the program runs within the
context of the user who executed it, just like any other shell
commands like tar, ls, mv, rm, python, and so on.

While the web server is running, wouldn't it execute any Django
commands within the context of the web user, like www-data? When I
installed WSGI, I used Synaptic. To use Synaptic, if you start it as
a regular user, you have to give root password. How would is that
different?

You may have very good answers. I'm not saying I'm right and you're
wrong. But, I don't see the problem.

Andres Reyes

unread,
Mar 7, 2012, 8:58:51 PM3/7/12
to django...@googlegroups.com
For me, the main reason to use virtualenv has nothing to do with
security or anything like that, is the convenience of having different
projects with different sets of requirements not interfering with each
other

2012/3/7 backdoc <backd...@gmail.com>:

--
Andrés Reyes Monge
arm...@gmail.com
+(505)-8873-7217

Shawn Milochik

unread,
Mar 7, 2012, 9:51:57 PM3/7/12
to django...@googlegroups.com
On 03/07/2012 08:58 PM, Andres Reyes wrote:
> For me, the main reason to use virtualenv has nothing to do with
> security or anything like that, is the convenience of having different
> projects with different sets of requirements not interfering with each
> other
>
>

It's really all about convenience. Not only is it easier to install (no
root privileges needed), it's easier to deploy on more hosts (where you
don't have many privileges), and on your development machine you're free
to have many different stacks without interference.


Diego Schulz

unread,
Mar 8, 2012, 8:14:59 AM3/8/12
to django...@googlegroups.com
On Wed, Mar 7, 2012 at 11:36 AM, Clark <ccr...@gmail.com> wrote:
> After installing Django I am attempting to start a new project.  After
> creating a directory for this, I tried using the command: "django-
> admin.py startproject mysite".
>
> but I'm getting the message "-bash: django-admin.py: command not found
> ".
>
> So, I've tried running this:
>
> "sudo ln -s library/python/2.6/site-packages/django/bin/django-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

> admin.py /usr/local/bin/django-admin.py" in which i get "file exists"
> and I still get the same problem when running the startproject.
>

You should use the absolute (full) path to django-admin.py, not a relative path.

> Only other piece of info is that during installation I had a "error: /
> usr/local/bin/django-admin.py: No such file or directory".  But I can
> cd into that directory and see the django-admin.py file.
>
> Thanks!
>

Reply all
Reply to author
Forward
0 new messages