Config file for startproject.

98 views
Skip to first unread message

Hiroki Kiyohara

unread,
Jun 22, 2015, 10:38:24 PM6/22/15
to django-d...@googlegroups.com
Hi all.

I propose a new feature `.djangorc`.
It should be included in root of project template.
You can write down configations for `startproject --template=...`

## Motivation

I always use custom project template, but it requires a lot of arguments like...

    django-admin startproject --template=/path/to/template --extension=py,md,rst,ini,cfg --name=.coveragerc <project_name>

Actually I use this `startproject` feature to create 'repository skeleton' not only django's project directory.
'repository skeleton' contains like README.md, tox.ini, .coveragerc, and django's project direcotry and so on.

I know this usage of `startproject` is little tricky. but I think some of django users use like this and
want this `.djangorc` feature (not to pass a lot of argument).

## Proposal

`.djangorc` will contain some of this.

```
[startproject]
extension=py,md,rst,ini,cfg
name=.coveragerc
```

and If some project template contains this file, startproject command follow this config on creation process.

How do you think about it?
It's just my idea and there's no implementation.
I want your feedback, thank you.

Josh Smeaton

unread,
Jun 22, 2015, 11:08:59 PM6/22/15
to django-d...@googlegroups.com
There are a couple of problems with this proposal IMO.

1) The .djangorc file would need to be somewhere on the file system (like ~/.djangorc), because you want it for the startproject command, it can't be deployed with startproject
2) It doesn't seem to provide that big a benefit
3) A simple bash alias can achieve the exact same result

I just don't think this is something that Django needs to take on when it's very easy to create your own alias that does exactly what you need.

Regards,

Hiroki Kiyohara

unread,
Jun 23, 2015, 12:26:27 AM6/23/15
to django-d...@googlegroups.com
Thanks, Josh.

* I thought the config (.djangorc) should be included in project template it's own.
* bash alias is OK, but it's not easy to share this way with lots of developers like "Hey, when you start development, please type `alias mystartproject...` (so long)."

anyway, I got it. I'll create some aliases or wrapper commands if it's necessary.


--
You received this message because you are subscribed to a topic in the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-developers/mOMTohdfVOI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/c4da9a61-fc06-4992-acff-12db064c91de%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Marc Tamlyn

unread,
Jun 23, 2015, 3:43:53 AM6/23/15
to django-d...@googlegroups.com

You may also want to look into cookiecutter as a way of managing more complex templates for projects.

Marc

You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.

To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.

Josh Crompton

unread,
Jun 23, 2015, 7:17:14 AM6/23/15
to django-d...@googlegroups.com
Sounds like you might want to take a look at cookiecutter[0] and/or
project templates[1]

[0] https://github.com/audreyr/cookiecutter
[1] https://docs.djangoproject.com/en/dev/ref/django-admin/#startproject-projectname-destination
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-develop...@googlegroups.com.
> To post to this group, send email to django-d...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAPYpbLUWr2sPtyS8V7KwrgbyBnxs-Mko%2B_3dendHY-y-a3eEhQ%40mail.gmail.com.

Fabio Caritas Barrionuevo da Luz

unread,
Jun 23, 2015, 8:39:05 AM6/23/15
to django-d...@googlegroups.com
for example, check whether this level of customization capabilities of the generated project that you need:


pip install tox cookiecutter

cookiecutter https://github.com/ionelmc/cookiecutter-pylibrary.git


The ionelmc cookiecutter-pylibrary project uses the cookiecutter hooks to customize post-generated project[1]

that said, the cookiecutter master branch, not yet released, now supports choices[2]

Hiroki Kiyohara

unread,
Jun 23, 2015, 8:11:14 PM6/23/15
to django-d...@googlegroups.com
Thank you every one.

Ill try it.


2015年6月23日火曜日 21時39分05秒 UTC+9 Fabio Caritas Barrionuevo da Luz:
Reply all
Reply to author
Forward
0 new messages