I'm following a tutorial on Django and I'm suppose to create a folder via Windows Command Prompt (the turorial asks to type the following at C:\
):
django-admin.py startproject django_bookmarks
and I should get the following folder with these files:
django_bookmarks/
__init__.py manage.py settings.py urls.py
I tried at c:\, at c:\Django-1.4.2.
and I get the same following error messages:
"Django-1.4.2 is not recognized as an internal or external command, operable program or batch file"
Note: Django is properly installed. I made a test on python and it shows Django's version properly.
How do I create that folder?
Any help will be appreciated.
Django makes use of a directory structure to arrange different parts of the web application. It creates a project and an app folder for this. Creating a proper project and organizing it helps in keeping the project DRY (Don't Repeat Yourself) and clean.
To create a new project, one typically uses the following command. Although it's not documented in the official documentation, the solution, however, is extremely simple. You just add a dot to Django's startproject command, which uses the command's [directory] argument. django-admin startproject <YOUR_PROJECT_NAME> .
You may try using the following command (if Python-2.7.X is your interpreter, and if you have not installed Django in a virtualenv):
C:\Python27\Scripts\django-admin.py startproject django_bookmarks
If you have installed Django in a virtualenv, replace the part C:\Python27
by the path to this virtualenv.
If you have installed several versions of Python, Have a look at this SO answer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With