This forum is no longer active. Please post your questions to our new community site

how do i start a new project in mac os x 10.4?

Subscribe to how do i start a new project in mac os x 10.4? 12 post(s), 3 voice(s)

 
Avatar geezer 6 post(s)

hi, when i try to start a new project in mac os x 10.4, i get this error on the command line:

/Applications/djangostack-1.0-6/apps/django/bin/django-admin.py startproject thissite
from: can't read /var/mail/django.core
/Applications/djangostack-1.0-6/apps/django/bin/django-admin.py: line 6: syntax error: unexpected end of file

how can i fix this?

any help would be greatly appreciated, thanks.

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi geezer,

It seems that you are using the python installed on your system instead of the Django Stack python. To execute any Stack binary (python, mysql, sqlite, etc) it is necessary to start the “django console” before to start the command. For example, try the following in your terminal:

$ cd /Applications/djangostack-1.0.6
$ ./use_djangostack
$ python django-admin.py startproject thissite

I hope it helps you.

 
Avatar geezer 6 post(s)

hi, i have tried this and, now a new error happens:
bash-2.05b# ./use_djangostack
bash-2.05b# python django-admin.py startproject thissite
/Applications/djangostack-1.0-6/python/bin/.python.bin: can’t open file ‘django-admin.py’: [Errno 2] No such file or directory

any help would be greatly appreciated, thanks.

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

Sorry, it is more easy if you type “django-admin.py” directly without the “python” command:

bq.bash-2.05b# ./user_djangostack
bash-2.05b# django-admin.py startproject thissite

Cheers.

 
Avatar geezer 6 post(s)

hi, still having errors:

bash-2.05b# ./use_djangostack
bash-2.05b# django-admin.py startproject thisite
from: can’t read /var/mail/django.core
/Applications/djangostack-1.0-6/apps/django/bin/django-admin.py: line 6: syntax error: unexpected end of file

any help would be greatly appreciated, thanks.

 
Avatar geezer 6 post(s)

hi, this works though:

bash-2.05b# ./use_djangostack
bash-2.05b# python /Applications/djangostack-1.0-6/apps/django/bin/django-admin.py startproject thissite
bash-2.05b#

but why do i have to type the whole pwd to django-admin.py?

Any help would be greatly appreciated, thanks.

 
Avatar geezer 6 post(s)

hi, i would like to install the satchmo webshop on my mac os x 10.4, and use the djangostack for this, but satchmo has some requirements listed here: http://www.satchmoproject.com/docs/svn/requirements.html. I was wondering if the python that comes with the djangostack has the python source libraries with it?,

also, if i were to install python packages such as: pycrypto-2.0.1.tar.gz, how and where in the djangostack would i install them?

thanks.

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi geezer,

It is not necessary to type the whole pwd to django-admin.py. Try to execute the following:

bash# ./use_djangostack
bash# django-admin.py startproject thissite

It is necessary to specify the whole pwd because the “python” command needs a file argument.

About your second question, you can follow these steps to install modules over DjangoStack:

1. Download and extract the pycrypto module.
2. Execute:
bash# ./use_dangostack
bash# cd pycrypto-2.0.1
bash# python setup.py build

Tip: If you see the following error:
>/usr/bin/ld: cannot find -lpython2.5
>collect2: ld devolvió el estado de salida 1
>error: command ‘gcc’ failed with exit status 1
It is necessary to set the LDFLAGS tag to compile. Try to export this variable before to compile:
bash# ./use_djangostack
bash# export LDFLAGS=/Applications/djangostack-1.0-6/python/lib
bash# python setup.py build

3. Finally run the install script:
bash# python setup.py install

I hope it helps you!

 
Avatar mikele 13 post(s)

hi all, I get the same error geezer mentioned… here’s the code:


bash-3.2$ ./use_djangostack 
bash-3.2$ which python
/Applications/djangostack-1.0-6/python/bin/python
bash-3.2$ django-admin.py startproject newproject
from: can't read /var/mail/django.core
/Applications/djangostack-1.0-6/apps/django/bin/django-admin.py: line 6: syntax error: unexpected end of file

bash-3.2$ /Applications/djangostack-1.0-6/apps/django/bin/django-admin.py startproject newproject
from: can't read /var/mail/django.core
/Applications/djangostack-1.0-6/apps/django/bin/django-admin.py: line 6: syntax error: unexpected end of file
bash-3.2$ python /Applications/djangostack-1.0-6/apps/django/bin/django-admin.py startproject newproject
bash-3.2$ ls newproject/
__init__.py    manage.py    settings.py    urls.py

There’s a workaround obviously… but I’m new to python, so I don’t know if I’ll need to write the complete path when issuing other commands too (such as the scripts in rails).

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi mikele,

Try to edit the /Applications/djangostack-1.0-6/apps/django/bin/django-admin.py file and replace:

#!/Applications/djangostack-1.0-6/python/bin/.python.bin

with

#!/usr/bin/env python

Let us know if it is a valid solution for you and we will try to fix for the next version.

Cheers.

 
Avatar mikele 13 post(s)

Hi beltran

yes it did the trick! thanks a lot :-)
Just a small detail: the first line of /Applications/djangostack-1.0-6/apps/django/bin/django-admin.py in my case wasnt ending as you’ve written above (.python.bin), but just with ‘python’, i.e.


!/Applications/djangostack-1.0-6/python/bin/python

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Thanks mikele for your feedback!