Using jquery ajax POST method with django

2015-01-16 Thread Hossein Rashnoo
I use this code to send a request: function checkuser() { $.ajax({ url: 'http://10.252.84.159/ajaxrecivelogin', //type: 'POST', data: "{'username': 'aa', 'password' : 'bb'}", context: this, dataType: 'json', success: function (data) {

Re: Django development running on 127.0.0.1:8000 not accessible from same machine

2015-01-16 Thread Aaron C. de Bruyn
If it still doesn't work after doing what James suggested, you can look to see if python is actually 'listening' on port 8000. >From an 'elevated' command prompt (start->type 'cmd', right-click 'cmd' and hit 'run as administrator') type 'netstat -abno > netstat.txt' and hit enter. Then type

Re: [ANNOUNCE] Django 1.8 alpha 1 released

2015-01-16 Thread Fabio Caritas Barrionuevo da Luz
Em sexta-feira, 16 de janeiro de 2015 20:10:37 UTC-3, Tim Graham escreveu: > > We've made the first release on the way to Django's next long-term support > release, Django 1.8! With only two and a half months until the scheduled > final release, we'll need prompt testing from the community to

Re: [ANNOUNCE] Django 1.8 alpha 1 released

2015-01-16 Thread Tom Evans
On Fri, Jan 16, 2015 at 11:10 PM, Tim Graham wrote: > We've made the first release on the way to Django's next long-term support > release, Django 1.8! With only two and a half months until the scheduled > final release, we'll need prompt testing from the community to ensure

[ANNOUNCE] Django 1.8 alpha 1 released

2015-01-16 Thread Tim Graham
We've made the first release on the way to Django's next long-term support release, Django 1.8! With only two and a half months until the scheduled final release, we'll need prompt testing from the community to ensure a timely and stable release. Check out the blog post:

Re: Migrating from OneToOneField to ForeignKey in Django models

2015-01-16 Thread Łukasz Harasimowicz
It's me again. I have managed to reproduce the problem and I have created a ticket: https://code.djangoproject.com/ticket/24163. W dniu poniedziałek, 12 stycznia 2015 23:32:54 UTC+1 użytkownik Łukasz Harasimowicz napisał: > > Hi Colin. > > On behalf of my colleague I will answer your question:

Re: Reverse for 'detail' with arguments '('',)' and keyword arguments '{}' not found

2015-01-16 Thread James Schneider
Change poll_id to poll.id. poll_id is probably not defined anywhere, so your URL tag is getting an argument of '' (empty string). -James On Jan 16, 2015 11:23 AM, "Adil Erpat" wrote: > {% if latest_poll_list %} > > {% for poll in latest_poll_list %} > {{

Re: Django Admin UI Bug - 1.7.3

2015-01-16 Thread Timothy W. Cook
I should also mention that I have some AJAX calls for the same information and they still work fine. So I am quite certain it is in the Admin templates or the Admin properties definitions. On Fri, Jan 16, 2015 at 5:56 PM, Timothy W. Cook wrote: > Is this a bug or did I miss

Django Admin UI Bug - 1.7.3

2015-01-16 Thread Timothy W. Cook
Is this a bug or did I miss something in the release notes? ​Moving from 1.6.4 to 1.7.3 the listing in the Admin UI is not resolving a related field now. There are not any model changes involved. Attached are two screen shots named for the versions. I haven't changed the admin code either.

Re: Django development running on 127.0.0.1:8000 not accessible from same machine

2015-01-16 Thread James Schneider
You should be running 'python manage.py runserver' from inside the directory of your project root , not using the django-admin.py command. The manage.py file should have been automatically generated when you created the project using django-admin.py. I hadn't even realized that django-admin.py

Re: trouble initializing the website

2015-01-16 Thread Adil Erpat
use manage.py command -- 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

Reverse for 'detail' with arguments '('',)' and keyword arguments '{}' not found

2015-01-16 Thread Adil Erpat
{% if latest_poll_list %} {% for poll in latest_poll_list %} {{ poll.question }} {% endfor %} {% else %} No polls are available.{% endif %} -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Uniqueness of "."

2015-01-16 Thread Torsten Bronger
Hallöchen! According to , the permission is defined with ".". However, the unique_together option says (('content_type', 'codename'),). So, in an app "foo", one could define a permission codename

post_save signal not working in Django 1.7

2015-01-16 Thread Zach LeRoy
I have a block of code that works fine in Django 1.6.10 but does not work at all in Django 1.7.3. I would expect my log statement to print every time a Django User is created and this is the behavior in 1.6.10: import logging from django.contrib.auth.models import User from django.db import

Re: Django development running on 127.0.0.1:8000 not accessible from same machine

2015-01-16 Thread KamalKanta Majhi
Hi Kirby, Thanks for the reply. The same Error is throwing at http://localhost:8000/ . -- Kamal On Friday, January 16, 2015 at 10:27:51 PM UTC+5:30, C. Kirby wrote: > > Try localhost:8000 > > > On Friday, January 16, 2015 at 8:51:50 AM UTC-6, KamalKanta Majhi wrote: >> >> I h'v just run the

Re: How to check if user is already in user database?

2015-01-16 Thread joulumaa
ah...not exact but exist() perjantai 16. tammikuuta 2015 19.54.44 UTC+2 joulumaa kirjoitti: > > Exception Type: TypeError Exception Value: > > catching classes that do not inherit from BaseException is not allowed > > > Did not work. > Get might be faster than filter, but .exact() did not

Re: How to check if user is already in user database?

2015-01-16 Thread joulumaa
Exception Type: TypeError Exception Value: catching classes that do not inherit from BaseException is not allowed Did not work. Get might be faster than filter, but .exact() did not work either -thanks perjantai 16. tammikuuta 2015 19.19.09 UTC+2 Mark kirjoitti: > > Also, you can do a

Re: How to check if user is already in user database?

2015-01-16 Thread Mark Furbee
Also, you can do a try/catch, but I don't really like this method, personally: try: User.objects.get(username=username) except User.DoesNotExist: # user didn't exist in database. On Fri, Jan 16, 2015 at 9:16 AM, Mark Furbee wrote: > Yes, that link

Re: How to check if user is already in user database?

2015-01-16 Thread Mark Furbee
Yes, that link will cover the basics... Here's a couple ways to find out if a query returns any records: User.objects.filter(username=username).exists() # .exists() returns boolean if records are found. User.objects.filter(username=username).count() != 0 # .count() returns number of

Re: How to check if user is already in user database?

2015-01-16 Thread James Bennett
This may be a good time to review Django's documentation on how to perform database queries: https://docs.djangoproject.com/en/1.7/topics/db/queries/#retrieving-a-single-object-with-get -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: How to check if user is already in user database?

2015-01-16 Thread joulumaa
so, if it was not in database is result None, or some err or how to validate? sorry I am very beginner ;-) then same problem with that permission, how to verify if reason for failing was that? -thanks perjantai 16. tammikuuta 2015 18.25.29 UTC+2 Shazwi Suwandi kirjoitti: > > Have you tried

Re: Django development running on 127.0.0.1:8000 not accessible from same machine

2015-01-16 Thread C. Kirby
Try localhost:8000 On Friday, January 16, 2015 at 8:51:50 AM UTC-6, KamalKanta Majhi wrote: > > I h'v just run the django-admin.py runserver command to setup django dev > server. But dev server is not running at http://127.0.0.1:8000/. Also i > h'v tested at http://0.0.0.0:8000/ and

Re: How to check if user is already in user database?

2015-01-16 Thread Shazwi Suwandi
Have you tried something like *user = User.objects.get(username="username")* On Saturday, 17 January 2015 00:00:32 UTC+8, joulumaa wrote: > > Hi, > > If user = auth.authenticate(username,password) results None, I would like > to create new user and login it. > But I cannot find a way to

How to check if user is already in user database?

2015-01-16 Thread joulumaa
Hi, If user = auth.authenticate(username,password) results None, I would like to create new user and login it. But I cannot find a way to determine easily if it is was None because of 1) it was not in database or 2) it was in database but password was wrong I addition to those it may have

Re: Two QuerySets on a FormSet

2015-01-16 Thread Some Developer
On 12/01/15 20:46, Collin Anderson wrote: Hi, You can merge the two querysets like this. Would that help? | qs =Song.objects.filter(artist__made_by=request.user)|Song.objects.filter(album__made_by=request.user) | or use models.Q | fromdjango.db.models importQ qs

Re: Django development running on 127.0.0.1:8000 not accessible from same machine

2015-01-16 Thread KamalKanta Majhi
I h'v just run the django-admin.py runserver command to setup django dev server. But dev server is not running at http://127.0.0.1:8000/. Also i h'v tested at http://0.0.0.0:8000/ and http://192.168.0.106:8000/. Throwing same error like below screen shot. Please help if anybody already

Re: trouble initializing the website

2015-01-16 Thread Carlos Andre
And you have, after all, create a aplication with command: manage,py startapp [name your app] Em 16/01/2015 08:56, "Nicky Setia" escreveu: > Hi, > I used Django to create my personal webpage. The tutorial on your homepage > was very helpful and easy to follow. > I have my

Re: trouble initializing the website

2015-01-16 Thread Carlos Andre
Your first step are configure settings.py in databases, you heve to create a conetion. Secund step, syncdb will go create the struct databases. And finally runserver will start your server. In browser use to admin: 127.0.0:8000/admin. That need loggin who you configure in syncdb. Em 16/01/2015

trouble initializing the website

2015-01-16 Thread Nicky setia
Hi, I am receiving the following error when I try to load my domain. The domain/hosting and settings.py and other files are all set up "It worked! Congratulations on your first Django-powered page. Of course, you haven't actually done any work yet. Here's what to do next: If you plan to use a

trouble initializing the website

2015-01-16 Thread Nicky Setia
Hi, I used Django to create my personal webpage. The tutorial on your homepage was very helpful and easy to follow. I have my domain and hosting set up. I have modified the settings/views/URLs files accordingly and FTP all files to the server but when I try to load the domain, it gives me

Re: Use django rest framework with dynamoDB

2015-01-16 Thread Tom Christie
Maybe take a look at this... https://github.com/gtaylor/django-dynamodb-sessions > > > -- 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

Re: filter

2015-01-16 Thread Erik Cederstrand
You're overwriting one QuerySet with another: new_leave =newleave.objects.filter(department_head_authorization="Approved" ) new_leave = newleave.objects.filter(department="FMKD") Instead, do this: new_leave = newleave.objects.filter(department_head_authorization="Approved", department="FMKD")