0

Everybody have to change the settings.py file every time you start a new django project. I think this routine applies for everyone run the manage.py startproject myproject command, when you have to type the same admin name, timezone, templates_dir ... every freaking time.

So I thought if there is way to make this routine modifications came preset for you from the beginning?

I know there is a template file that startproject command use to prepare the settings file, I just can't find it anywhere. can anybody here give me the path of that file?

knowingly I'm using ubuntu and django 1.3.

HXH
  • 348
  • 1
  • 3
  • 11
  • 1
    Customizing the `startproject` template was one of the improvements in the 1.4 release: https://docs.djangoproject.com/en/1.4/releases/1.4/#custom-project-and-app-templates Something to look forward to when you upgrade. – Mark Lavin Apr 12 '12 at 18:28

2 Answers2

1

Once you locate the Django installation (I'd search for it in /usr/share/pyshared/django, at least that is the location on Debian; on Gentoo it is /usr/lib/python<version>/site-packages/django), the location inside the package is conf/project_template.

Anyway, I wouldn't generally recommend modifying the contents of a package installed by the package manager, instead consider using a virtualenv with its local customized Django installation.

koniiiik
  • 4,240
  • 1
  • 23
  • 28
  • Thank, by the way I found some git repo, have too many customization options, and I think the new feature added to django 1.4 base on it. check this out [link](https://github.com/lincolnloop/django-startproject) – HXH Apr 12 '12 at 20:49
0

I just keep a customized settings.py in my home directory and copy it to the project directory after running startproject. Simple and effective.

Chris Lawlor
  • 47,306
  • 11
  • 48
  • 68