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) {
$("#resp").html("success");
},
error: function ()
{
$("#resp").html("error");
}
});};

And its worked But when i add type:POST part it cause error.

I use this django code to response that request:

def ajaxrecivelogin(request):
import json
response_data = {}
response_data['status'] = '1'
return HttpResponse(json.dumps(response_data), 
content_type="application/json")

Is it about my django code?

-- 
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/b4e8cb0c-e6cc-4245-9837-4226f2e9fcb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 'notepad netstat.txt' and you will see a list of all the
ports and programs that are using them.

Use the 'find' feature in notepad to look for a program running on '8000'.
If you don't see Python, something is not working correctly.

Occasionally you might see another app that is using the port.  A few years
back, Windows Small Business Server would occasionally seize random ports
used by other applications for use for DNS queries.

-A


On Fri, Jan 16, 2015 at 11:52 AM, James Schneider 
wrote:

> 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 supported the 'runserver' argument. It doesn't work for me,
> but 'python manage.py runserver' runs fine (and is what is recommended in
> the tutorial).
>
> It should look something like this:
>
>> $ cd 
>
> $ python manage.py runserver
>> Validating models...
>> 0 errors found
>> January 16, 2015 - 04:17:18
>> Django version 1.6.6, using settings 'project_name.settings'
>> Starting development server at http://127.0.0.1:8000/
>
> Quit the server with CONTROL-C.
>
>
> The command should 'hang' without displaying any errors if it is running
> correctly. It stays open to accept HTTP requests to http://127.0.0.1:8000.
> As you make requests, they should show up under the command with the URL's
> that you are requesting and the response codes from the development server.
>
> See the section here:
> https://docs.djangoproject.com/en/1.7/intro/tutorial01/#the-development-server
>
> -James
>
>
> On Jan 16, 2015 10:02 AM, "KamalKanta Majhi"  wrote:
>
>> 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 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 resolved the same.


 


 -- Kamal



 On Monday, August 27, 2012 at 1:23:23 PM UTC+5:30, nav wrote:
>
> Dear Folks,
>
> I am running my django development server on 127.0.0.1:8000 and
> accessing this address from my web browser on the same machine. In the 
> past
> few days I have found thet the web browsers keep prepending the address
> with "www." when using the above address. 127.0.0.1 without the prot 
> number
> works fine but the django development server requires a port number.
>
> I have not encountered this problem before and am puzzled by what is
> happening. I am working on a Kubuntu 12.04 linux box and my /etc/hosts/
> file is below if that helps:
>
> 
> 127.0.0.1   localhost
> 127.0.1.1   
>
> # The following lines are desirable for IPv6 capable hosts
> ::1 ip6-localhost ip6-loopback
> fe00::0 ip6-localnet
> ff00::0 ip6-mcastprefix
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters
> 
>
> TIA
> Cheers,
> nav
>
  --
>> 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/cc0c84af-b413-4a76-a572-b3498ff350c4%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 

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 ensure a 
> timely and stable release. Check out the blog post:
>
>
> https://www.djangoproject.com/weblog/2015/jan/16/django-18-alpha-1-released/
>


Wow, many new things. Very good.

I have not seen in the release-notes that the inspectdb now supports 
inspect "database views" to the backends where it is supported.

This change was made in this commit:

https://github.com/django/django/commit/b8cdc7dcc3fc6897fb2a75f90023f5c67aad327f
 

See the "get_table_list" function in introspection.py file, in each 
database backend

I look forward a day, that Django has support for inspecting "multiple 
database schemas" and work properly with an official api to do this.

https://code.djangoproject.com/ticket/22673
https://code.djangoproject.com/ticket/6148

I was trying to figure out ways to solve this old problem of django.
Also i know that adding support for multiple database schemas is not 
something trivial for Django, because if it was, I'm sure that would be 
already been implemented.

https://gist.github.com/luzfcb/e5f67e9c940e4833b798
http://dba.stackexchange.com/questions/87463/in-oracle-how-to-get-a-list-with-the-names-of-schemas-that-a-user-has-read-perm



-- 
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/8e1efdd2-b8d4-4f7d-a498-188f06ff8999%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 a
> timely and stable release. Check out the blog post:
>
> https://www.djangoproject.com/weblog/2015/jan/16/django-18-alpha-1-released/
>

Exciting!

>From the release notes it mentions that 1.8 is planned to be released
in approximately 2 months, it will likely be the next LTS, and that
support for the current LTS will end 6 months after it is released?

Is it worth also explicitly announcing that?

Cheers

Tom

-- 
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/CAFHbX1LO0%3D3sJsGN%2BnbMPX3OOe5%3Dm-u2nCU8iUSXR8DseHL-6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[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:

https://www.djangoproject.com/weblog/2015/jan/16/django-18-alpha-1-released/

-- 
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/28462ef9-4769-4cfb-bb8c-65ac035506ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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:
>
> We did not have time (at this moment) to investigate this problem any 
> further. We've added a raw sql commands to disable foreign key checks 
> during this migration. We could do it since we are still learning Django 
> (and it's new migrations) and in the end we will probably remove all 
> current migrations altogether (just before initial deployment). However we 
> also think that this might be a bug and we will try to reproduce this 
> problem with a fresh project. Hopefully sometime this week.
>
> W dniu poniedziałek, 12 stycznia 2015 21:32:39 UTC+1 użytkownik Collin 
> Anderson napisał:
>>
>> Hi,
>>
>> Did you figure it out? This seems like a bug. Can you reproduce it with a 
>> fresh project?
>>
>> Thanks,
>> Collin
>>
>> On Friday, January 9, 2015 at 8:49:56 AM UTC-5, Maciej Szopiński wrote:
>>>
>>> Hi everyone,
>>>
>>> I've encountered an issue when working with django and I can't seem to 
>>> find a way out of this..
>>>
>>> I am using django 1.7.2 and a MySQL database. 
>>> I have a model that was using a One-to-One relationship with two other 
>>> models. At first I thought, the One-to-One relationship will be enough, but 
>>> as things changed in the project I had to change the relationship to 
>>> Many-to-One.
>>>
>>> I changed only two lines in my code, in my model I had:
>>>
>>> product = models.OneToOneField(Product)
>>> category = models.OneToOneField(Category)
>>>
>>> and changed it to:
>>>
>>> product = models.ForeignKey(Product)
>>> category = models.ForeignKey(Category)
>>>
>>> I created the db migrations using ./manage.py makemigrations, but when I 
>>> run the migration with 'migrate' it keeps throwing this error. 
>>>
>>> django.db.utils.OperationalError: (1553, "Cannot drop index 
>>> 'product_id': needed in a foreign key constraint")
>>>
>>> I tried to check what sql operations are executed in this case and it 
>>> seems that django tries to run 
>>> ALTER TABLE 'xxx' DROP INDEX 'yyy' and
>>> ALTER TABLE `xxx` DROP FOREIGN KEY `xxx_yyy_id_{some_hash}_fk_yyy_id`;
>>>
>>> I am not sure if this is the right order for these operations, when 
>>> running it manually on the database in the reverse order (first the DROP 
>>> FOREIGN KEY then DROP INDEX) it works correctly. 
>>>
>>> Have you encountered this issue before? Have you got any suggestions on 
>>> how to resolve this situation? 
>>> I would like to avoid any manual SQL changes outside of django 
>>> migrations. 
>>>
>>> Thanks in advance. 
>>>
>>> Best regards, 
>>> Maciej Szopiński
>>>
>>

-- 
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/7eeb2a06-66dd-4512-b804-05e51dcc1f46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 %}
> {{ 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 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/3068fc0e-1bf8-433b-b195-72418883ea55%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%2Be%2BciUPaiJYeZQ2%3DE%3Df35wjJbry2rVMWD-h3Z8dvSXKdZBcmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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.  For the screen shots the admin
> code is:
>
> ​class DvBooleanAdmin(admin.ModelAdmin):
> list_filter = ['prj_name__rm_version__version_id','prj_name',]
> search_fields = ['data_name','ct_id']
> ordering = ['prj_name','data_name']
> actions = [make_published, unpublish, copy_dt, republish]
> readonly_fields =
> ['published','schema_code','r_code','xqr_code','xqw_code',]
> def get_form(self, request, obj=None, **kwargs):
> try:
> if obj.published:
> self.readonly_fields =
> ['prj_name','published','lang','schema_code','data_name','valid_trues','valid_falses','description','sem_attr','resource_uri','asserts','xqr_code','xqw_code',]
> except (AttributeError, TypeError) as e:
> self.readonly_fields =
> ['published','schema_code','r_code','xqr_code','xqw_code',]
> return super(DvBooleanAdmin, self).get_form(request, obj, **kwargs)
>
> fieldsets = (
> (None, {'classes':('wide',),
>
>  
> 'fields':('published','prj_name','data_name','lang','valid_trues','valid_falses')}),
> ("Additional Information ", {'classes':('wide',),
>
>  'fields':('description','sem_attr','resource_uri','asserts',)}),
> ("PCT Code (read-only)", {'classes':('collapse',),
>
>  'fields':('schema_code','r_code','xqr_code','xqw_code',)}),
>
> )
> list_display = ('data_name','prj_name','published',)
> admin.site.register(DvBoolean, DvBooleanAdmin)
>
> ​In the model for the displayed admin:
> ​prj_name = models.ForeignKey(Project, verbose_name=_("Project Name"),
> to_field="prj_name", help_text=_('Choose the name of your Project.'))
>
> ​and the related field in Project is:
> prj_name = models.CharField(_("project name"), max_length=110,
> unique=True, db_index=True, help_text=_('Enter the name of your project.'))
>
> ...
>
> def __unicode__(self):
> return self.prj_name
> ​
>
>
> ​Any ideas?​
>
> Should I file a bug report?
>
> ​Thanks,
> Tim
> ​
>
>
>
>
>
> 
> Timothy Cook
> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
> MLHIM http://www.mlhim.org
>
>


-- 


Timothy Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
MLHIM http://www.mlhim.org

-- 
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%2B%3DOU3UFiy1QfL8HbpO_GBq16SfVpH0kFmrv1-zLxyGZiFwWnw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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.  For the screen shots the admin
code is:

​class DvBooleanAdmin(admin.ModelAdmin):
list_filter = ['prj_name__rm_version__version_id','prj_name',]
search_fields = ['data_name','ct_id']
ordering = ['prj_name','data_name']
actions = [make_published, unpublish, copy_dt, republish]
readonly_fields =
['published','schema_code','r_code','xqr_code','xqw_code',]
def get_form(self, request, obj=None, **kwargs):
try:
if obj.published:
self.readonly_fields =
['prj_name','published','lang','schema_code','data_name','valid_trues','valid_falses','description','sem_attr','resource_uri','asserts','xqr_code','xqw_code',]
except (AttributeError, TypeError) as e:
self.readonly_fields =
['published','schema_code','r_code','xqr_code','xqw_code',]
return super(DvBooleanAdmin, self).get_form(request, obj, **kwargs)

fieldsets = (
(None, {'classes':('wide',),

 
'fields':('published','prj_name','data_name','lang','valid_trues','valid_falses')}),
("Additional Information ", {'classes':('wide',),

 'fields':('description','sem_attr','resource_uri','asserts',)}),
("PCT Code (read-only)", {'classes':('collapse',),

 'fields':('schema_code','r_code','xqr_code','xqw_code',)}),

)
list_display = ('data_name','prj_name','published',)
admin.site.register(DvBoolean, DvBooleanAdmin)

​In the model for the displayed admin:
​prj_name = models.ForeignKey(Project, verbose_name=_("Project Name"),
to_field="prj_name", help_text=_('Choose the name of your Project.'))

​and the related field in Project is:
prj_name = models.CharField(_("project name"), max_length=110,
unique=True, db_index=True, help_text=_('Enter the name of your project.'))

...

def __unicode__(self):
return self.prj_name
​


​Any ideas?​

Should I file a bug report?

​Thanks,
Tim
​






Timothy Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
MLHIM http://www.mlhim.org

-- 
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%2B%3DOU3U-ac7cmZr9Ni5w0OdtJvw7pMsGVEpgqfzsgzkF8Rph_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 supported the 'runserver' argument. It doesn't work for me,
but 'python manage.py runserver' runs fine (and is what is recommended in
the tutorial).

It should look something like this:

> $ cd 

$ python manage.py runserver
> Validating models...
> 0 errors found
> January 16, 2015 - 04:17:18
> Django version 1.6.6, using settings 'project_name.settings'
> Starting development server at http://127.0.0.1:8000/

Quit the server with CONTROL-C.


The command should 'hang' without displaying any errors if it is running
correctly. It stays open to accept HTTP requests to http://127.0.0.1:8000.
As you make requests, they should show up under the command with the URL's
that you are requesting and the response codes from the development server.

See the section here:
https://docs.djangoproject.com/en/1.7/intro/tutorial01/#the-development-server

-James


On Jan 16, 2015 10:02 AM, "KamalKanta Majhi"  wrote:

> 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 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
>>> resolved the same.
>>>
>>>
>>> 
>>>
>>>
>>> -- Kamal
>>>
>>>
>>>
>>> On Monday, August 27, 2012 at 1:23:23 PM UTC+5:30, nav wrote:

 Dear Folks,

 I am running my django development server on 127.0.0.1:8000 and
 accessing this address from my web browser on the same machine. In the past
 few days I have found thet the web browsers keep prepending the address
 with "www." when using the above address. 127.0.0.1 without the prot number
 works fine but the django development server requires a port number.

 I have not encountered this problem before and am puzzled by what is
 happening. I am working on a Kubuntu 12.04 linux box and my /etc/hosts/
 file is below if that helps:

 
 127.0.0.1   localhost
 127.0.1.1   

 # The following lines are desirable for IPv6 capable hosts
 ::1 ip6-localhost ip6-loopback
 fe00::0 ip6-localnet
 ff00::0 ip6-mcastprefix
 ff02::1 ip6-allnodes
 ff02::2 ip6-allrouters
 

 TIA
 Cheers,
 nav

>>>  --
> 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/cc0c84af-b413-4a76-a572-b3498ff350c4%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%2Be%2BciVUP4FKrqr05R%3DS1r%2Bvm5xrHzhFMO4Bttv4%2ByD56Jd0aA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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/ac1a390b-4cd2-464c-986f-ac09143ee106%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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/3068fc0e-1bf8-433b-b195-72418883ea55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 "edit_bar" in two different models, and foo.edit_bar would
not be unique.

Does this mean I must take care myself that such name clashs don't
occur?

Tschö,
Torsten.

-- 
Torsten BrongerJabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com

-- 
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/87twzqinje.fsf%40physik.rwth-aachen.de.
For more options, visit https://groups.google.com/d/optout.


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 models
from django.db.models.signals import post_save
from django.dispatch import receiver

log = logging.getLogger(__name__)


class UserProfile(models.Model):
uuid = models.CharField(max_length=36)
user = models.OneToOneField(User)


@receiver(post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
"""
When a new user is created, add a UserProfile
"""
log.debug('received post save signal: {}'.format(instance))
if created:
UserProfile.objects.create(user=instance)

-- 
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/d732a896-d262-4673-8ff0-1080fec68498%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 
>> resolved the same. 
>>
>>
>> 
>>
>>
>> -- Kamal
>>
>>
>>
>> On Monday, August 27, 2012 at 1:23:23 PM UTC+5:30, nav wrote:
>>>
>>> Dear Folks,
>>>
>>> I am running my django development server on 127.0.0.1:8000 and 
>>> accessing this address from my web browser on the same machine. In the past 
>>> few days I have found thet the web browsers keep prepending the address 
>>> with "www." when using the above address. 127.0.0.1 without the prot number 
>>> works fine but the django development server requires a port number.
>>>
>>> I have not encountered this problem before and am puzzled by what is 
>>> happening. I am working on a Kubuntu 12.04 linux box and my /etc/hosts/ 
>>> file is below if that helps:
>>>
>>> 
>>> 127.0.0.1   localhost
>>> 127.0.1.1   
>>>
>>> # The following lines are desirable for IPv6 capable hosts
>>> ::1 ip6-localhost ip6-loopback
>>> fe00::0 ip6-localnet
>>> ff00::0 ip6-mcastprefix
>>> ff02::1 ip6-allnodes
>>> ff02::2 ip6-allrouters
>>> 
>>>
>>> TIA
>>> Cheers,
>>> nav
>>>
>>

-- 
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/cc0c84af-b413-4a76-a572-b3498ff350c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 work either
>
> -thanks
>
> perjantai 16. tammikuuta 2015 19.19.09 UTC+2 Mark kirjoitti:
>>
>> 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 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 records in query.
>>> User.objects.filter(username=username).first() is not None # 
>>> .first() returns the first record if there are matches, and None if there 
>>> aren't
>>> 
>>>
>>> On Fri, Jan 16, 2015 at 9:11 AM, James Bennett  
>>> wrote:
>>>
 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 unsubscribe from this group and stop receiving emails from it, send 
 an email to django-users...@googlegroups.com.
 To post to this group, send email to django...@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/CAL13Cg8MaAhTh%2B%3DoGTJ75jeZVY8-gt_hMkUTjZxyLxFkQ%2Bx36Q%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/11c0d221-dab7-4672-ac93-51a5f8f84483%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 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 records in query.
>> User.objects.filter(username=username).first() is not None # .first() 
>> returns the first record if there are matches, and None if there aren't
>> 
>>
>> On Fri, Jan 16, 2015 at 9:11 AM, James Bennett > > wrote:
>>
>>> 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 unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com .
>>> To post to this group, send email to django...@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/CAL13Cg8MaAhTh%2B%3DoGTJ75jeZVY8-gt_hMkUTjZxyLxFkQ%2Bx36Q%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/3c382fec-6861-4e91-b9c7-fd3a02e77334%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 records in query.
> User.objects.filter(username=username).first() is not None # .first()
> returns the first record if there are matches, and None if there aren't
>
>
> On Fri, Jan 16, 2015 at 9:11 AM, James Bennett 
> wrote:
>
>> 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 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/CAL13Cg8MaAhTh%2B%3DoGTJ75jeZVY8-gt_hMkUTjZxyLxFkQ%2Bx36Q%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/CACMDPqG8-V--9HB_c2YM%3DYchq7bhOmPTA482jLTFwRLpuFLZTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 records in query.
User.objects.filter(username=username).first() is not None # .first()
returns the first record if there are matches, and None if there aren't


On Fri, Jan 16, 2015 at 9:11 AM, James Bennett 
wrote:

> 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 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/CAL13Cg8MaAhTh%2B%3DoGTJ75jeZVY8-gt_hMkUTjZxyLxFkQ%2Bx36Q%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/CACMDPqEAEdsAi6Vos91-Erxg4RxUHvh1bZhdTa-%2B5ykMjT0wXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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/CAL13Cg8MaAhTh%2B%3DoGTJ75jeZVY8-gt_hMkUTjZxyLxFkQ%2Bx36Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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 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 been inActive or without permission, but 
>> first thing to check would be to find if username is in user database.
>> Is there any fast way to check it?
>>
>> -thanks for help
>>
>

-- 
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/a4146e09-3e68-4ece-bd50-feb77c34821c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 http://192.168.0.106:8000/. 
> Throwing same error like below screen shot. Please help if anybody already 
> resolved the same. 
>
>
> 
>
>
> -- Kamal
>
>
>
> On Monday, August 27, 2012 at 1:23:23 PM UTC+5:30, nav wrote:
>>
>> Dear Folks,
>>
>> I am running my django development server on 127.0.0.1:8000 and 
>> accessing this address from my web browser on the same machine. In the past 
>> few days I have found thet the web browsers keep prepending the address 
>> with "www." when using the above address. 127.0.0.1 without the prot number 
>> works fine but the django development server requires a port number.
>>
>> I have not encountered this problem before and am puzzled by what is 
>> happening. I am working on a Kubuntu 12.04 linux box and my /etc/hosts/ 
>> file is below if that helps:
>>
>> 
>> 127.0.0.1   localhost
>> 127.0.1.1   
>>
>> # The following lines are desirable for IPv6 capable hosts
>> ::1 ip6-localhost ip6-loopback
>> fe00::0 ip6-localnet
>> ff00::0 ip6-mcastprefix
>> ff02::1 ip6-allnodes
>> ff02::2 ip6-allrouters
>> 
>>
>> TIA
>> Cheers,
>> nav
>>
>

-- 
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/dc15161e-bb1b-4e17-b595-f75314da7774%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 been inActive or without permission, but 
> first thing to check would be to find if username is in user database.
> Is there any fast way to check it?
>
> -thanks for help
>

-- 
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/5bc9220a-1383-4f52-a08a-59a1fd733889%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 been inActive or without permission, but 
first thing to check would be to find if username is in user database.
Is there any fast way to check it?

-thanks for help

-- 
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/c492082f-5f53-4e2f-bfdb-314b66e23cc8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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
=Song.objects.filter(Q(artist__made_by=request.user)|Q(album__made_by=request.user))
|

Collin



That's cool. I didn't realise you could do that.

I decided in the end to simplify my form code as I it would have taken 
too long for a user to upload 10 songs on the same page especially in 
FLAC format so I moved to single form (even though it makes the whole 
process much more difficult for the user) and will hope for the best.


Anyway this is only a minimum viable product to see if the business idea 
will work.


Thanks for the suggestion.

--
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/54B93220.8050803%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.


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 resolved 
the same. 




-- Kamal



On Monday, August 27, 2012 at 1:23:23 PM UTC+5:30, nav wrote:
>
> Dear Folks,
>
> I am running my django development server on 127.0.0.1:8000 and accessing 
> this address from my web browser on the same machine. In the past few days 
> I have found thet the web browsers keep prepending the address with "www." 
> when using the above address. 127.0.0.1 without the prot number works fine 
> but the django development server requires a port number.
>
> I have not encountered this problem before and am puzzled by what is 
> happening. I am working on a Kubuntu 12.04 linux box and my /etc/hosts/ 
> file is below if that helps:
>
> 
> 127.0.0.1   localhost
> 127.0.1.1   
>
> # The following lines are desirable for IPv6 capable hosts
> ::1 ip6-localhost ip6-loopback
> fe00::0 ip6-localnet
> ff00::0 ip6-mcastprefix
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters
> 
>
> TIA
> Cheers,
> nav
>

-- 
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/6968aa52-df04-4d69-9c58-42e1423e96ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 following error:
>
> [ "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 database, edit the DATABASES setting in
> mysite/settings.py.
> Start your first app by running python mysite/manage.py startapp [appname].
> You're seeing this message because you have DEBUG = True in your Django
> settings file and you haven't configured any URLs. Get to work!” ]
>
> Everything is all set from the hosting provider. Would you be able to help
> me with what I might be missing?
> Thanks for your time and support,
> Nicky
>
> --
> 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/83A4C46C-9747-4104-9855-9FFBEBBAB567%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/CAA8yBMxvQND5D_f3pFCDXJeEPX6pdsq3j5%2BT8e671EdUGRoJ9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 08:54, "Nicky setia"  escreveu:

> 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 database, edit the DATABASES setting in
> mysite/settings.py.
> Start your first app by running python mysite/manage.py startapp [appname].
> You're seeing this message because you have DEBUG = True in your Django
> settings file and you haven't configured any URLs. Get to work!” ]
>
> Would you be able to help me with what I might be missing?
> 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/56f25b83-94ef-4c4d-81e8-180974b8be72%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/CAA8yBMwhiEkdbCHJUsAyrAonVZV-3%2BoNanEM17YFRWGj5HjkmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 database, edit the DATABASES setting in 
mysite/settings.py.
Start your first app by running python mysite/manage.py startapp [appname].
You're seeing this message because you have DEBUG = True in your Django 
settings file and you haven't configured any URLs. Get to work!” ]

Would you be able to help me with what I might be missing?
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/56f25b83-94ef-4c4d-81e8-180974b8be72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 following error:

[ "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 database, edit the DATABASES setting in mysite/settings.py.
Start your first app by running python mysite/manage.py startapp [appname].
You're seeing this message because you have DEBUG = True in your Django 
settings file and you haven't configured any URLs. Get to work!” ]

Everything is all set from the hosting provider. Would you be able to help me 
with what I might be missing?
Thanks for your time and support,
Nicky

-- 
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/83A4C46C-9747-4104-9855-9FFBEBBAB567%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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/a25478b0-5b52-4975-a4b7-5c255bb60d1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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")


Erik


> Den 16/01/2015 kl. 04.01 skrev sum abiut :
> 
> i expect to see only the data that have 
> department_head_authorization="Approved" and department="FMKD" showing but 
> instead the data that the department_head_authorization is not Approved is 
> also showing.
> 
> 
> 
> On Fri, Jan 16, 2015 at 11:58 AM, Vijay Khemlani  wrote:
> What are you expecting to see? What are you actually seeing?
> 
> On Thu, Jan 15, 2015 at 9:48 PM, sum abiut  wrote:
> Ok thanks,
> 
> i just released that i have made a mistake. so basically here are my 
> template.html and view.py
> i think there is a mistake in my view.py the display result is not what i was 
> looking for. can't seem to figure it out.
> 
> template.html
> 
> 
> 
> Select to approve leave
>   First Name
>   Last Name
>   Position
>   Department
>   Leave Type
>   Details
>   Start Date
>   End Date
>   Total working days
>   # of leave left
>Department Head Authorization
>   Authorize By
>Remarks
>   Authorized Date
>   
> 
> {%for a in new_leave%}
> 
>  onClick="parent.location='#'" >  
> {{a.first_name}}
>   {{a.last_name}}
>   {{a.position}}
>   {{a.department}}
> {{a.leave_type}}
>   {{a.specify_details}}
>   {{a.start_date}}
>   {{a.end_date}}
>   {{a.total_working_days}}
>   {{a.total_Leave_Left}}
>{{a.department_head_authorization}}
> {{a.authorized_by}}
>  {{a.remarks}}
>  {{a.authorization_date}}
> 
>   
> {%endfor%}
> 
> 
> 
> 
> view.py
> 
> 
> def FMKD1_leave_to_authorize(request):
> new_leave 
> =newleave.objects.filter(department_head_authorization="Approved" )
> new_leave = newleave.objects.filter(department="FMKD")
> if new_leave.exists() and new_leave.exists():
> return render_to_response('FMKD1_display_approve_leave.html', 
> locals()) 
> 
> 
> 
> 
> 
> 
> On Fri, Jan 16, 2015 at 10:52 AM, Vijay Khemlani  wrote:
> in your view new_leave and a are QuerySet objects, and then you are comparing 
> them to a string ("True") not a bolean (True without quotes), so it's always 
> False.
> 
> Even if you change "True" to True it won't work, try it like this
> 
> if new_leave.exists() and a.exists():
>   return ...
> 
> 
> On Thu, Jan 15, 2015 at 8:40 PM, sum abiut  wrote:
> 
> 
> Hi,
> I am trying to two column and display some result if two conditions are meet 
> but i am getting this error: 
> The view eLeave.views.FMKD1_leave_to_authorize didn't return an HttpResponse 
> object. It returned None instead.
> 
> I can seems to figure out the issue, here is my view.py file
> 
> def FMKD1_leave_to_authorize(request):
> new_leave 
> =newleave.objects.filter(department_head_authorization="Approved" )
> a = newleave.objects.filter(department="FMKD")
> if new_leave=="True"and a =="True":
> return render_to_response('FMKD1_display_approve_leave.html', 
> locals())
> 
> -- 
> 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-y7uRsM8Vx6Jj5QD4ZY%2BCk24SkgCHZv-xMGZr49icPrmrA%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/CALn3ei0QaQbwb%3DvkGJ6%2B4DB19p2ZDjTzJb1fSmoAhWUGg_H5PA%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/CAPCf-y6MXc2tR5wBBv9358TMoyBV5K5Ay8vHOSji104fBz1Ovg%40mail.gmail.com.
> 
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this m