Sunday, March 30, 2014

Re: register for mIRC

Hi,

Registration of your username isn't something #django specific - it's something you need to do in order to use IRC in general. Not all channels enforce the requirement for a registered ID, but is a common approach in popular channels to prevent people from impersonating others.

To register, you need to have a "conversation" with the NickServ bot. See:


for more details. More general help on using IRC can be found here:


I hope that helps!

Yours, 
Russ Magee %-)


On Sun, Mar 30, 2014 at 3:38 AM, CS <sw.cornel@gmail.com> wrote:
Hi everyone,

I am new at python and I want to start to learn django.
I have small question, how can I register my ID to join #django in mIRC?

CS

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/677c008b-7bfb-46cb-8185-4142f0883728%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 users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJxq84_NxE6o0ZUN-%2BeU1hMF4jRxm3UZ7G_5U5iH9w33P9Z3SA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Allow the Prefetch queryset to be used with GenericForeignKey

That would be awesome, somebody has a solution for this?

On Sunday, February 16, 2014 2:53:55 PM UTC-3, Robert Kajic wrote:
I would love it if the Prefetch object allowed me to pass in custom querysets when prefetching related generic foreign fields. Specifically I want this in order to call select_related on each subgroup.
For now I've subclassed the GenericForiengKey class, overriding get_prefetch_queryset, to allow me to use modelless querysets like this:

.prefetch_related(
        Prefetch('obj', queryset=QuerySet().select_related(
            "user", "poem__user", "consumer", "producer"
))

In get_prefetch_queryset, for each subgroup, I copy the select_related options from the modelless queryset to the subgroup queryset:

qs = ct.get_all_objects_for_this_type(pk__in=fkeys)
# Copy any select related options from queryset to qs
qs = self.combine_select_related(qs, queryset)
ret_val.extend(qs)

Initially I thought I would simply be able to combine the two querysets using QuerySet.__or__, but I noticed that Query.combine refuses to run unless both queries are on the same model. Would there be any harm in allowing it to combine Queries even if the qeries are not on the same model, as long as one of the queries doesn't have a model at all? Then the above could be changed into:

# Copy any select related options from queryset to qs
qs |= queryset

This would have the added benefit of copying other options other than select_related.

I know this is problematic because you may not want to combine the same queryset with each individual group. Ideally, the developer would be able to specify a different queryset for each group kind.

.prefetch_related(
        Prefetch('obj', queryset=QuerySet().select_related(
            "user", "poem__user", "consumer", "producer"
))

Does anyone have any thoughts on this? 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7a7a4157-51b2-4e89-8cb0-ce25b5445b36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: STATIC and MEDIA

Hi Julio!

Thank u so much!

Jonathan
Diretor de Tecnologia
+55(12)98864-1594

Sent from my iPhone

> On Mar 30, 2014, at 13:49, Julio Molina Soler <julio.molina@telenet.be> wrote:
>
> Hi Jonathan,
>
> the cleanest way I found:
>
> at the beginning of your settings.py add
>
> import os
> BASE_PROJECT = os.path.dirname(__file__)
>
> then when the section comes
>
> MEDIA_ROOT = os.path.join(BASE_PROJECT,'media')
> MEDIA_URL = '/media/'
>
> STATIC_ROOT = os.path.join(BASE_PROJECT,'static')
> STATIC_URL = '/static/'
>
> and in some cases I also add the static inside the apps like this
>
> STATICFILES_DIRS = (
> # Put strings here, like "/home/html/static" or "C:/www/django/static".
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> os.path.join(BASE_PROJECT, 'newApp','static')
> )
>
> Julio,
>
>> On dom 30 mar 2014 00:39:41 CET, Jonathan Querubina wrote:
>> Guys
>>
>> What is the best way to configure and make accessible via URL the STATIC and the MEDIA uri?
>>
>> I can`t seem to find a good way, and get so many errors for the both being equal.
>>
>> Can someone send me an example of this configs?
>>
>> Thanks!
>>
>
>
>
> --
> Julio Molina Soler
> julio.molina@telenet.be
> Github: https://github.com/jmolinaso
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/53384B12.3050202%40telenet.be.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/E689782E-CE07-4770-855B-61ED7BA53CC5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: STATIC and MEDIA

Hi Jonathan,

the cleanest way I found:

at the beginning of your settings.py add

import os
BASE_PROJECT = os.path.dirname(__file__)

then when the section comes

MEDIA_ROOT = os.path.join(BASE_PROJECT,'media')
MEDIA_URL = '/media/'

STATIC_ROOT = os.path.join(BASE_PROJECT,'static')
STATIC_URL = '/static/'

and in some cases I also add the static inside the apps like this

STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or
"C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(BASE_PROJECT, 'newApp','static')
)

Julio,

On dom 30 mar 2014 00:39:41 CET, Jonathan Querubina wrote:
> Guys
>
> What is the best way to configure and make accessible via URL the STATIC and the MEDIA uri?
>
> I can`t seem to find a good way, and get so many errors for the both being equal.
>
> Can someone send me an example of this configs?
>
> Thanks!
>



--
Julio Molina Soler
julio.molina@telenet.be
Github: https://github.com/jmolinaso

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/53384B12.3050202%40telenet.be.
For more options, visit https://groups.google.com/d/optout.

Django apps

I wish to develope application that can give directions and location.

Pleas i need some guidance for a way forward. I have done some research but
still not getting it right. 

I need some guidance

Thanks

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a240e0bf-b14b-4fb1-86cb-d134e8a50f70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Saturday, March 29, 2014

STATIC and MEDIA

Guys

What is the best way to configure and make accessible via URL the STATIC and the MEDIA uri?

I can`t seem to find a good way, and get so many errors for the both being equal.

Can someone send me an example of this configs?

Thanks!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7C03A25B-2634-4FDD-A4B2-B6F13CEA699D%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Django (1.5) login exception (Save with update_fields did not affect any rows)

In my Django web app (running on Google App Engine), when a new user signs up a User object is created and then that user is authenticated and logged in. Every once in a while, the login function throws an exception (DatabaseError: Save with update_fields did not affect any rows) and I'm not really sure why this is happening (this is my first Django app).

newuser = User.objects.create_user(username, "", password)        newuser.first_name = username      newuser.save()           # Create and save an associated accounts table to the system      models.Accounts(user=newuser).save()          # Authenticate the new user      newuser = authenticate(username=username, password=password)        # This is the login that occasionally throws an exception      login(request, newuser)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/dd0fe745-91bc-41b0-bd5b-e8561b43e8e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.