To create a brand new Django Project you can use the django-admin command followed by the startproject subcommand, followed by the name you would like to assign to the project. If you have multiple Django projects you might want to work on, you can create a directory to hold all of those projects. In our case, we have a djangoprojects directory and all of the development of new Django Projects will happen in there. Let’s navigate to that directory and create a fresh Django Project now.
django-admin startproject myproject
By simply typing django-admin startproject myproject at the terminal, a new Django project will be scaffolded for us. You will not see any feedback right away, but rest assured this command does indeed build a new Django project for you.
This creates a new directory named myproject inside of the djangoprojects directory. We can navigate into that directory using cd myproject, and then list the files with the ls command.
Notice that there is a file named manage.py and a directory named myproject.
Inside of this newly created myproject directory are some additional files that Django needs to make your project work. These files are the __init__.py, asgi.py, settings.py, urls.py, and wsgi.py files. We can see them by using cd myproject and then using the ls command once again.
How To Create A Django Project Summary
Excellent work! You have created a new Django Project and can begin building out the various components when you are ready to do so. Learn More:
- Django Project Intro Tutorial (docs.djangoproject.com)
- Django Setup (realpython.com)
- Learn Server Side Django Skeleton Website (developer.mozilla.org)
- Pycharm Creating And Running Your First Django Project (jetbrains.com)
- Blog Django Start (valentinog.com)
- Django Creating Project (tutorialspoint.com)
- How To Create A Project With Django (freecodecamp.org)
- Django Get Started Start Django Project (docs.bitnami.com)
- How To Create Django Project In Windows (stackoverflow.com)