I am very new to python/django programming, as in I have no programming background. I am working on a class online and I just would like to know exactly what the manage.py file does. I've tried googling it, but I have not found any answers other than it puts a thin shell around django-admin.py. I still don't understand what the file does. I just know I need to type it whenever I do certain things.
Manage.py in Django is a command-line utility that works similar to the django-admin command. The difference is that it points towards the project's settings.py file. This manage.py utility provides various commands that you must have while working with Django.
In addition, manage.py is automatically created in each Django project. It does the same thing as django-admin but also sets the DJANGO_SETTINGS_MODULE environment variable so that it points to your project's settings.py file.
Django python manage.py migrate command migrate executes those SQL commands in the database file. So after executing migrate all the tables of your installed apps are created in your database file.
The django-admin.py script should be on your system path if you installed Django via its setup.py utility. If it's not on your path, you can find it in site-packages/django/bin within your Python installation. Consider symlinking it from some place on your path, such as /usr/local/bin .
(I assume you've read the documentation. But if not, take note that one of Django's great strong points is its documentation -- I recommend going there first before hitting Google.)
You can think of the arguments you pass to manage.py
as subcommands. It is your tool for executing many Django-specific tasks -- starting a new app within a project, running the development server, running your tests...
It is also an extension point where you can access custom commands you write yourself that are specific to your apps.
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