Django Development Server and Chrome - autorefresh

2015-09-21 Thread Hari Mahadevan
Hi,

I created a chrome extension that along with a custom django app 
automatically refreshes a Chrome browser page whenever the Django 
development server detects file change and reloads itself.

I have been using this for a couple of months now and find it indispensable 
as I use VIM for Django development. Hope you will find it useful too.

You can find the source and instructions on how to set it up on my github 
page --  https://github.com/harikvpy/django-autorefresh.

Thanks
Hari

-- 
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/c71c4679-bb8a-45f6-be5c-d6e9728c7b15%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


IntegrityError : AUTH_USER DJango 1.8

2015-09-21 Thread Jose Paul
Daer All,

I am trying to run DJango 1.8 test cases .

I am getting several IntegrityError  error  on AUTH_USER table .


SQL generated by test case

INSERT INTO "AUTH_USER" ("PASSWORD", "LAST_LOGIN", "IS_SUPERUSER", 
"USERNAME", "FIRST_NAME", "LAST_NAME", "EMAIL", "IS_STAFF", "IS_ACTIVE", 
"DATE_JOINED") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)

Values it tries to insert 

(None, None, True, u'superuser', None, None, None, False, True, 
u'2015-09-17 12:31:09.562000')

Error 
ibm_db_dbi::IntegrityError: Statement Execute Failed: [IBM][CLI 
Driver][DB2/NT] SQL0407N  Assignment of a NULL value to a NOT NULL column 
"TBSPACEID=2, TABLEID=24, COLNO=1" is not allowed.  SQLSTATE=23502\r 
SQLCODE=-407

In the table only LAST_LOGIN is nullable field .
But the sql generated tries to insert none to other fields .DB2 throw error 
because of this .

I think there is some problem in the sql generated .
I am getting several same  errors on this table .

Can someone comment please .

Thanks
Jose



-- 
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/8e21f914-52c9-419d-8646-678d8aef96e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


regarding SESSION_COOKIE_DOMAIN

2015-09-21 Thread Bharat Perumalla
Hi

I am trying to use single-sign-on with sub domains. I configured 
SESSION_COOKIE_DOMAIN in django settings as ".cvbn.com" for all websites. I 
configured Apache with below configuration

   Header set Access-Control-Allow-Origin *
Header set Access-Control-Allow-Credentials: "true"
Header set Access-Control-Allow-Headers "SOAPAction, Authorization, 
username, password, origin, X-Requested-With, Content-Type, XMLHttpRequest"
Header set Access-Control-Allow-Methods "POST, GET, PUT, DELETE, 
OPTIONS"

But still I could not get cookie sharing across sub domains. Can you share 
some light on this?

Thanks
Bharat

-- 
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/7db764da-4bbb-414a-9dc9-db61f4bdb379%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


DJango 1.8 test case fails with IntegrityError error

2015-09-21 Thread Jose Paul
I am trying to run DJango 1.8 test cases with DB2

Several insert statement fails 

Here is the insert command generated by test case.

INSERT INTO "AUTH_USER" ("PASSWORD", "LAST_LOGIN", "IS_SUPERUSER", 
"USERNAME", "FIRST_NAME", "LAST_NAME", "EMAIL", "IS_STAFF", "IS_ACTIVE", 
"DATE_JOINED") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)

Value : (None, None, True, u'superuser', None, None, None, False, True, 
u'2015-09-17 12:31:09.562000')

ibm_db_dbi::IntegrityError: Statement Execute Failed: [IBM][CLI 
Driver][DB2/NT] SQL0407N  Assignment of a NULL value to a NOT NULL column 
"TBSPACEID=2, TABLEID=24, COLNO=1" is not allowed.  SQLSTATE=23502\r 
SQLCODE=-407


Except last_login none of the field are nullable .
But still DJango testcase generate insert statement  as above and pass None 
as value which fails .

Why this happens ?.
Why correct non null values are not generated for non null field .

Please help .Thanks ,
Jose

-- 
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/c6f5ed39-4084-4a45-9b97-24b680b45ebc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJango 1.8 test case fails with IntegrityError error

2015-09-21 Thread Jose Paul


Please see the call stack too ,for one of the error


"C:\Users\IBM_ADMIN\PythonWorkspace\DJangoTestCases\src\DJangoTestCases\tests\admin_filters\tests.py",
 
line 229, in setUp

self.alfred = User.objects.create_user('alfred', 'alf...@example.com')

File "C:\Python27\lib\site-packages\django\contrib\auth\models.py", line 
187, in create_user

**extra_fields)

File "C:\Python27\lib\site-packages\django\contrib\auth\models.py", line 
182, in _create_user

user.save(using=self._db)

File "C:\Python27\lib\site-packages\django\db\models\base.py", line 710, in 
save

force_update=force_update, update_fields=update_fields)

File "C:\Python27\lib\site-packages\django\db\models\base.py", line 738, in 
save_base

updated = self._save_table(raw, cls, force_insert, force_update, using, 
update_fields)

File "C:\Python27\lib\site-packages\django\db\models\base.py", line 822, in 
_save_table

result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)

File "C:\Python27\lib\site-packages\django\db\models\base.py", line 861, in 
_do_insert

using=using, raw=raw)

File "C:\Python27\lib\site-packages\django\db\models\manager.py", line 127, 
in manager_method

return getattr(self.get_queryset(), name)(*args, **kwargs)

File "C:\Python27\lib\site-packages\django\db\models\query.py", line 920, 
in _insert

return query.get_compiler(using=using).execute_sql(return_id)

File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", line 
974, in execute_sql

cursor.execute(sql, params)

File "C:\Python27\lib\site-packages\django\db\backends\utils.py", line 67, 
in execute

return self.cursor.execute(sql, params)

File 
"c:\python27\lib\site-packages\ibm_db_django-1.0.7-py2.7.egg\ibm_db_django\pybase.py",
 
line 165, in execute

six.reraise(utils.IntegrityError, utils.IntegrityError( *tuple( six.PY3 and 
e.args or ( e._message, ) ) ), sys.exc_info()[2])

File 
"c:\python27\lib\site-packages\ibm_db_django-1.0.7-py2.7.egg\ibm_db_django\pybase.py",
 
line 161, in execute

return super( DB2CursorWrapper, self ).execute( operation, parameters )

File 
"c:\python27\lib\site-packages\ibm_db-2.0.5.1-py2.7.egg\ibm_db_dbi.py", 
line 1335, in execute

self._execute_helper(parameters)

File 
"c:\python27\lib\site-packages\ibm_db-2.0.5.1-py2.7.egg\ibm_db_dbi.py", 
line 1247, in _execute_helper

raise self.messages[len(self.messages) - 1]

IntegrityError: Statement Execute Failed: [IBM][CLI Driver][DB2/NT] 
SQL0407N Assignment of a NULL value to a NOT NULL column "TBSPACEID=2, 
TABLEID=24, COLNO=5" is not allowed. SQLSTATE=23502\r SQLCODE=-407




On Monday, September 21, 2015 at 4:44:39 PM UTC+5:30, Jose Paul wrote:
>
> I am trying to run DJango 1.8 test cases with DB2
>
> Several insert statement fails 
>
> Here is the insert command generated by test case.
>
> INSERT INTO "AUTH_USER" ("PASSWORD", "LAST_LOGIN", "IS_SUPERUSER", 
> "USERNAME", "FIRST_NAME", "LAST_NAME", "EMAIL", "IS_STAFF", "IS_ACTIVE", 
> "DATE_JOINED") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
>
> Value : (None, None, True, u'superuser', None, None, None, False, True, 
> u'2015-09-17 12:31:09.562000')
>
> ibm_db_dbi::IntegrityError: Statement Execute Failed: [IBM][CLI 
> Driver][DB2/NT] SQL0407N  Assignment of a NULL value to a NOT NULL column 
> "TBSPACEID=2, TABLEID=24, COLNO=1" is not allowed.  SQLSTATE=23502\r 
> SQLCODE=-407
>
>
> Except last_login none of the field are nullable .
> But still DJango testcase generate insert statement  as above and pass 
> None as value which fails .
>
> Why this happens ?.
> Why correct non null values are not generated for non null field .
>
> Please help .Thanks ,
> Jose
>

-- 
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/7d38d707-138b-4acc-baab-089ae089c228%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJango 1.8 test case fails with IntegrityError error

2015-09-21 Thread Simon Charette
Hi Jose,

I looks like ibm_db_django doesn't support Django 1.6+ yet 
.

Simon

Le lundi 21 septembre 2015 07:14:39 UTC-4, Jose Paul a écrit :
>
> I am trying to run DJango 1.8 test cases with DB2
>
> Several insert statement fails 
>
> Here is the insert command generated by test case.
>
> INSERT INTO "AUTH_USER" ("PASSWORD", "LAST_LOGIN", "IS_SUPERUSER", 
> "USERNAME", "FIRST_NAME", "LAST_NAME", "EMAIL", "IS_STAFF", "IS_ACTIVE", 
> "DATE_JOINED") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
>
> Value : (None, None, True, u'superuser', None, None, None, False, True, 
> u'2015-09-17 12:31:09.562000')
>
> ibm_db_dbi::IntegrityError: Statement Execute Failed: [IBM][CLI 
> Driver][DB2/NT] SQL0407N  Assignment of a NULL value to a NOT NULL column 
> "TBSPACEID=2, TABLEID=24, COLNO=1" is not allowed.  SQLSTATE=23502\r 
> SQLCODE=-407
>
>
> Except last_login none of the field are nullable .
> But still DJango testcase generate insert statement  as above and pass 
> None as value which fails .
>
> Why this happens ?.
> Why correct non null values are not generated for non null field .
>
> Please help .Thanks ,
> Jose
>

-- 
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/414d880d-d849-496a-9f96-a03a51d9baae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django was present in FSD in Costa Rica

2015-09-21 Thread Luis Zárate
Hello everyone.

The past week was the Free software day here in Costa Rica (Yes, It was a
week of FSD's because it was in different days in different cities), we had
5 different events for this day in different cities. As part of our effort
for introduce Django in this country I imparted two lectures in this
events, the title was "Django: El framework web para perfeccionistas con
poco tiempo" (my translation of Django:The web framework for perfectionists
with deadlines.).
I am really happy because this lectures had many expectations and I saw
many people interested in Django after those lecture.
I just want to share this information with you because I am documenting
what is happening here.



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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/CAG%2B5VyNEt17Z0ccWyvLnbaeK%3DTaX-4A0HBuF5K8uQG2Je4GTVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django was present in FSD in Costa Rica

2015-09-21 Thread Rafael E. Ferrero
BUENÍSIMO LUIS!!! EXCELENTE INICIATIVA!!!

Muchos exitos para tí y para Django en Costa Rica

Saludos, Rafael Ferrero (desde Argentina)

--
Rafael E. Ferrero

2015-09-21 17:21 GMT-03:00 Luis Zárate :

> Hello everyone.
>
> The past week was the Free software day here in Costa Rica (Yes, It was a
> week of FSD's because it was in different days in different cities), we had
> 5 different events for this day in different cities. As part of our effort
> for introduce Django in this country I imparted two lectures in this
> events, the title was "Django: El framework web para perfeccionistas con
> poco tiempo" (my translation of Django:The web framework for perfectionists
> with deadlines.).
> I am really happy because this lectures had many expectations and I saw
> many people interested in Django after those lecture.
> I just want to share this information with you because I am documenting
> what is happening here.
>
>
>
> --
> "La utopía sirve para caminar" Fernando Birri
>
>
> --
> 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/CAG%2B5VyNEt17Z0ccWyvLnbaeK%3DTaX-4A0HBuF5K8uQG2Je4GTVA%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/CAJJc_8UxuW3rsA6UhTU5kq0faf%3DP0DqHbSqZxPyVMQ%2BCPLxTDg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Best way to trigger javascript function when returning a page from django view

2015-09-21 Thread Martín Torre Castro
I'm looking soon which cases don't return the form filled with data, but
I've just tested and we have one that validates, but doesn't return the
data fields filled.

Maybe we're doing something wrong. I'm investigating.

On 21 September 2015 at 04:11, Vijay Khemlani  wrote:

> "It's true that when it's not filled correctly, the form returns the
> validation but we have cases in which the data in the fields is not
> returned when the form operation is not successful."
>
> What cases? Dynamic fields or something like that? Django forms are
> supposed to pre-fill all the fields when there is a validation error.
>
> On Sat, Sep 19, 2015 at 10:34 PM, Luis Zárate  wrote:
>
>>
>>
>> In the success method do something like
>>
>> $('myform').reset ();
>> I don't understand well but if you have cache clean it too.
>>
>>
>> El sábado, 19 de septiembre de 2015, Martín Torre Castro <
>> martin.torre.cas...@gmail.com> escribió:
>> > Maybe I should have made the context more clear.
>> >
>> > First of all, we're not using ModelForms but just Django Forms.
>> >
>> > It's true that when it's not filled correctly, the form returns the
>> validation but we have cases in which the data in the fields is not
>> returned when the form operation is not successful.
>> >
>> > In those cases we copy the sent data in python and return that sent
>> data, filling the form with it, but we have achieved a better, more generic
>> way by JavaScript.
>> >
>> > When the form operation is successful, we need the data no more,
>> because is already saved in database, so we want to clear it from HTML5
>> webStorage by JavaScript.
>> >
>> > El 19/9/2015 1:04 p. m., "Gergely Polonkai" 
>> escribió:
>> >>
>> >> Hello,
>> >>
>> >> I can't see the use case here. If you are submitting the form with
>> AJAX, why would you store it? Or, if I misunderstood you and you submit in
>> the non-AJAX way, Django will send give you back your filled form with the
>> validation errors.
>> >>
>> >> Best,
>> >> Gergely
>> >>
>> >> On 19 Sep 2015 10:09, "Martin Torre Castro"  wrote:
>> >>>
>> >>> Hello,
>> >>> I have a django project where I make requests to the server views
>> both by AJAX and the usual  simple URL requests to Django.
>> >>> The thing is that I have made one javascript function for storing the
>> forms contents in the HTML5 webstorage and I want to clear the stored data
>> after coming from a succesful operation, beacuse the flow is:
>> >>> 1. You get to the form
>> >>> 2. You enter the data into the form
>> >>> 3. Press submit
>> >>>a. If there is a validation error, we come back to 3 and the
>> javascript function fills the same data entered into the form (this is
>> already done and is awesome and comfortable for the user)
>> >>> 4. If all data was valid and OK, after returning from the
>> python/django view I want to trigger the javascript function that clears
>> the stored data, because is saved and we don't need it anymore because it's
>> already saved. This is my problem
>> >>>
>> >>> When returning to an AJAX I can simply use the success function in
>> jQuery.get() o jQuery.ajax(), but when returning from a regular view I
>> can't think of any strategy other than passing the flow to a success page,
>> in which I trigger the function with $(document).ready().
>> >>> I'm looking for the best alternative, because it would be better not
>> forcing me to pass through a specific page. Any ideas?
>> >>>
>> >>> Thank you in advance.
>> >>>
>> >>> --
>> >>> 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/bffd59a7-c30f-4092-8160-30ef7e472b27%40googlegroups.com
>> .
>> >>> For more options, visit https://groups.google.com/d/optout.
>> >>
>> >> --
>> >> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> >> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/eZJ-mQgp9w0/unsubscribe.
>> >> To unsubscribe from this group and all its topics, 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/CACczBUKE741snUn-BKF9RUzJejFypsb-W4tamtS7NJdW6F06KA%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 s

Re: Django was present in FSD in Costa Rica

2015-09-21 Thread Vijay Khemlani
Felicitaciones desde Chile también, y espero que más gente por allá se
interese en el framework :)

On Mon, Sep 21, 2015 at 5:26 PM, Rafael E. Ferrero  wrote:

> BUENÍSIMO LUIS!!! EXCELENTE INICIATIVA!!!
>
> Muchos exitos para tí y para Django en Costa Rica
>
> Saludos, Rafael Ferrero (desde Argentina)
>
> --
> Rafael E. Ferrero
>
> 2015-09-21 17:21 GMT-03:00 Luis Zárate :
>
>> Hello everyone.
>>
>> The past week was the Free software day here in Costa Rica (Yes, It was a
>> week of FSD's because it was in different days in different cities), we had
>> 5 different events for this day in different cities. As part of our effort
>> for introduce Django in this country I imparted two lectures in this
>> events, the title was "Django: El framework web para perfeccionistas con
>> poco tiempo" (my translation of Django:The web framework for perfectionists
>> with deadlines.).
>> I am really happy because this lectures had many expectations and I saw
>> many people interested in Django after those lecture.
>> I just want to share this information with you because I am documenting
>> what is happening here.
>>
>>
>>
>> --
>> "La utopía sirve para caminar" Fernando Birri
>>
>>
>> --
>> 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/CAG%2B5VyNEt17Z0ccWyvLnbaeK%3DTaX-4A0HBuF5K8uQG2Je4GTVA%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/CAJJc_8UxuW3rsA6UhTU5kq0faf%3DP0DqHbSqZxPyVMQ%2BCPLxTDg%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/CALn3ei3CG%3DWKGKKLCKhSRs-aCQQTMRmpUHSKNuMj5qtk1aTxog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Invalid HTTP_HOST, can someone explain why I am getting this?

2015-09-21 Thread frocco
I am still getting this invalid host from time to time.
Does this mean that someone is trying to hack my site?

www.g3suprimentos.com.br is not anything I own.

For now, I am just ignoring this.

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/a2cac09b-ae37-4b95-a72f-c80c47f24654%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Invalid HTTP_HOST, can someone explain why I am getting this?

2015-09-21 Thread François Schiettecatte
Not likely, all that is happening is that you are getting requests where the 
‘Host:’ HTTP header is not set or set to something other than what is accepted 
by your site. Most likely a buggy client. I get that all the time, I just 
ignore it.

Cheers

François

> On Sep 21, 2015, at 6:16 PM, frocco  wrote:
> 
> I am still getting this invalid host from time to time.
> Does this mean that someone is trying to hack my site?
> 
> www.g3suprimentos.com.br is not anything I own.
> 
> For now, I am just ignoring this.
> 
> 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/a2cac09b-ae37-4b95-a72f-c80c47f24654%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/82A273A0-5121-4257-8BC7-9E0BEB039FD5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Invalid HTTP_HOST, can someone explain why I am getting this?

2015-09-21 Thread Carl Meyer
On 09/21/2015 04:22 PM, François Schiettecatte wrote:
> Not likely, all that is happening is that you are getting requests
> where the ‘Host:’ HTTP header is not set or set to something other
> than what is accepted by your site. Most likely a buggy client. I get
> that all the time, I just ignore it.
> 
> Cheers
> 
> François
> 
>> On Sep 21, 2015, at 6:16 PM, frocco  wrote:
>> 
>> I am still getting this invalid host from time to time. Does this
>> mean that someone is trying to hack my site?
>> 
>> www.g3suprimentos.com.br is not anything I own.
>> 
>> For now, I am just ignoring this.

The best way to solve this for good and never get those errors again is
to fix it in your front-end webserver configuration, so that it ignores
requests for the wrong Host and doesn't even pass them on to Django in
the first place. If you're using nginx that means setting your
`server_name` directive correctly. If you're using Apache that means
using a name-based (non-default) VirtualHost. Any webserver should
provide some way to do this.

Carl

-- 
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/56008402.70309%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: Invalid HTTP_HOST, can someone explain why I am getting this?

2015-09-21 Thread frocco
I am using webfaction and django 1.5

Is this something webfaction and resolve?

On Monday, September 21, 2015 at 6:26:40 PM UTC-4, Carl Meyer wrote:
>
> On 09/21/2015 04:22 PM, François Schiettecatte wrote: 
> > Not likely, all that is happening is that you are getting requests 
> > where the ‘Host:’ HTTP header is not set or set to something other 
> > than what is accepted by your site. Most likely a buggy client. I get 
> > that all the time, I just ignore it. 
> > 
> > Cheers 
> > 
> > François 
> > 
> >> On Sep 21, 2015, at 6:16 PM, frocco > 
> wrote: 
> >> 
> >> I am still getting this invalid host from time to time. Does this 
> >> mean that someone is trying to hack my site? 
> >> 
> >> www.g3suprimentos.com.br is not anything I own. 
> >> 
> >> For now, I am just ignoring this. 
>
> The best way to solve this for good and never get those errors again is 
> to fix it in your front-end webserver configuration, so that it ignores 
> requests for the wrong Host and doesn't even pass them on to Django in 
> the first place. If you're using nginx that means setting your 
> `server_name` directive correctly. If you're using Apache that means 
> using a name-based (non-default) VirtualHost. Any webserver should 
> provide some way to do this. 
>
> Carl 
>
>

-- 
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/465fefdd-cf2e-42cf-a050-e2ac09d4fb87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reverse for 'post_detail' with arguments '()' and keyword arguments '{'pk': 1}' not found. 1 pattern(s) tried:

2015-09-21 Thread Luis Zárate
The error is in the template, please check the url statement inside the
template.

Or share with ours the template file.

El sábado, 19 de septiembre de 2015, sankar vasu 
escribió:
> Hi All,
>
> I got below error, please advise. please look at the following link:
http://pysan.pythonanywhere.com/
>
>

>
>
> url.py
>
> from django.conf.urls import url
> from . import views
>
> urlpatterns = [
> url(r'^$', views.post_list, name='post_list'),
> url(r'^post/(?P[0-9]+)/$', views.post_detail, name='post_detail'),
> ]
>
>
> view.py
>
> from django.shortcuts import render, get_object_or_404
> from django.utils import timezone
> from .models import Post
>
> def post_list(request):
> posts =
Post.objects.filter(published_date__lte=timezone.now()).order_by('published_date')
> return render(request, 'blog/post_list.html', {'posts': posts})
>
> def post_detail(request, pk):
> post = get_object_or_404(Post, pk=pk)
> return render(request, 'blog/post_detail.html', {'post': post})
>
>
> Thanks in advance,
> Sankar B
>
> --
> 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/CAPzi0vCzoaSN%2B6xEL%3D%2BPSu_vQMpqG6i8oFw9y4_mtPvO8xtoeg%40mail.gmail.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

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


Re: DJango 1.8 test case fails with IntegrityError error

2015-09-21 Thread Jose Paul
Hi Simon,

I am working on this support .

But the test case generates sql with null values for non null fields.

We cannot change the model ,because this is part of python ,i believe.

The problem might be the schema generated for the table from the model .
I can see only one field as non null in DB2.

Is this different from other database?.

Thanks,
Jose

On Monday, September 21, 2015 at 8:37:51 PM UTC+5:30, Simon Charette wrote:
>
> Hi Jose,
>
> I looks like ibm_db_django doesn't support Django 1.6+ yet 
> .
>
> Simon
>
> Le lundi 21 septembre 2015 07:14:39 UTC-4, Jose Paul a écrit :
>>
>> I am trying to run DJango 1.8 test cases with DB2
>>
>> Several insert statement fails 
>>
>> Here is the insert command generated by test case.
>>
>> INSERT INTO "AUTH_USER" ("PASSWORD", "LAST_LOGIN", "IS_SUPERUSER", 
>> "USERNAME", "FIRST_NAME", "LAST_NAME", "EMAIL", "IS_STAFF", "IS_ACTIVE", 
>> "DATE_JOINED") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
>>
>> Value : (None, None, True, u'superuser', None, None, None, False, True, 
>> u'2015-09-17 12:31:09.562000')
>>
>> ibm_db_dbi::IntegrityError: Statement Execute Failed: [IBM][CLI 
>> Driver][DB2/NT] SQL0407N  Assignment of a NULL value to a NOT NULL column 
>> "TBSPACEID=2, TABLEID=24, COLNO=1" is not allowed.  SQLSTATE=23502\r 
>> SQLCODE=-407
>>
>>
>> Except last_login none of the field are nullable .
>> But still DJango testcase generate insert statement  as above and pass 
>> None as value which fails .
>>
>> Why this happens ?.
>> Why correct non null values are not generated for non null field .
>>
>> Please help .Thanks ,
>> Jose
>>
>

-- 
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/0a3e908b-13ee-43f0-a7d5-57769472c6fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.