Dropzone.js and images POST on new object

2015-02-09 Thread Karim
Hello mates!
I tried dropzone.js on my app and everything worked fine. Now I want to use
it in a view that loads a form for tthe creation of a new object. The
dropzone where the user drop the images should load the images on the
server instantly and not when the user submit the form.

This approach is easy to do when the object is already in the model, for
example when I want to change the profile image of the user, but when the
object is not even in the database, how I can upload instantly the images?

I though that I could write a view to use with dropzone that get the images
and store them in the sessions. Than when the user submit the form, the
form object get the images from the session and save them in the new
object. Could be a good design pattern?

Thank you!

-- 
Karim N. Gorjux

-- 
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+unsubscr...@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/CACeuRGXU0DynH%3D%2BbmGx8Ks_C7ZsyHAn8%3D7TsbRK6TyGTpckEbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Edx LDAP Auth setting

2015-02-09 Thread Lachlan Musicman
Yip, EDX looks complex - can you search for the settings file and report back?

AuthLDAP is annoying, but it does work - I've used it successfully
against an AD backend. The error messages are important to read.

But first, find your settings file.

You will need to provide us with more info too. What's not working?
What have you put into the settings file? What version of django is
EDX using, and does django_auth_ldap provide support for that django
version, what error messages are you getting? Can you attach to the
ldap server from just the django shell (ie, are the username and
password etc correct)?

cheers
L.
--
"This is a profound psychological violence here. How can one even
begin to speak of dignity in labor when one secretly feels one's job
should not exist?"

On the Phenomenon of Bullshit Jobs, David Graeber
http://strikemag.org/bullshit-jobs/


On 10 February 2015 at 15:00, 'Yip Terence' via Django users
 wrote:
> Dear All,
>
> I have been installed the open edx and django_auth_ldap package
> (http://code.edx.org/) in our environment.  However, I'm not successful to
> config the Auth with LDAP.  Could anyone could provide the guide to me?  I
> don't know where is the settings.py file path in open edx.
>
> Please help.
>
> Thanks and Regards,
> Terence Yip
>
> --
> 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+unsubscr...@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/65f0df30-c315-401c-9711-9228779a65ed%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+unsubscr...@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/CAGBeqiO8JN2BxGdKvoWhJQ6mrQdQY%2B5tq3AT5Rs6%2BPbJE_QKqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Edx LDAP Auth setting

2015-02-09 Thread 'Yip Terence' via Django users
Dear All,

I have been installed the open edx and django_auth_ldap package 
(http://code.edx.org/) in our environment.  However, I'm not successful to 
config the Auth with LDAP.  Could anyone could provide the guide to me?  I 
don't know where is the settings.py file path in open edx.

Please help.

Thanks and Regards,
Terence Yip

-- 
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+unsubscr...@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/65f0df30-c315-401c-9711-9228779a65ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: models, peeking to next record - maybe

2015-02-09 Thread Tim Chase
On 2015-02-07 22:05, Vijay Khemlani wrote:
> The direct solution would be something like this in your view
> 
> events = Event.objects.order_by('event_date')
> 
> event_tuples = []
> last_date_seen = None
> 
> for event in events:
> if last_date_seen:
> date_difference = event.date - last_date_seen
> else:
> date_difference = None
> 
> event_tuples.push((event, date_difference))

In the past I've created something like this as a filter, which lets
it be fairly generic. I also make it a generator rather than keeping
them all around. Something like (I don't have the exact code on hand)

  from django import template
  register = template.base.Library()
  @register.filter(name="pairwise")
  def pairwise(iterable, final=True):
i = iter(iterable)
a = next(i)
for b in i:
  yield a, b
  a = b
if final:
  yield a, None

-tkc



-- 
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+unsubscr...@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/20150209214649.4ef17717%40bigbox.christie.dr.
For more options, visit https://groups.google.com/d/optout.


Re: SMTPAuthenticationError sending email via smtp.gmail

2015-02-09 Thread sum abiut
Have you tried SendGrid mail. create a sendgrid account and used it instead
of gmail.


On Tue, Feb 10, 2015 at 12:30 PM, François Schiettecatte <
fschietteca...@gmail.com> wrote:

> It does not really have to do with Django, it has to do with OAuth which
> Google just started enforcing in gmail, you need to relax the security
> level on the gmail account you are using on this page:
>
> https://www.google.com/settings/security/lesssecureapps
>
> François
>
> > On Feb 9, 2015, at 8:25 PM, bradford li  wrote:
> >
> > I am trying to have django send emails but I am getting this error:
> >
> > Traceback (most recent call last):
> >   File "", line 1, in 
> >   File
> "/Library/Python/2.7/site-packages/django/core/mail/__init__.py", line 62,
> in send_mail
> > return mail.send()
> >   File
> "/Library/Python/2.7/site-packages/django/core/mail/message.py", line 286,
> in send
> > return self.get_connection(fail_silently).send_messages([self])
> >   File
> "/Library/Python/2.7/site-packages/django/core/mail/backends/smtp.py", line
> 92, in send_messages
> > new_conn_created = self.open()
> >   File
> "/Library/Python/2.7/site-packages/django/core/mail/backends/smtp.py", line
> 59, in open
> > self.connection.login(self.username, self.password)
> >   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py",
> line 615, in login
> > raise SMTPAuthenticationError(code, resp)
> > SMTPAuthenticationError: (534, '5.7.9 Application-specific password
> required. Learn more at\n5.7.9
> http://support.google.com/accounts/bin/answer.py?answer=185833
> v14sm3323298pbs.11 - gsmtp')
> >
> > The link suggested my to perform a 2-step verification which I did but
> still no results.
> >
> > In my settings.py
> >
> > EMAIL_USE_TLS = True
> > EMAIL_HOST = 'smtp.gmail.com'
> > EMAIL_HOST_USER = 'em...@gmail.com'
> > EMAIL_HOST_PASSWORD = 'password'
> > EMAIL_PORT = 587
> >
> > I tried testing this in django shell but got the error shown above:
> >
> > >>> from django.core.mail import send_mail
> > >>> from django.conf import settings
> > >>> sub = "sup man"
> > >>> msg = "char lisss"
> > >>> from_user = settings.EMAIL_HOST_USER
> > >>> to = ["em...@email.com"]
> > >>> send_mail(sub,msg,from_user,to, fail_silently=False)
> >
> >
> > --
> > 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+unsubscr...@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/3047e0c7-86f9-477a-be92-76ba53a43225%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+unsubscr...@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/C74DBDD8-559F-4A59-8014-9A80B43A3DA9%40gmail.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+unsubscr...@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/CAPCf-y7apc2YvjF2V7%2BpE4suRxFHVh1tQCkeUFZcL99k_jVQ3A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: SMTPAuthenticationError sending email via smtp.gmail

2015-02-09 Thread François Schiettecatte
It does not really have to do with Django, it has to do with OAuth which Google 
just started enforcing in gmail, you need to relax the security level on the 
gmail account you are using on this page:

https://www.google.com/settings/security/lesssecureapps

François

> On Feb 9, 2015, at 8:25 PM, bradford li  wrote:
> 
> I am trying to have django send emails but I am getting this error:
> 
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/Library/Python/2.7/site-packages/django/core/mail/__init__.py", 
> line 62, in send_mail
> return mail.send()
>   File "/Library/Python/2.7/site-packages/django/core/mail/message.py", 
> line 286, in send
> return self.get_connection(fail_silently).send_messages([self])
>   File 
> "/Library/Python/2.7/site-packages/django/core/mail/backends/smtp.py", line 
> 92, in send_messages
> new_conn_created = self.open()
>   File 
> "/Library/Python/2.7/site-packages/django/core/mail/backends/smtp.py", line 
> 59, in open
> self.connection.login(self.username, self.password)
>   File 
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py",
>  line 615, in login
> raise SMTPAuthenticationError(code, resp)
> SMTPAuthenticationError: (534, '5.7.9 Application-specific password 
> required. Learn more at\n5.7.9 
> http://support.google.com/accounts/bin/answer.py?answer=185833 
> v14sm3323298pbs.11 - gsmtp')
> 
> The link suggested my to perform a 2-step verification which I did but still 
> no results.
> 
> In my settings.py
> 
> EMAIL_USE_TLS = True
> EMAIL_HOST = 'smtp.gmail.com'
> EMAIL_HOST_USER = 'em...@gmail.com'
> EMAIL_HOST_PASSWORD = 'password'
> EMAIL_PORT = 587
> 
> I tried testing this in django shell but got the error shown above:
> 
> >>> from django.core.mail import send_mail
> >>> from django.conf import settings
> >>> sub = "sup man"
> >>> msg = "char lisss"
> >>> from_user = settings.EMAIL_HOST_USER
> >>> to = ["em...@email.com"]
> >>> send_mail(sub,msg,from_user,to, fail_silently=False)
> 
> 
> -- 
> 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+unsubscr...@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/3047e0c7-86f9-477a-be92-76ba53a43225%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+unsubscr...@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/C74DBDD8-559F-4A59-8014-9A80B43A3DA9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Tests and read-only database

2015-02-09 Thread Scot Hacker
My project access two databases, one of which is remote and read-only. When 
running tests, Django wants to create a test_ copy of that db on the remote 
host, but of course it lacks permission (I lack write access to the entire 
db host). So I'm blocked from running *any* tests, even ones that don't 
involve models for the remote data.

I've come up with four possible solutions:

1) Tell Django's test runner to create the test version of that db locally, 
not on the remote host. However, the documentation 
 
doesn't indicate a way to use the TEST: {} dictionary to specify an 
alternate host. This would be my preferred approach, but it doesn't seem 
possible.

2) Use this 
 module, 
which tells the test runner to treat the read-only db "as-is" rather than 
creating a copy of it. I don't like this because of the risk that the db 
might one day NOT be read-only (it's been discussed in our org). And  the 
module is 3 years old without updates.

3) Use this  technique, where the 
read-only db is pop()'d off the settings, making Django effectively forget 
it exists during testing (but then of course I can't test any code that 
involves those models). I'm currently doing this just to get tests back on 
the rails, but it's obviously very limiting. 

4) Use this 

 
technique, which alters the routers configuration during testing.

Is there a preferred or recommended approach to this problem? 

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+unsubscr...@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/2d599e4b-d208-472f-9a62-fc9c187da1d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


SMTPAuthenticationError sending email via smtp.gmail

2015-02-09 Thread bradford li
I am trying to have django send emails but I am getting this error:

Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Library/Python/2.7/site-packages/django/core/mail/__init__.py", line 62, 
in send_mail
return mail.send()
  File "/Library/Python/2.7/site-packages/django/core/mail/message.py", 
line 286, in send
return self.get_connection(fail_silently).send_messages([self])
  File 
"/Library/Python/2.7/site-packages/django/core/mail/backends/smtp.py", line 
92, in send_messages
new_conn_created = self.open()
  File 
"/Library/Python/2.7/site-packages/django/core/mail/backends/smtp.py", line 
59, in open
self.connection.login(self.username, self.password)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py",
 
line 615, in login
raise SMTPAuthenticationError(code, resp)
SMTPAuthenticationError: (534, '5.7.9 Application-specific password 
required. Learn more at\n5.7.9 
http://support.google.com/accounts/bin/answer.py?answer=185833 
v14sm3323298pbs.11 - gsmtp')

The link suggested my to perform a 2-step verification which I did but 
still no results.

In my settings.py

EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'em...@gmail.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 587

I tried testing this in django shell but got the error shown above:

>>> from django.core.mail import send_mail
>>> from django.conf import settings
>>> sub = "sup man"
>>> msg = "char lisss"
>>> from_user = settings.EMAIL_HOST_USER
>>> to = ["em...@email.com"]
>>> send_mail(sub,msg,from_user,to, fail_silently=False)

-- 
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+unsubscr...@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/3047e0c7-86f9-477a-be92-76ba53a43225%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is this good django practice?

2015-02-09 Thread George Silva
I use this technique often. I have a few scenarios where I need to convert
data before presenting them to the user, and I use that.

I have used that to even join tables that live on separate databases (via
Postgres FDW) and present them to the user in a map or a table-view.

If this takes a lot of heat, it can be a problem. You can maintain
materialized views however. If you don't like mat-views, you can create an
actual table that when one of them objects change, you use the save signal,
to update that table as well. Or do it as a trigger in the database.

On Mon, Feb 9, 2015 at 4:06 AM, Eric Man  wrote:

> Hello everyone,
>
> We've got a few models whose relationships are quite "involved" and I
> couldn't figure out how to simplify it further.
>
> We need to query them using a GROUP BY query, which Django's ORM only
> provides limited support.
>
> So I've built a postgres view and a managed=False model in Django so we
> can continue to use the ORM to further specify the query when needed.
>
> i.e. https://gist.github.com/meric/d3a92402982c0dd3bb23
>
> What do you think of this technique? Is it a good practice, have you tried
> it before, or do you foresee I'll experience performance challenges later
> on?
>
> I'm worried about this because this view-model is going to be heavily
> relied upon and its query in CPU time would be more than any others.
>
> I know this because we're refactoring our website and I hope I can remove
> all the series of ORM queries in our code that are merged together and
> paginated by python (rather than in the database itself as is typical
> practice), which is slow and the code hard to read, with this one model
> based on postgres view.
>
> Best Regards,
> Eric
>
>  --
> 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+unsubscr...@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/3e4f9e4f-3a7a-447a-bf29-7547d049ae04%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
George R. C. Silva
SIGMA Consultoria

http://www.consultoriasigma.com.br/

-- 
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+unsubscr...@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/CAGyPVTsA_o5i0PK2_Cw5pOymFg0FGxSH7UWv3EADRA%3DTtFwM_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Kickstarter: Django import-export. Tutorial: Processor and Manager API for different formats. Using admin app for constructing settings. New models and fab tasks

2015-02-09 Thread mtr group
7-days on Kickstarter. Thanks for support! Short and clean tutorial how we 
build things. 
http://mtr.website/2015/02/09/api-manager-processors-import-export.html

-- 
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+unsubscr...@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/2bd48588-4ca3-4dfb-bdef-e54b11028283%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: CSRF token missing on file upload ajax request

2015-02-09 Thread Andreas Kuhne
Add the following code to your onload function:

$(document).ajaxSend(function (event, jqxhr, settings) {
jqxhr.setRequestHeader("X-CSRFToken", '{{ csrf_token }}');
});

This way all AJAX requests will always get the csrftoken.

Regards,

Andréas

2015-02-09 16:19 GMT+01:00 Avraham Serour :

> try addind the csrf on the http header instead of form data
>
> On Sun, Feb 8, 2015 at 10:40 PM, G Z  wrote:
>
>> hello, I have an ajax request that sends a file to django, it is saying
>> that the csrf token is missing but i copied my other ajax request that are
>> working. I'm sure it has something to do with trying to pass a file to
>> upload.
>>
>> I get a 403 and csrf missing return.
>>
>> base.html
>>
>> 
>> 

Re: CSRF token missing on file upload ajax request

2015-02-09 Thread Avraham Serour
try addind the csrf on the http header instead of form data

On Sun, Feb 8, 2015 at 10:40 PM, G Z  wrote:

> hello, I have an ajax request that sends a file to django, it is saying
> that the csrf token is missing but i copied my other ajax request that are
> working. I'm sure it has something to do with trying to pass a file to
> upload.
>
> I get a 403 and csrf missing return.
>
> base.html
>
> 
> 

Re: use apache instead of server by default

2015-02-09 Thread Avraham Serour
you should try using nginx instead of apache, the configuration files are
much simpler to understand

On Mon, Feb 9, 2015 at 11:21 AM, Thomas Rega  wrote:

> Hi,
>
> You have to tell the apache where to find the wsgi file of your project.
>
> Here you can find informations about the configuration of
> apache/modwsgi:
> https://code.google.com/p/modwsgi/wiki/InstallationInstructions
>
> 2015-02-08 23:20 GMT+01:00 Thierry Granier :
> > Hello
> >
> > i have installed python3.4 and django1.7 on debian jessie.
> >
> > runserver works with mysql-connector and mysql databases.
> >
> > I'd like to use apache instead of this server.
> > So i have installed via sysaptic the module libapache2-mod-wsgi
> >
> > why can't i install my website root in the document/root of apache?
> > i don't understand the virtualhost and the directives associated.
> >
> > Thanks for your help
> >
> > T.
> >
> > --
> > 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+unsubscr...@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/a38d1534-93e9-4870-be96-acff9a46b56f%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+unsubscr...@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/CAFgu0xhPWBGJ%2BKah9WhQwt2v4zQb9mapd%3DfrC85%3DykSkyP3rPw%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 users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@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/CAFWa6tKNL8MbHH0%3DxJtjw6Whh4wVJ7KS-iVxSvj0VfkJwRUMzA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: App for storing ChangeLogs in database

2015-02-09 Thread Thomas Güttler



Am 07.02.2015 um 00:31 schrieb Russell Keith-Magee:
...


To me - it sounds like something pretty closely tied to your own development 
process, branching policies, and customer
relationships. I have no difficulty seeing how this could be implemented as a 
Django app - and a fairly trivial one at
that - your average change log is really not much more than:

class Change(Model):
 message = TextField()
 created = DateTimeField()
 change_type = IntegerField(choices=CHANGE_TYPES)

How do you handle your ChangeLogs.


Through a process that is completely unrelated to the commit process.

For me, minimising the number of customer communications is key. I have 
difficulty getting users to read and comprehend
the notifications I *do* send them - sending them complete change logs would be 
overkill, and would result in important
messages (like YOU NEED TO UPDATE YOUR ACCOUNT SETTINGS OR THINGS WILL STOP 
WORKING) being ignored. As it is, these
messages are often ignored, and I need to follow up with individual users.

My audience would gain nothing from a fine grained commit log telling them 
about every bug fix or performance
improvement. They just want the system to work. If it doesn't work, they email 
me, and they'd like to know when it is
fixed. To that end, I might not even send out a notification for a new 
*feature*, unless that feature is something that
has been requested by them, or it will impact on the way they're using the 
system.


Thank you for your reply.

That's the same here: The customer just want the system to work. And I don't 
want to waste our customers time
with announcements like "on page ... we improved the ... input field.  You can do 
... now". The are not interested
most of the time. But sometimes they are. And if they are interested, the 
customers should be able to get the changes
without talking to developers. And the changes should be aggregated to human 
non programmer readable sentences.

The ChangeLog I have in mind aggregates information of commit messages and tickets. This aggregation needs to done by a 
human. It can't be automated, and I think it is worth the effort.


Regards,
  Thomas Güttler

--
Thomas Güttler
http://thomas-guettler.de/

--
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+unsubscr...@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/54D8A438.1080704%40tbz-pariv.de.
For more options, visit https://groups.google.com/d/optout.


Is this good django practice?

2015-02-09 Thread Eric Man
Hello everyone,

We've got a few models whose relationships are quite "involved" and I 
couldn't figure out how to simplify it further.

We need to query them using a GROUP BY query, which Django's ORM only 
provides limited support.

So I've built a postgres view and a managed=False model in Django so we can 
continue to use the ORM to further specify the query when needed.

i.e. https://gist.github.com/meric/d3a92402982c0dd3bb23

What do you think of this technique? Is it a good practice, have you tried 
it before, or do you foresee I'll experience performance challenges later 
on?

I'm worried about this because this view-model is going to be heavily 
relied upon and its query in CPU time would be more than any others.

I know this because we're refactoring our website and I hope I can remove 
all the series of ORM queries in our code that are merged together and 
paginated by python (rather than in the database itself as is typical 
practice), which is slow and the code hard to read, with this one model 
based on postgres view.

Best Regards,
Eric

-- 
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+unsubscr...@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/3e4f9e4f-3a7a-447a-bf29-7547d049ae04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: use apache instead of server by default

2015-02-09 Thread Thomas Rega
Hi,

You have to tell the apache where to find the wsgi file of your project.

Here you can find informations about the configuration of
apache/modwsgi:
https://code.google.com/p/modwsgi/wiki/InstallationInstructions

2015-02-08 23:20 GMT+01:00 Thierry Granier :
> Hello
>
> i have installed python3.4 and django1.7 on debian jessie.
>
> runserver works with mysql-connector and mysql databases.
>
> I'd like to use apache instead of this server.
> So i have installed via sysaptic the module libapache2-mod-wsgi
>
> why can't i install my website root in the document/root of apache?
> i don't understand the virtualhost and the directives associated.
>
> Thanks for your help
>
> T.
>
> --
> 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+unsubscr...@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/a38d1534-93e9-4870-be96-acff9a46b56f%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+unsubscr...@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/CAFgu0xhPWBGJ%2BKah9WhQwt2v4zQb9mapd%3DfrC85%3DykSkyP3rPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.