Re: Django startproject template enhancement proposal

2016-03-14 Thread Ramez Ashraf
That's a solution :-) Thanks!
I personally create my projects/apps via a script with customized templates.

But for new comers, they will suffer from adding "_app" to their main app.
I know i did at one point.:-)

All the best.


On Tue, Mar 15, 2016 at 2:26 AM, Curtis Maloney  wrote:

> Well, you could use:
>
> mkdir my_client_name
> django-admin startproject project my_client_name/
>
> So it will create my_client_name/project/settings.py, and leave the
> namespace clear for you to create my_client_name/my_client_name/ as your
> app...
>
> --
> Curtis
>
>
>
> On 15/03/16 10:51, Ramez Ashraf wrote:
>
>> May i add to the proposal suffixing the project_name inner directory
>> (the one containing settings.py) with '_proj'
>> Usually i start project called 'my_client_name', then i want an app
>> called 'my_client_name' too,
>> usually i do NOT want my main app called "my_client_name_app"..  table
>> names just looks ugly and unnecessarily long in this case.
>> Nor i want my main/parent directory to be called "my_client_name_proj" ,
>> unnecessarily long for nginx/uwsgi/other paths.
>>
>>
>> tl;dr
>> project_name/
>>..
>>project_name+ "_proj"/
>>app1/
>>..
>>
>> Regards;
>>
>>
>>
>> On Saturday, March 12, 2016 at 6:29:55 PM UTC+2, is_null wrote:
>>
>> Hi all,
>>
>> There's a pattern I like to use in my projects which I'd like to
>> suggest for django startproject.
>>
>> It looks like:
>>
>> project_name/
>>setup.py
>>src/
>>  myapp1/
>>  myapp2/
>>  project_name/
>>settings.py
>>urls.py
>>manage.py
>>wsgi.py
>>
>> My settings.py here uses environment variables for everything to
>> override defaults.
>>
>> Setup.py here allows:
>>
>> - Adding an entry point,
>> - Installing all apps as packages,
>> - Installing test dependencies with extra_requires and pip install
>> project_name[test],
>> - Adding runtime dependencies.
>>
>> For example, with that:
>>
>>  entry_points = {
>>  'console_scripts': [
>>  'project_name = project_name.manage:main',
>>  ],
>>  },
>>
>> And such a manage.py:
>>
>>def main():
>>  os.environ.setdefault("DJANGO_SETTINGS_MODULE",
>> "project_name.settings")
>>  from django.core.management import execute_from_command_line
>>  execute_from_command_line(sys.argv)
>>
>>if __name__ == "__main__":
>>  main()
>>
>> Installing the package will add the project_name command, allowing to
>> run `project_name migrate` for example from any directory.
>>
>> I know it's too opinionated to add that to django, but I'd like to
>> open a discussion here and perhaps there's something we might find
>> worth changing in django's default project template.
>>
>> Thanks for reading !
>>
>> --
>> 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-developers+unsubscr...@googlegroups.com
>> .
>> To post to this group, send email to django-developers@googlegroups.com
>> .
>> Visit this group at https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit
>>
>> https://groups.google.com/d/msgid/django-developers/de495e35-ecad-409c-a5d2-f30512c36931%40googlegroups.com
>> <
>> https://groups.google.com/d/msgid/django-developers/de495e35-ecad-409c-a5d2-f30512c36931%40googlegroups.com?utm_medium=email_source=footer
>> >.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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/X1exTiEybMA/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/56E756BF.905%40tinbrain.net
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

*Ramez AshrafCo-Founder and lead developer radev.io *

-- 
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-developers+unsubscr...@googlegroups.com.
To post to this group, send email to 

Re: Django startproject template enhancement proposal

2016-03-14 Thread Curtis Maloney

Well, you could use:

mkdir my_client_name
django-admin startproject project my_client_name/

So it will create my_client_name/project/settings.py, and leave the 
namespace clear for you to create my_client_name/my_client_name/ as your 
app...


--
Curtis


On 15/03/16 10:51, Ramez Ashraf wrote:

May i add to the proposal suffixing the project_name inner directory
(the one containing settings.py) with '_proj'
Usually i start project called 'my_client_name', then i want an app
called 'my_client_name' too,
usually i do NOT want my main app called "my_client_name_app"..  table
names just looks ugly and unnecessarily long in this case.
Nor i want my main/parent directory to be called "my_client_name_proj" ,
unnecessarily long for nginx/uwsgi/other paths.


tl;dr
project_name/
   ..
   project_name+ "_proj"/
   app1/
   ..

Regards;



On Saturday, March 12, 2016 at 6:29:55 PM UTC+2, is_null wrote:

Hi all,

There's a pattern I like to use in my projects which I'd like to
suggest for django startproject.

It looks like:

project_name/
   setup.py
   src/
 myapp1/
 myapp2/
 project_name/
   settings.py
   urls.py
   manage.py
   wsgi.py

My settings.py here uses environment variables for everything to
override defaults.

Setup.py here allows:

- Adding an entry point,
- Installing all apps as packages,
- Installing test dependencies with extra_requires and pip install
project_name[test],
- Adding runtime dependencies.

For example, with that:

 entry_points = {
 'console_scripts': [
 'project_name = project_name.manage:main',
 ],
 },

And such a manage.py:

   def main():
 os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"project_name.settings")
 from django.core.management import execute_from_command_line
 execute_from_command_line(sys.argv)

   if __name__ == "__main__":
 main()

Installing the package will add the project_name command, allowing to
run `project_name migrate` for example from any directory.

I know it's too opinionated to add that to django, but I'd like to
open a discussion here and perhaps there's something we might find
worth changing in django's default project template.

Thanks for reading !

--
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-developers+unsubscr...@googlegroups.com
.
To post to this group, send email to django-developers@googlegroups.com
.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/de495e35-ecad-409c-a5d2-f30512c36931%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.


--
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-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/56E756BF.905%40tinbrain.net.
For more options, visit https://groups.google.com/d/optout.


Re: Django startproject template enhancement proposal

2016-03-14 Thread James Pic
That sounds pretty fair, particularly since the new default settings
provide a great ootb experience.

Thanks for your feedback, keep up the great work !

-- 
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-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CALC3Kaf5QrgufVaUcZngD5oCDbV0sKm6Jr_Pa2hOQen2BgQZwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django startproject template enhancement proposal

2016-03-14 Thread aRkadeFR

FMPOV, the default template from Django influences:
- the use of settings in .py files over the environment variables;
- the use of manage.py over django-admin command;
- the merge of the "core application" and the project (settings/wsgi...) 
in one django app;


This is very personal and based on my experience while learning Django.

On 03/12/2016 09:01 PM, Florian Apolloner wrote:

On Saturday, March 12, 2016 at 5:29:55 PM UTC+1, is_null wrote:

I know it's too opinionated to add that to django, but I'd like to
open a discussion here and perhaps there's something we might find
worth changing in django's default project template.


Imo it should stay as minimal as it is currently. Since we do allow 
you to specify --template to startproject, you can prepare a default 
project layout that suits you.

--
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-developers+unsubscr...@googlegroups.com 
.
To post to this group, send email to 
django-developers@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/95a6a70e-0499-456d-8dfe-326032710a64%40googlegroups.com 
.

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


--
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-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/56E669E9.5030101%40arkade.info.
For more options, visit https://groups.google.com/d/optout.


Re: Django startproject template enhancement proposal

2016-03-12 Thread Florian Apolloner
On Saturday, March 12, 2016 at 5:29:55 PM UTC+1, is_null wrote:
>
> I know it's too opinionated to add that to django, but I'd like to 
> open a discussion here and perhaps there's something we might find 
> worth changing in django's default project template. 
>

Imo it should stay as minimal as it is currently. Since we do allow you to 
specify --template to startproject, you can prepare a default project 
layout that suits you.

-- 
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-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/95a6a70e-0499-456d-8dfe-326032710a64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.