Issues on XP

Subscribe to Issues on XP 6 post(s), 2 voice(s)

 
Avatar tgorham 3 post(s)

I installed the Django stack on XP Pro 2002 sp3 without errors. I rebooted to be cautious. I ran use_djangostack.bat. I’m given a command interpreter open to my project directory. I can successfully launch Python. I am able to “import django” without error. Out of curiosity “import stephane” raises an error.

and here’s where things begin to go wrong.

running django-admin.py startproject mysite gives me SyntaxError: invalid syntax

I do see django-admin.py in BitNami DjangoStack\apps\django\bin\

Sounds like it could be a paths issue similar to what Thunderkil reported. I looked for the .bat equivalent of the djanoconsole antonio pointed him toward but could not find it.

Thoughts? Where do I proceed form here?

 
Avatar diego Moderator 16 post(s)

Hi tgorham,

I think when you say “import stephane” you mean importing the initial project, don’t you?

Are you sure you are in the correct directory, I mean, the PATH and PYTHONPATH work with the system commands and for the “Python Import” function, but they do not include you project directories.

Have you tried using “python /route/to/django-admin.py startproject mysite”?

We will be waiting your answer, you can also read about django-admin configuration on the official site.

Please, tell us which will be the configuration you like the most for DjangoStack.

Cheers

 
Avatar diego Moderator 16 post(s)

I forgot, the “use_djangostack.bat” is the same file as the old “djangoconsole.bat”, it is just a new name in order to have a standard between the stacks.

 
Avatar tgorham 3 post(s)

Diego,

You write:

I think when you say “import stephane” you mean importing the initial project, don’t you?

No. My Python/Django newbie understanding was that init.py in the \BitNami DjangoStack\Apps\Django\Django\ directory made it a package and it was the package that I was importing. I was able to do this from the \Documents and Settings\tgorham\Bitnami DjangoStack projects folder created by the install making me think that PATH and PYTHONPATH were properly configured.

I ran “import stephane” because I knew there was no such package and wanted to see it fail and raise an error. It did, making me feel more confident that “import django had been successful and not just quite.

Have you tried using “python /route/to/django-admin.py startproject mysite”?

No I have not. I suppose one of my challenges is that I don’t know what steps of the install and configuration are supposed to be handled by the BitNami Stack and what steps I am responsible for. Ideally, I would be able to run the install and immediately begin executing the tutorial. Practically, given the diversity of environments in which the install will be run, that may not be possible.

I’ve reviewed the install instructions at DjangoProject.org but as I’ve said, am unclear where the installer’s responsibility ends and mine begins.

Without that understanding two of the outcomes are bad.

If I find a solution to something that should have been handled by BitNami, the developers haven’t learned of a defect that needs to be corrected and the product doesn’t mature.

If BitNami did everything flawlessly and my problems are pure ignorance (fairly likely) then my attempts to fix what I perceive as a problem may create a bigger one.

Please, tell us which will be the configuration you like the most for DjangoStack.

My bias would be to have a single source for django-admin.py versus individual copies for each project (if that was the question?). Your thoughts would be valued.

It was great being able to install all of the components using a single installer.

Thank you for your response and the pointers to the relevant doc.

Best regards,

T Gorham

note: I edited this post to say “package” where I had earlier written “module”.

 
Avatar diego Moderator 16 post(s)

Hi T Gorham,

Here from Bitnami, we can’t configure the installer in order to execute:

django-admin.py startproject mysite

If we do so, we would damage a previous python installation you could have in your system, so we do not enter data in Windows Registry. If you want that association, you should use the Folder Options menu in order to associate .py files with python.exe and if you still have problems modidy the PATHEXT environment variable in order to tell Windows that .py files are executables.

If you do not want to do that steps, you also can use your Djangostack, but you must insert:

python django-admin.py startproject mysite

The problem is that PATH does not work for program arguments, so you must write the path to file:

python c:\Path_to_Django_bin\django-admin.py startproject mysite

Perhaps a little tricky but you only have to do it at the beginning to create your project, and afterwards, you only have to move to your project directory and execute:

python manage.py <commands>

I hope it helps.

Best regards,

Diego

P.S. Well, you are send to your home folder in order to let you go to the place where you want to store your projects.

 
Avatar tgorham 3 post(s)

Great information. That was helpful to me personally and I am certain will be helpful to others in the future.

Thank you,

T Gorham