How to create a Django project folder
django example project
django website example code
django create superuser
django website tutorial
how to run django project in cmd
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
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.
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
Start a new project, Throughout this tutorial, we'll walk you through the creation of a basic poll application. The inner mysite/ directory is the actual Python package for your project. To create a Django project, you will have to start your virtual environment which we set up in the last tutorial of Install Django and Set up a virtual environment, in that directory, you will be creating your Django project.
$ is not a part of the command, it is a command prompt. It indicates that the command should be entered in a command line interpreter.
The command itself should start with
django-admin.py startproject django_bookmarks
Writing your first Django app, part 1 | Django documentation, Pay attention, this is not the actual Django project, but just its "home". Once inside the new folder create a Python virtual environment and Create a Project Whether you are on Windows or Linux, just get a terminal or a cmd prompt and navigate to the place you want your project to be created, then use this code − $ django-admin startproject myproject This will create a "myproject" folder with the following structure −
In case if someone still needs, you have to have python in front of that:
directory1\directory2>python django-admin.py startproject django_bookmarks.
How to create a Django project and a Django application, ( python manage.py runserver ), and then navigate to http://127.0.0.1:8000/admin. Enter your superuser's username and password to login to the admin page. This is just a sanity check to ensure that all is working. "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.
Use this command after activating your virtual environment.
django-admin startproject project_name
then to create a new app run this command:
python manage.py startapp app_name
Starting a Django Project – Real Python, conventions, such as having models , tests , urls , and views submodules. This command will create your new Django project, starting from the template. (Note that in this example I used new-django-project for the outer folder and new_django_project for the project name). Now as convenient it could be, you might wonder if there's a way to use a remote template, maybe from a Github repo. Yes, you can!
Advanced tutorial: How to write reusable apps, A Django project template is nothing more than a pre-defined project with a custom directory structure, and you can create one for yourself in This startproject command assumes (by use of . at the end) that the current folder is your project folder, and creates the following within it: manage.py: The Django command-line administrative utility for the project. You run administrative commands for the project using python manage.py <command> [options].
How to create a Django project from a template, In this tutorial you'll learn how to install Django and set up your project. This creates a new directory called “my_django15_project” with the basic Django Creating a project¶. If this is your first time using Django, you’ll have to take care of some initial setup. Namely, you’ll need to auto-generate some code that establishes a Django project – a collection of settings for an instance of Django, including database configuration, Django-specific options and application-specific settings.
How to create a Django project folder, 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):. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', # 'django.template.loaders.eggs.Loader', ) This way, I have a templates folder in my project root that is used for non-app templates and each app has a templates/appname folder inside the app itself.
- No problem. If it works, would you mind accepting the answer? Cheers
- It works perfectly!! Note for those who experience the same ordeal: I uninstalled Python3.3, intalled Python2.7, and make sure that PYTHONPATH is clean. You can do that by typing "echo %PYTHONPATH%" in Windows Command Prompt. And I reinstalled Django and followed Marc-Olivier Titeux' advice.
- This answer is good !!! Just paste the path to your django-admin.py file. It works for me.
- Hello , thanks for editing! even without the $ sign I get an error message "unrecognized.." and I tried at c:\, at c:\Django(main folder)...
- @Sylvain No problem. Did omitting the
- unfortunately, omitting $ did not help
- yeap:"Django-admin.py is not recognized as an internal command, operable program or batch file.
- This means Django is not installed properly, I guess.
django-admin.pyshould be available. But I haven't tried it on Windows, unfortunately.