Re: Help me develop a Job Tracker (?)

2015-06-30 Thread Softeisbieger
I knew there had to be something like a workflow engine, thanks for the 
hint.

I had a look at django-viewflow which looks pretty promising. Still, as far 
as I'm aware, some points are beyond the scope of this framework:

   - It would be nice if users could set up their own workflows.
   - I would like to have the flexibility of a workflow engine and some 
   ingredients from standard bug trackers: It should be possible to comment on 
   the different workflows.
   - I'd like to maintain a history of each workflow: Creation date, status 
   change date, ... (who did what and when?)
   - User can subscribe to a workflow. They can choose when they want to 
   get an update: Status change, someone commented, ...
   - when defining a workflow, for each activity one should be able to 
   preset a user who is typically responsible and a due date for this event.
   - a comprehensive list of all workflows: filter based on workflow type, 
   responsible user, in time / overdue, type of work, customer...
   - user should be able to change some properties of a workflow that is 
   currently executed: For example to postpone a deadline. Users need to give 
   a reason for this.
   
I'll dig a bit into django-viewflow to see how that works. django-fsm may 
work as well...

-- 
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/92da4877-c186-4134-9d01-73b443124714%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django 1.8.2 - handler404 and handler500 refusing to work

2015-06-30 Thread simon
Good afternoon all,

Perhaps someone can give me a pointer here:

I'm an old hand at Django (1.0 to 1.6) but now in 1.8.2, the documented 
process of writing and attaching custom handlers for '404' and '500' 
appears to have stopped working.

As per the dox, I have added into my ROOT url file, the required overrides:

from django.conf.urls import *
from django.contrib import admin

urlpatterns = [
url(r'^apikey/', include('apikey.urls', namespace='apikey')),
url(r'^admin/', include(admin.site.urls)),
]

handler404 = 'apikey.views.custom_handler'
handler500 = 'apikey.views.custom_handler'

I have created the default 404.html template in the apikey/templates 
directory and updated the site settings file to reflect this
and I can confirm that this default 404.html file is indeed getting 
rendered, but not by my routine:

views.py
---
def custom_handler(request):
print ‘——>>> got to here’
return HttpResponseNotFound('Boo! - Page not found')

I've been testing with DEBUG=False under 'python manage.py runserver'.
My custom handler never, *ever* fires when a URL not in my apikey/urls.py 
file is submitted by a GET and a 404 is supposed to be raised.

I am at a complete loss as to why this isn't working, having had no issues 
with this custom handler process over the past 5 years :(

-- 
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/4cea481b-9db4-4eb1-8d7f-57d3e44d60b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Apps for versioning model fields

2015-06-30 Thread Afonso Ribas
Hi Fabio,

Have you tried these django packages?:

Simple History: 
https://www.djangopackages.com/packages/p/django-simple-history/
AuditLog: https://www.djangopackages.com/packages/p/django-auditlog/
CleanerVersion: https://www.djangopackages.com/packages/p/cleanerversion/

Or any other from: https://www.djangopackages.com/grids/g/model-audit/.

Best,
Afonso

On Monday, June 29, 2015 at 9:54:37 PM UTC-4, Fabio Caritas Barrionuevo da 
Luz wrote:
>
> Hello, I need to implement versioning of a TextField to an electronic 
> system to manages documents.
>
> Before I try to reinvent the wheel, I'd like to know what are the reusable 
> apps are available that solve this problem.
>
> I have the following model class:
> https://gist.github.com/luzfcb/226612d0b98dd4493f9d
>
> I need versioning only the field 'content'
>
> the type of versioning I need is much like the way it is implemented 
> versioning of articles on Wikipedia.
>
> I'm trying to use django-reversion, however, I think it is not designed 
> for this use case.
>
> Would you recommend me look any specific library? If so, what are the pros 
> and cons What do you think of it?
>
> I appreciate the help in advance.
>
>
> -- 
> Fábio C. Barrionuevo da Luz
> Acadêmico de Sistemas de Informação na Faculdade Católica do Tocantins - 
> FACTO
> Palmas - Tocantins - Brasil - América do Sul
>
> http://pythonclub.com.br/
>
> Blog colaborativo sobre Python e tecnologias Relacionadas, mantido 
> totalmente no https://github.com/pythonclub/pythonclub.github.io .
>
> Todos são livres para publicar. É só fazer fork, escrever sua postagem e 
> mandar o pull-request. Leia mais sobre como publicar em README.md e 
> contributing.md.
> Regra básica de postagem:
> "Você" acha interessante? É útil para "você"? Pode ser utilizado com 
> Python ou é útil para quem usa Python? Está esperando o que? Publica logo, 
> que estou louco para ler...
>
> 

-- 
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/59a70396-cd11-4e87-a5cc-3cac07f40a31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Diable basic auth on some pages

2015-06-30 Thread Cherie Pun
Hi,

In the dev version of the website, we are using basic auth to limit access. 
However, we are currently developing an api for the website and I would 
like to use the api without going through the basic auth. Is it possible to 
disable basic auth for all the api urls?

Cheers,
Cherie

-- 
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/0d9a681e-74c4-4b74-9648-e0e6c74beeb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django REST Cross Domain Request to Download a File

2015-06-30 Thread Garry D Thompson
So I am trying to download a file via Django REST (referred to as the Back 
End from now on) instance through my web page. The web page and the Back 
End are currently installed on two different servers so this is a cross 
domain request.

Now, I have no problem making cross domain requests to any of the other API 
urls on the Back End, but this one that retrieves the file through a view I 
am struggling with.

The response comes back with status 200 (OK) and the headers all seem to be 
set correctly, but no download is forced.

I have tried using Ajax requests and XMLHttpRequests in Javascript but the 
response just doesnt force a download despite containing the correct 
Content-disposition header.

Any thoughts would be well appreciated. 
Thanks

G

-- 
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/91fd9f44-57b4-44d7-8a45-3eb0743de45b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Diable basic auth on some pages

2015-06-30 Thread Alex Heyden
Cherie,

By default, there are no authentication controls in Django. Barring some
custom middleware, authentication checks are performed within the views
themselves or through something like the @login_required or
@user_passes_test decorators. Are you certain that authentication is what's
blocking your requests?

On Tue, Jun 30, 2015 at 9:43 AM, Cherie Pun  wrote:

> Hi,
>
> In the dev version of the website, we are using basic auth to limit
> access. However, we are currently developing an api for the website and I
> would like to use the api without going through the basic auth. Is it
> possible to disable basic auth for all the api urls?
>
> Cheers,
> Cherie
>
> --
> 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/0d9a681e-74c4-4b74-9648-e0e6c74beeb6%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/CA%2Bv0ZYV1KjzF3Ao%2By7hp-WA8Txkuoj-uxTtwNv0%2B%2Bm-T0MmZRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


STATIC_URL with thumbnail_url Template Tag

2015-06-30 Thread Stephanie Socias
Hello,

I'm trying to use an image from my 'static' folder in one of my templates. 
I need to pass the image into the thumbnail_url filter but I can't get it 
to work. The image is not found. How do I specify the correct image path? 
(I posted this same question on stackoverflow 

 
yesterday.) Thank you!

I've tried this:

{% load thumbnail %}


{% with path="{{STATIC_URL}}/images/green-icon.png" %}

{% endwith %}


and also:

{% load thumbnail %}{% load staticfiles %}


-- 
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/99f1e884-eee0-4329-a689-ce72a3c69522%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: new installations tryout problem

2015-06-30 Thread elim
Thanks a lot Mike Dewhirst. I think that's issue.

Directly check the database, there is no poll record there.

My current  models.py in poll reads like

import datetime
from django.db import models
from django.utils import timezone

# Create your models here.

class Poll(models.Model):
def __unicode__(self):
return self.question
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

class Question(models.Model):
def __unicode__(self):
return self.question_text
def was_published_recently(self):
return self.pub_date >= timezone.now() - datetime.timedelta(days=1)

question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

class Choice(models.Model):
def __unicode__(self):
return self.choice_text
poll = models.ForeignKey(Poll)
question = models.ForeignKey(Question)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)

And the corresponding mysql database tables are
mysql> desc polls_poll;
+--+--+--+-+-++
| Field| Type | Null | Key | Default | Extra  |
+--+--+--+-+-++
| id   | int(11)  | NO   | PRI | NULL| auto_increment |
| question | varchar(200) | NO   | | NULL||
| pub_date | datetime | NO   | | NULL||
+--+--+--+-+-++
3 rows in set (0.00 sec)

mysql> desc polls_question;
+---+--+--+-+-++
| Field | Type | Null | Key | Default | Extra  |
+---+--+--+-+-++
| id| int(11)  | NO   | PRI | NULL| auto_increment |
| question_text | varchar(200) | NO   | | NULL||
| pub_date  | datetime | NO   | | NULL||
+---+--+--+-+-++
3 rows in set (0.00 sec)

mysql> desc polls_choice;
+-+--+--+-+-++
| Field   | Type | Null | Key | Default | Extra  |
+-+--+--+-+-++
| id  | int(11)  | NO   | PRI | NULL| auto_increment |
| choice_text | varchar(200) | NO   | | NULL||
| votes   | int(11)  | NO   | | NULL||
| poll_id | int(11)  | NO   | MUL | NULL||
| question_id | int(11)  | NO   | MUL | NULL||
+-+--+--+-+-++
5 rows in set (0.00 sec)

This tutorial doesn't ask to create poll record, and since question is not 
modeled related to poll, so I can create and save a question record without 
poll.

These seem a bit strange, but let's just create a poll record to move on.

It turns out that's not the case:

>>> q.choice_set.create(choice_text=’Not much’, votes=0)
Cause the exception because
(1) the statement does not contain poll_id value
(2) the statement excutes the database insertion implicitly
(3) the table polls_choice column was set not null.

My guess is that the tutorial is out of sync with the changes of django

So what's the best doc for learning django?

-- 
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/29bc8d37-177e-4a54-b232-ae898212df19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.