Installed Apps in settings.py

922 views
Skip to first unread message

Parthan SR

unread,
Jul 31, 2006, 12:58:36 AM7/31/06
to django...@googlegroups.com
Hi,

Am trying out my first hands with Django and was following the tutorial given in the documentation. I have created a project and in the settings.py file, as it is said in the tutorial, there is no default installed apps. It is like...

INSTALLED_APPS = (
)

The tutorial says the following will be found by default in this section.

        * django.contrib.auth -- An authentication system.
        * django.contrib.contenttypes -- A framework for content types.
        * django.contrib.sessions -- A session framework.
        * django.contrib.sites -- A framework for managing multiple sites with one Django installation.

Can I add these manually before doing a "syncdb"? Do I have to make any
changes anywhere to get the samething working ? If I can edit the settings.py manually adding these 4 default things as said, how do the settings.py need to be, ie what is the format to add these entries into the INSTALLED_APPS section ?

Thanks in advance :)
-- 
With Regards

Parthan ('technofreak')
------------------------------
Research Assistant @ NRC-FOSS and Python\PHP Developer
A Proud Tuxian and an Ubuntero

limodou

unread,
Jul 31, 2006, 1:30:58 AM7/31/06
to django...@googlegroups.com
On 7/31/06, Parthan SR <perl.tec...@gmail.com> wrote:
> Hi,
>
> Am trying out my first hands with Django and was following the tutorial
> given in the documentation. I have created a project and in the settings.py
> file, as it is said in the tutorial, there is no default installed apps. It
> is like...
>
> INSTALLED_APPS = (
> )

How do you create your project, using: django-admin.py startproject
XXX? If you did like this, the settings.py should include default
apps.

>
> The tutorial says the following will be found by default in this section.
>
> * django.contrib.auth -- An authentication system.
> * django.contrib.contenttypes -- A framework for content types.
> * django.contrib.sessions -- A session framework.
> * django.contrib.sites -- A framework for managing multiple sites
> with one Django installation.
>
> Can I add these manually before doing a "syncdb"?

Yes. And you can also modify the settings.py as you change the
project, and rerun the syncdb command.

> Do I have to make any changes anywhere to get the samething working ?

Maybe you don't need.

> If I can edit the settings.py manually adding these 4 default things as said, how do the
> settings.py need to be, ie what is the format to add these entries into the
> INSTALLED_APPS section ?

Of course you can add them manually. And there are string fromat, just
like python module. But you should write them just like these:

'yourprojectname.appname1',
'yourprojectname.appname2',

And you can also write them other formats, as long as django can
import them. For example:

'yourprojectname.apps.appname1'

or

'apps.appname1' # and you should add apps' parent directory to
PYTHONPATH, so as django can import them correctly.
>

--
I like python!
My Blog: http://www.donews.net/limodou
My Django Site: http://www.djangocn.org
NewEdit Maillist: http://groups.google.com/group/NewEdit

Technofreak

unread,
Jul 31, 2006, 4:59:13 AM7/31/06
to Django users

limodou wrote:

>
> How do you create your project, using: django-admin.py startproject
> XXX? If you did like this, the settings.py should include default
> apps.
>

Ya, I did create using 'django-admin.py startproject XXX' but I din't
get the default apps included in the settings.py. Thats the basic
reason behind posting the original message to this group.

> > * django.contrib.auth -- An authentication system.
> > * django.contrib.contenttypes -- A framework for content types.
> > * django.contrib.sessions -- A session framework.
> > * django.contrib.sites -- A framework for managing multiple sites

> Of course you can add them manually. And there are string fromat, just


> like python module. But you should write them just like these:
>
> 'yourprojectname.appname1',
> 'yourprojectname.appname2',
>

As now I don't have the default apps, so can I inlude them in my
settings.py as below :

INSTALLED_APPS (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites'
)

Also, as i don't get the defualts inluded automatically, how will I set
it right? How does django decide which apps to include by default and
will I be able to check whether this setting is right or not ?

limodou

unread,
Jul 31, 2006, 5:12:54 AM7/31/06
to django...@googlegroups.com

Just think: import django.contrib.auth, etc.

> How does django decide which apps to include by default and
> will I be able to check whether this setting is right or not ?
>
>

These things are implemented in django/core/management.py, and the
template files is in django/conf/project_template/settings.py. And you
should see the default settings.py template. My version is 0.95, and
the settings.py file includes the default apps.

Please check your installation, maybe you should remove the django and
reinstall.

Reply all
Reply to author
Forward
0 new messages