Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "management.py" in Django?

According to this documentation, I have to put something in management.py so that things are created when I run "syncdb"

Where do I do that? I don't see management.py anywhere.

http://code.google.com/p/django-notification/wiki/IntegratingNotification#Creating_Notice_Types

like image 299
TIMEX Avatar asked Dec 15 '10 22:12

TIMEX


People also ask

What is the purpose of manage py?

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

What is 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.

When you create an object in Django What does it represent?

1 Answer. Save this answer. Show activity on this post. objects is a reference to the model's Manager, whos sole purpose is to handle the database queries to retrieve the required data from a database.


1 Answers

Put it in the relevant app's directory. For example, if you have a project like:

my_project/
    my_app/
        models.py
        views.py
        tests.py

Stick it here:

my_project/
    my_app/
        management.py
        models.py
        views.py
        tests.py

(That will make a management module within the *my_app* package, in Python terminology.)

like image 170
mipadi Avatar answered Sep 28 '22 10:09

mipadi