Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Jan. 4, 2011 20:25:17

P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Setup issue


Hi all,

I am having a setup issue on my personal laptop, I got through setup
and couple of tutorials on my Mac in work but not having any joy at
home. I'm running Ubuntu 10.04 Lucid Lynx.

I run "import django" and I don't get any errors back so I thought I
was OK, but when I run "django-admin.py startproject projectname" I
get back an error saying...

"File <stdin>", line 1....django-admin.py startproject
projectname......Error: invalid syntax"


I'm running on python 2.6.5, I had python3 installed and got rid of it
encase it was conflicting, basically my question is were do I need to
start looking, I must be missing something but I'm not sure were to
start. Any advice I could get would be magic as it's my new year
resolution to be efficient django man by end of year, not off to a
great start :(

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 4, 2011 20:31:25

C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Setup issue


Are you running "django-admin.py startproject projectname" within the
python interpreter?
Its supposed to run outside of the interpreter on the command line.

On Jan 4, 3:17 pm, Phil <phil...@gmail.com> wrote:
> Hi all,
>
> I am having a setup issue on my personal laptop, I got through setup
> and couple of tutorials on my Mac in work but not having any joy at
> home. I'm running Ubuntu 10.04 Lucid Lynx.
>
> I run "import django" and I don't get any errors back so I thought I
> was OK, but when I run "django-admin.py startproject projectname" I
> get back an error saying...
>
> "File <stdin>", line 1....django-admin.py startproject
> projectname......Error: invalid syntax"
>
> I'm running on python 2.6.5, I had python3 installed and got rid of it
> encase it was conflicting, basically my question is were do I need to
> start looking, I must be missing something but I'm not sure were to
> start. Any advice I could get would be magic as it's my new year
> resolution to be efficient django man by end of year, not off to a
> great start :(

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Jan. 4, 2011 20:33:28

Shawn M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Setup issue


What actual project name are you using? Have you tried using different project
names?

If you're literally using "projectname" then you may be using a command-line
argument and causing a conflict.

Shawn

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 Jan. 4, 2011 23:33:23

P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Setup issue


Hi Shawn,

When it wasn't working I tried both from command line and from
interpreter, from command line just says "command not found". No I
wasn't calling the project that, I've tried a few different project
names and none seem to work.

Thanks for advice/ tips. I'll keep posted when I get to the bottom of
it.



On Jan 4, 3:33 pm, Shawn Milochik <sh...@milochik.com> wrote:
> What actual project name are you using? Have you tried using different
> project names?
>
> If you're literally using "projectname" then you may be using a command-line
> argument and causing a conflict.
>
> Shawn

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#5 Jan. 5, 2011 01:07:11

Mike R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Setup issue


On Tuesday, January 04, 2011 03:33:17 pm Phil wrote:
> Hi Shawn,
>
> When it wasn't working I tried both from command line and from
> interpreter, from command line just says "command not found". No I
> wasn't calling the project that, I've tried a few different project
> names and none seem to work.
>
> Thanks for advice/ tips. I'll keep posted when I get to the bottom of
> it.
>

Sounds like django-admin.py is not in your path. see about setting the
path for os x (the same instructions and explanation can go for linux/*nix)

The path in this case should have a listing fordjango/bin (note no leading /,
I've named a relative path within the django checkout/install, you'll want
to add the absolute path for your system).

You're problem here suggests two things to me, 1. you're a novice to
python/django (it's fair, we all got to start somewhere). 2. you have no clue
on how any of your operating systems really work (again we have to start
somewhere).

I would suggest before you run off and make "the next big website", you sit
back and take a few weeks to learn the basics of both administration for your
operating systems (focusing on what os your site is going to run on in
production) and working with python before you start building your site. (if
this is a problem, i.e. you've taken a job without the minimum requirements
met and need to get this done now, then do them side by side).

If you don't, you'll find yourself with many more headaches like file
permissions, where files are uploaded and how to access them and store them
securly, dealing with module paths and import problems and even figuring out
how to get your webserver of choice to serve your django site. These are
mainly operating system issues.

Also learn the difference between a python module and a python application.
In this case django is a python module that provides a few python applications
to make the developers life easier. You should be able to recognize them on
sight and be able to use them both easily before you begin developing.


Also if you google your error and the command name you'll see that the
solution for you in the first page of results (in this case the first hit).
99% of most problems are answerable this way... as others have documented or
asked a similar question and given a solution from various sources. If your
google-fu isn't that great, time to practice this also. It'll save you much
time and headaches.

For me, these three things are essential: Knowing how a computer works,
knowing how your operating system works and knowing how a programming language
and the tools work are 3 different things and equally important in
development, regardless if it's a website, desktop application, or
server/service.


IMO a good developer is also a good admin and visa-versa. *being an admin led
me to being a developer, from wanting to understand how to debug and trace
application issues to get around problems*

Mike


http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable/http://code.djangoproject.com/browser/django/trunk/django/binhttp://www.google.com/search?q=command+not+found+%2Bdjango-admin.pyhttp://code.djangoproject.com/wiki/InstallationPitfalls--
The worst cliques are those which consist of one man.
-- G.B. Shaw

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#6 Jan. 5, 2011 11:30:42

T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Setup issue


On Jan 4, 10:17 pm, Phil <phil...@gmail.com> wrote:
> Hi all,
>
> I am having a setup issue on my personal laptop, I got through setup
> and couple of tutorials on my Mac in work but not having any joy at
> home. I'm running Ubuntu 10.04 Lucid Lynx.
>
> I run "import django" and I don't get any errors back so I thought I
> was OK, but when I run "django-admin.py startproject projectname" I
> get back an error saying...
>
> "File <stdin>", line 1....django-admin.py startproject
> projectname......Error: invalid syntax"
>

on linux you have to type:

'python django-admin.py startproject projectname'

I think your missing the python let me know if this sorts it out

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#7 Jan. 6, 2011 03:50:47

Mike R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Setup issue


On Jan 5, 1:34 am, TheRedRabbit <aqu...@gmail.com> wrote:

> on linux you have to type:
>
> 'python django-admin.py startproject projectname'
>

Actually this is incorrect. see line 1 of django-admin.py That
line allows the python script to be ran as a regular command it is
called the shebang . The only time you need to call `python django-
admin.py` on linux is if you're specifying a python version to use,
say 2.6 is the default but you want to check against 2.7 or 3.x. then
you would specify the right python interpreter (either calling the
full path to it or if you set it up with an extension and have it in
your path, i.e. /usr/bin/python3). Otherwise the shebang line will
take care of it for you.


http://code.djangoproject.com/browser/django/trunk/django/bin/django-admin.py#L1http://en.wikipedia.org/wiki/Shebang_(Unix)

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#8 Jan. 6, 2011 03:51:20

Mike R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Setup issue


> on linux you have to type:
>
> 'python django-admin.py startproject projectname'
>
> I think your missing the python let me know if this sorts it out


Forgot to add the executable bit must be set in the permissions i.e.:
chmod a+x django-admin.py (though this is already done for you by the
django team as it comes out of svn/tarballs with it set.)

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#9 Jan. 16, 2011 13:36:28

P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Setup issue


Thanks for reply Mike and TheRedRabbit, unfortunately I have never got
to try your suggestions. Before your response came in I tried
upgrading Lucid Lynx to Maverick Meerkat and lets just say it didn't
go well for me, I no longer have Linux installed on my laptop so am
back in Windows :(

to be continued....



On Jan 6, 3:51 am, Mike Ramirez <gufym...@gmail.com> wrote:
> > on linux you have to type:
>
> > 'python django-admin.py startproject projectname'
>
> > I think your missing the python let me know if this sorts it out
>
> Forgot to add the executable bit must be set in the permissions i.e.:
> chmod a+x django-admin.py  (though this is already done for you by the
> django team as it comes out of svn/tarballs with it set.)

--
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
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 19th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support