'How to start a new Django project

Environment:

Windows 7
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
Django==1.7.5

Whenever I try to create a new project:

python .\Scripts\django-admin.py startproject new_project,

I get this error:

python: can't open file 'django-admin.py': [Errno 2] No such file or directory

Where am I going wrong? Thank you all in advance.



Solution 1:[1]

If you're using Windows, which I believe you are, leave off the .py on the django-admin.py. In other words, try django-admin startproject new_project.

Solution 2:[2]

You can use a project template to create your Django apps. Check out this repository that has most of the recent python libraries:

https://github.com/marcosflp/django-boilerplate/blob/main/README.md

Solution 3:[3]

Boilerplate Code To create django as well create django app you have to follow many common commands. for simplicity, kindly follow the below single-line commands separated by semicolon:

django-admin startproject project_name; cd project_name;python3 manage.py startapp app_name; cd app_name; mkdir templates

Those commands will create commonly used structure for django.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Chris Kavanagh
Solution 2 Marcos Felipe
Solution 3 Wasim Shaikh