Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a Django project folder

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.

like image 780
Sylvain Avatar asked Jan 30 '13 20:01

Sylvain


People also ask

What is Django project folder?

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.

How do I create a current directory in Django?

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> .


1 Answers

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

like image 139
Marc-Olivier Titeux Avatar answered Sep 30 '22 01:09

Marc-Olivier Titeux