Re: Javascript AJAX url call not responding

2013-07-04 Thread Peith Vergil
If that's an AJAX POST request, then it may be because you are not passing the CSRF token in the header. Add this code before doing the AJAX call: function csrfSafeMethod(method) { // these HTTP methods do not require CSRF protection return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));}$.aj

Re: [SPAM] Implementing User login expiration

2013-07-04 Thread Dave Koo
Great solution Sam! On Tuesday, April 9, 2013 11:30:41 AM UTC-7, Sam Solomon wrote: > > Depending on if the expiration is a temporary thing or if you actually > want to permanently deactivate the user, this may be even simpler and > database efficient (and is what we use to ban users): > > class

Javascript AJAX url call not responding

2013-07-04 Thread nesornet
So I have django 1.5.1 installed, have persistent messages installed, and have messages displaying in a list via the template reference {% include "persistent_messages/message/includes/messages.jquery.html" %} The following javascript click trigger is bound to an anchor tag within the list: $(c

is it OK to process the "next=xxx" url parameter in the admin login view

2013-07-04 Thread panfei
for some simple use cases, it is convenient to reuse the admin login site, if the admin login view can process the next parameter in the url, we can reuse it more smoothly. -- 不学习,不知道 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscr

testing

2013-07-04 Thread Larry Martell
I'm just getting involved with setting up testing using the django testing facilities, and I have a couple of questions. If I do this from the django shell: $ python manage.py shell Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on

Re: Django 1.5 runserver hangs in Chrome

2013-07-04 Thread eXt
I can confirm this issue. Exactly the same problem here. W dniu czwartek, 4 lipca 2013 02:52:58 UTC+2 użytkownik Nikolas Stevenson-Molnar napisał: > > Also, while Chrome is spinning, I can open Firefox and load pages > (including the problem page) just fine. So it's not that the server is > ov

Re: Namespace URLs in TestCase

2013-07-04 Thread Tomáš Ehrlich
As I said, it's trivial: urlpatterns = patterns('', url(r'^sso/$', include(app_patterns, 'app', 'app'))) The regexp is wrong. It should be only ^sso/ because other urls are appended after it… Fortunatelly, Django 1.6 has more helpful exception as it prints all url patterns which 'reverse'

Issue in User authentication

2013-07-04 Thread vijay shanker
*Hi* *I am using django 1.5 and created my own user model by AUTH_USER_MODEL= 'account.User' in settings.* *my user model is like this:* from django.db import models from django.contrib.auth.models import AbstractBaseUser, UserManager, PermissionsMixin # Create your models here. GENDER = (

Re: editing python module

2013-07-04 Thread Jennifer Look
Never mind. I knew I was being a complete idiot about this. THe scroll bar apparently doesn't show up until you hover over it, and I didn't realize that only the bottom page of the file was showing. On Thursday, July 4, 2013 10:46:46 AM UTC-4, Jennifer Look wrote: > > I am brand new to all this,

Re: editing python module

2013-07-04 Thread Jennifer Look
Oh, I should probably mention that I'm on a Mac Os X 10.8 and running djangostack from BitNami On Thursday, July 4, 2013 10:46:46 AM UTC-4, Jennifer Look wrote: > > I am brand new to all this, and just starting to work my way through the > Django tutorial. I got to the "Database setup" step, whe

Re: editing python module

2013-07-04 Thread Jennifer Look
> > Thanks Tom! I had tried reading settings.py into nano but it didn't look > anything like I expected, so I thought I was doing it wrong. I was > expecting a list of variables like ENGINE, NAME, etc but instead what I see > is: > >}, > 'loggers': { > 'django.request': { >

Re: editing python module

2013-07-04 Thread Tom Evans
On Thu, Jul 4, 2013 at 3:46 PM, Jennifer Look wrote: > I am brand new to all this, and just starting to work my way through the > Django tutorial. I got to the "Database setup" step, where it says to edit > mysite/settings.py and I'm stymied. > The previous step was to start the development server

Namespace URLs in TestCase

2013-07-04 Thread Tomas Ehrlich
Hi there, it's probably silly bug, but I can't figure it out: I have one test: ### # app/tests_functional/test_app.py from django.core.urlresolvers import reverse from django.test import TestCase class TestApp(TestCase): urls = 'app.tests_functional.urls' def test_app(self): pri

editing python module

2013-07-04 Thread Jennifer Look
I am brand new to all this, and just starting to work my way through the Django tutorial. I got to the "Database setup" step, where it says to edit mysite/settings.py and I'm stymied. The previous step was to start the development server. I should quit the server before editing variables, right

Re: Call action with a link in the admin site

2013-07-04 Thread Jesús Lucas Flores
Hola Juan Antonio, Es totalmente posible. Puedes ver un ejemplo en alguno de mis proyectos: https://github.com/jelukas/presupy/blob/master/presu/admin.py#L39-L47 Un saludo 2013/7/4 Juan Antonio García Cano > In the admin.py i have this function: > > actions = ['generar_pdf'] > def generar_pd

Re: Django and Websockets

2013-07-04 Thread Nevio Vesic
This one as well works just fine :) https://gevent-socketio.readthedocs.org/en/latest/ It's as well very easy to implement it. -- 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

Call action with a link in the admin site

2013-07-04 Thread Juan Antonio García Cano
In the admin.py i have this function: actions = ['generar_pdf'] def generar_pdf(self, request, queryset): ... (This function make a PDF of the object selected) And i show one button in the list_display (of the admin site) with this function: def boton_mail(self,obj): return m

Re: problems with django-celery

2013-07-04 Thread Sachin Shenoy
Hi Mateusz, Were you able to solve this? I am also facing the same issue. Thanks, Sachin On Tuesday, March 26, 2013 4:35:41 PM UTC+5:30, Mateusz Iwański wrote: > > Hi, > > I have a problem with django-celery. When i want to delay function I get > an error from celery worker, it happens every s

Django and Websockets

2013-07-04 Thread Dario Lopez Padial
Hi, I would like to use websockets in Django, but I have many options.. - https://github.com/stephenmcd/django-socketio - https://github.com/clemesha/hotdot - https://github.com/gregmuellegger/django-websocket - tornado? I do not worry to have 2 servers (django server and asynchron

Re: Problem with staticfiles

2013-07-04 Thread Andreas Kuhne
I found out that the CSS files where not correctly written and they should have generated this error. Pity I have been searching for the problem for 2 days now :-) Regards, Andréas 2013/7/3 Andreas Kuhne > Hi all, > > I am trying to CachedStaticFilesStorage to work in our environment. I have >

Re: Django date format issue

2013-07-04 Thread Rafael E. Ferrero
form example: class NewsForm(ModelForm): class Meta: model = News exclude = ('id', 'Url', 'resume', 'Time_Stamp') widgets = { 'Tag': CheckboxSelectMultiple(attrs={'class': 'tag'}), 'Category': CheckboxSelectMultiple(

Re: Django date format issue

2013-07-04 Thread Rafael E. Ferrero
I'm not shore if what i did its fine or not but works, otherwise i see you put some twist to the problem... nevertheless what i do its: In Settings set properly the time_zone and use_l10n=true... then in my model use something like ...models.DateTimeField('Creation Date', default=datetime.now())...

Django date format issue

2013-07-04 Thread Sivaram R
views.py def calender(request): "" settingsform = SettingsForm(instance=settings) if request.method == 'POST': reportform = ReportDateTimeForm(request.POST, instance=report) if reportform.is_valid(): report = reportform.save(commit=False) re

Re: Django admin automatically adding slash to a URL field after update

2013-07-04 Thread Rafael E. Ferrero
I never have that issue, i use default setting of append_slash and never have a problem with that. (version 1.3) 2013/7/4 Rafael E. Ferrero > What version of Django you use ?? > > > 2013/7/4 ecasbas > >> Hi, >> >> I have this issue wit the admin interface: >> >> I try edit manually a register,

Re: Django admin automatically adding slash to a URL field after update

2013-07-04 Thread Rafael E. Ferrero
What version of Django you use ?? 2013/7/4 ecasbas > Hi, > > I have this issue wit the admin interface: > > I try edit manually a register, I change some values and when I save the > data, the URL field, which I have no modifed, > become automatically with a slash append at the end. This issue

Re: django-simple-multitenant

2013-07-04 Thread Nigel Legg
That's great, thanks Mario. I will see how I get on with implementing it. Thanks for your help. N// Regards, Nigel Legg 07914 740972 http://twitter.com/nigellegg http://uk.linkedin.com/in/nigellegg On 4 July 2013 11:39, Mario Gudelj wrote: > You sure can Nigel. > > Let's say you have a model

Re: django-simple-multitenant

2013-07-04 Thread Mario Gudelj
You sure can Nigel. Let's say you have a model called Notes, where users can enter their notes that they only can see. You add User model (in 1.4 from django.contrib.auth.models, in 1.5 same or you can extend AbstractUser) as a foreign key to Notices. Here's some info on FK https://docs.djangopr

Re: Python Fabric manage.py problem

2013-07-04 Thread Tom Evans
On Thu, Jul 4, 2013 at 3:29 AM, Roger Barnes wrote: > It looks like you may be missing a space after the word "source". > > My fabfile has these helpers, given an env.virtualenv and env.app_dir > setting... Another way to do it is to provide a shell script that sets up the appropriate environment

calling single save function on two button click

2013-07-04 Thread Sivaram R
who.html {% csrf_token %} {{report_person.report_person.name }} {{report_person.info.first_aid}}{{report_person.info.first_aid.label}} {{report_person.info.sick_bay}}{{report_person.info.sick_bay.label}}