Re: DEP pre-proposal for a simpler URLs syntax.

2016-11-02 Thread Paul Egges
Actually, we do something very similar to this in a routes.py for a flask
app. Except instead of "pass" we call a function that has been imported.

Paul



*Flask*
> Doesn't really have the idea of putting all your routes in one spot. So
> pardon the silly example.
>
>
> @app.route('articles/2003/')
> def special_case_2003():
>   pass
>
> @app.route('articles//')
> def year_archive(year):
>   pass
>
> @app.route('articles///')
> def month_archive(year, month):
>   pass
>
> @app.route('articles')
> def article_detail(year, month, day):
>   pass
>
> @app.route('articles//')
> def slug_view(slug):
>   pass
>
>

-- 
> 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/1177f3c9-fe36-41b4-b6b3-
> 69daae8d8409%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/CAD4jHOKtBtgV7VQ-v1%3DOy%3DpJmO15mbg%3D8Agu%3DoDaDKq0APxiaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: DEP pre-proposal for a simpler URLs syntax.

2016-11-02 Thread Pete Wildsmith
I agree that those look odd. As far as the end-user is concerned, though, 
their project's urls module is the root. Does accepting (and removing) a 
leading slash have a negative side-effect that I'm not aware of? Enforcing 
its absence seems to expose an implementation detail.

On Tuesday, 4 October 2016 21:02:00 UTC+1, Tom Christie wrote:
>
> Yup, good points there. I wasn't really considering `include` at that 
> point.
>
> Definitely some awkwardnesses that need thinking about there.
>
> urlpatterns = [
> path('', homepage),
> path('users/', users_list)
> ]
>
> Looks very odd to me, since those are not actually valid URL paths. ('/' 
> and '/users/' are the actual URL paths)
>
> Anyways, something to mull over. That and the import names are probably 
> the two areas that'll need resolutions.
>

-- 
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/46187e25-aa56-426c-82b7-554da6052595%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Uniform content type tables with multiple databases

2016-11-02 Thread Mario Taddei
Hi all, 
I noticed that with multiple databases, the content_type tables are not 
filled in the same way. It is not a bug, but having uniform content type 
tables through multiple databases makes life easier.

If 'django.contrib.contenttypes' app comes before 'django.contrib.auth' in 
INSTALLED_APPS
the content_type table is filled 
here: 
https://github.com/django/django/blob/1.8.9/django/contrib/contenttypes/management.py#L53
 

else (only in the database where 'auth' is migrated, previous method for 
the other databases)
it is filled by the method get_for_model() 
https://github.com/django/django/blob/1.8.9/django/contrib/contenttypes/models.py#L69
called in the 'django.contrib.auth' signal handler: 
https://github.com/django/django/blob/1.8.9/django/contrib/auth/management/__init__.py#L82


For the moment I adopted this solution (don't know if it is the best): 
'contenttypes' before 'auth' in INSTALLED_APPS
and this little modif using sorted() 
method: 
https://github.com/mariuccio/django/blob/stable/1.8.x/django/contrib/contenttypes/management.py#L50


Thanks for any advice,
Mario

-- 
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/78ec3bb3-a0d9-4451-a3a0-cf3e6806eaa9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django

2016-11-02 Thread Gaddam Bhasker Reddy
Hello Everyone,


Thank you for giving your valuable suggestions,today i
started  work on django and i need small tasks on every day if any one
provide small small requirements on  django. I am ready to put my efforts
on django.

  please help me and give your valuable suggestions .

Thanks,
Bhasker Reddy


On Tue, Nov 1, 2016 at 7:44 AM, ludovic coues  wrote:

> First, this mail list is for working on the internal of django, not
> for using it to create website. You are looking for the django user
> mail list.
>
> Second, there is a tutorial on django website [1] and there are other
> easier to follow and covering more subject, like [2].
>
> [1] https://docs.djangoproject.com/en/1.10/intro/
> [2] https://tutorial.djangogirls.org/
>
> 2016-10-27 23:15 GMT+02:00 Gaddam Bhasker Reddy <
> bhaskergaddam...@gmail.com>:
> > Hi everyone,
> > I am new to django,i want learn django indepth,could please let me know
> ,how
> > to start learning django and how start django practice ,could please
> help me
> > ,if any one have idea about how to fluent django,i am ready to do hard
> work
> > on python and django.
> >
> >  please help me
> >
> > --
> > 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/CAOD1959uQx7-
> 1p9rGbPNG7CqbTgb1bDEh-uhLWymPZFa440dDA%40mail.gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
> Cordialement, Coues Ludovic
> +336 148 743 42
>
> --
> 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/CAEuG%2BTYdHJEqd6Ft2Pk-0ZithaMzjYY_
> AWmv93xDM4Gt7He3mA%40mail.gmail.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/CAOD1959ijOVERshKGKcUYG%3DKWaaQRbPLjfQ-ZT%3DRamskJQhNNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.