Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly does manage.py file do

Tags:

manage.py

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.

like image 772
Audra Avatar asked Mar 14 '14 15:03

Audra


People also ask

What is the manage py file?

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.

What is use of manage py file in 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.

What does manage py migrate to?

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.

Where is manage py 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 .


Video Answer


1 Answers

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

like image 103
Paul Bissex Avatar answered Sep 27 '22 17:09

Paul Bissex