Re: Bus Error on Development Server

2014-03-01 Thread Gkpetrak
Hello, thank you for your quick replies.

I tried to start the development server with the GNU debugger gdb to check 
the error and I had the following output:

Starting program: /home/george/venv/bin/python 
Missing separate debuginfo for /lib64/ld-linux-x86-64.so.2
Try: zypper install -C 
"debuginfo(build-id)=0a23c4e8300b31613d800697d835b384e921407e"
Missing separate debuginfo for /usr/lib64/libpython2.7.so.1.0
Try: zypper install -C 
"debuginfo(build-id)=296d71f2934f9c2d3ba886de2800eec20e7c962b"
Missing separate debuginfo for /lib64/libpthread.so.0
Try: zypper install -C 
"debuginfo(build-id)=ef5f5dbcb2398c608fef7884e1bfb65be3b5f0ef"
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Missing separate debuginfo for /lib64/libc.so.6
Try: zypper install -C 
"debuginfo(build-id)=837f2459b5923578eb82a4b75b1f98a5faa08532"
Missing separate debuginfo for /lib64/libdl.so.2
Try: zypper install -C 
"debuginfo(build-id)=da368634ea211229f45d2f8d32e7da61800b4c75"
Missing separate debuginfo for /lib64/libutil.so.1
Try: zypper install -C 
"debuginfo(build-id)=80aa68689cd052a407891ec71329f565261589cc"
Missing separate debuginfo for /lib64/libm.so.6
Try: zypper install -C 
"debuginfo(build-id)=24fba01931c773fd5b4688b34c4acde47ea77cb9"
Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Missing separate debuginfo for 
/home/george/venv/lib64/python2.7/lib-dynload/readline.so
Try: zypper install -C 
"debuginfo(build-id)=5bb968f04d3f29f9101606204af80c47b2ccd318"
Missing separate debuginfo for /lib64/libreadline.so.6
Try: zypper install -C 
"debuginfo(build-id)=8c2147faeda30880a1e7ced012fe68264afd22d0"
Missing separate debuginfo for /lib64/libtinfo.so.5
Try: zypper install -C 
"debuginfo(build-id)=e6b19dfd986236e90c926ddc6d8e300034392f75"

Some info for my system:
Architecture: x86_64 
CPU: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz  (*4)
Disk: ST9500325AS (/dev/sda) 
Os: OpenSuse 12.3 

I think that my disk is going to die, but until then, how can I fix it ? 
Any ideas ?

Thank you in advance,
George


Τη Σάββατο, 1 Μαρτίου 2014 4:16:18 π.μ. UTC+2, ο χρήστης Gkpetrak έγραψε:
>
> Hello,
>
> I was trying to process Images with some python scripts, when I receive 
> bus error. After that I had many bus errors on different programs.
> Finally I tried to start django' development server, and I received the 
> same error.
>
> I know that this error happens when a process is trying to access memory
> that the CPU cannot physically address.
>
> I checked my log files and the output of the error is the following:
>
>
> T02:13:26.879355+02:00 suse-pc kernel: [ 9976.488797] ata1.00: exception 
> Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
> 2014-03-01T02:13:26.879402+02:00 suse-pc kernel: [ 9976.488806] ata1.00: 
> irq_stat 0x4008
> 2014-03-01T02:13:26.879413+02:00 suse-pc kernel: [ 9976.488813] ata1.00: 
> failed command: READ FPDMA QUEUED
> 2014-03-01T02:13:26.879419+02:00 suse-pc kernel: [ 
> 9976.488826] ata1.00: cmd 60/08:00:50:8d:75/00:00:39:00:00/40 tag 0 ncq 
> 4096 in
> 2014-03-01T02:13:26.879428+02:00 suse-pc kernel: [ 
> 9976.488826]  res 41/40:08:51:8d:75/00:00:39:00:00/00 Emask 
> 0x409 (media error) 
> 2014-03-01T02:13:26.879434+02:00 suse-pc kernel: [ 9976.488832] ata1.00: 
> status: { DRDY ERR }
> 2014-03-01T02:13:26.879437+02:00 suse-pc kernel: [ 9976.488836] ata1.00: 
> error: { UNC }
> 2014-03-01T02:13:26.948294+02:00 suse-pc kernel: [ 9976.557999] ata1.00: 
> configured for UDMA/133
> 2014-03-01T02:13:26.948313+02:00 suse-pc kernel: [ 9976.558034] sd 0:0:0:0: 
> [sda] Unhandled sense code
> 2014-03-01T02:13:26.948315+02:00 suse-pc kernel: [ 9976.558040] sd 0:0:0:0: 
> [sda]  
> 2014-03-01T02:13:26.948316+02:00 suse-pc kernel: [ 9976.558044] Result: 
> hostbyte=DID_OK driverbyte=DRIVER_SENSE
> 2014-03-01T02:13:26.948317+02:00 suse-pc kernel: [ 9976.558048] sd 0:0:0:0: 
> [sda]  
> 2014-03-01T02:13:26.948318+02:00 suse-pc kernel: [ 9976.558052] Sense Key : 
> Medium Error [current] [descriptor]
> 2014-03-01T02:13:26.948320+02:00 suse-pc kernel: [ 9976.558059] Descriptor 
> sense data with sense descriptors (in hex):
> 2014-03-01T02:13:26.948321+02:00 suse-pc kernel: [ 9976.558062] 72 03 
> 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
> 2014-03-01T02:13:26.948321+02:00 suse-pc kernel: [ 9976.558081] 39 75 
> 8d 51
> 2014-03-01T02:13:26.948335+02:00 suse-pc kernel: [ 9976.558090] sd 0:0:0:0: 
> [sda]  
> 2014-03-01T02:13:26.948338+02:00 suse-pc kernel: [ 9976.558095] Add. Sense: 
> Unrecovered read error - auto reallocate failed
> 2014-03-01T02:13:26.948339+02:00 suse-pc kernel: [ 9976.558099] sd 0:0:0:0: 
> [sda] CDB:
> 2014-03-01T02:13:26.948340+02:00 suse-pc kernel: [ 9976.558102] Read(10): 28 
> 00 39 75 8d 50 00 00 08 00
> 2014-03-01T02:13:26.948341+02:00 suse-pc kernel: [ 9976.558119] end_request: 
> I/O error, dev sda, sector 964005201
> 2014-03-01T02:13:26.948

Re: Trouble with Django in production server.

2014-03-01 Thread Jonathan D. Baker
Instead of hard-coding paths, check out os.path, os.abspath and os.sep (and the 
rest of the os module) for such needs. I usually declare a PROJECT_ROOT var at 
the top of my settings.py using the aforementioned os module, and then hang 
paths (like your db path) off of that instead of building each path 
individually.

Glad you figured it out.

Sent from my iPhone

> On Mar 1, 2014, at 5:41 PM, Omar Acevedo  wrote:
> 
> To see if it worked, and yes it did!
> So, I'm just having trouble with the paths.
> I'm using a virtual environment.
> So I guess I'll have to deal with the paths.
> Thank you a lot anyways!!! :)
> 
> 
>> On Sat, Mar 1, 2014 at 8:39 PM, Omar Acevedo  wrote:
>> I explicitly wrote '/home/catacafe/.env/env/lib/python2.7/db.sqlite3' in the 
>> NAME option of the DATABASES dictionary.
> 
> -- 
> 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/CAH_X0gMnjh%2BOy5AQC2rw_LtKEjnWU-YVY_yBH3AzTMoSP%2BCiXw%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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/67FC5368-10B8-4534-A059-FE1CD467CB26%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Trouble with Django in production server.

2014-03-01 Thread Omar Acevedo
To see if it worked, and yes it did!
So, I'm just having trouble with the paths.
I'm using a virtual environment.
So I guess I'll have to deal with the paths.
Thank you a lot anyways!!! :)


On Sat, Mar 1, 2014 at 8:39 PM, Omar Acevedo  wrote:

> I explicitly wrote '/home/catacafe/.env/env/lib/python2.7/db.sqlite3' in
> the NAME option of the DATABASES dictionary.
>

-- 
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/CAH_X0gMnjh%2BOy5AQC2rw_LtKEjnWU-YVY_yBH3AzTMoSP%2BCiXw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Trouble with Django in production server.

2014-03-01 Thread Omar Acevedo
I explicitly wrote '/home/catacafe/.env/env/lib/python2.7/db.sqlite3' in
the NAME option of the DATABASES dictionary.

-- 
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/CAH_X0gMZEQqR9GSHeg_7U%2BUBRELGFS1r67QnkQOai-inQHto7w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Trouble with Django in production server.

2014-03-01 Thread Omar Acevedo
While trying and trying different stuff, turned out to be a bad path
configuration with the NAME inside the DATABASES dictionary within the
settings.py file.


On Sat, Mar 1, 2014 at 8:34 PM, Jonathan Baker  wrote:

> Are you using multiple settings files, for example: dev.py, pro.py, etc.?
> Are you sure that the settings file you're using is configured to use the
> database on your production server?
>
>
> On Sat, Mar 1, 2014 at 5:12 PM, Omar Acevedo  wrote:
>
>> Yes!
>>
>>
>> On Sat, Mar 1, 2014 at 8:11 PM, Jonathan Baker <
>> jonathandavidba...@gmail.com> wrote:
>>
>>> When you ran the 'syncdb' management command, was 'auth_user' listed in
>>> the output as a table that was created?
>>>
>>>
>>> On Sat, Mar 1, 2014 at 3:52 PM, Omar Acevedo  wrote:
>>>
 Hello people, I'm having an issue in/with Django, which is on a shared
 hosting, and I'm using virtualenv and fastcgi.  (<- saying this, just in
 case it helps in something)

 I'm getting
 "OperationalError at /admin/
 no such table: auth_user"
 after entering my credentials (username & pw) set when asked after
 running the syncdb.
 Yes, I created a project (django-admin.py startproject the_project),
  then ran python manage.py syncdb.
 So it's supposed (which it says it does) to create the tables for the
 admin, but still, I'm getting that error when going to the admin through
 mydomain.com/admin.

 I'm a first-timer hosting a django app, so, what else I'm supposed to
 know, to do?

 When I put Debug to False (DEBUG = False) inside the settings.py file
 and my email in the ADMINS tuple (inside settings.py) I do get this error
 message to my email.
 Which is (I'm posting it, to see if someone can tell me what's going
 on.):

  'HTTP_CONNECTION': 'close',
  'HTTP_COOKIE': 'csrftoken=Ds5T9Lx4JLgO9m6vCu0EEeLX4tVHr7dH',
  'HTTP_HOST': 'thisisnottherealdomain .com',
  'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.3; WOW64)
 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',
  'HTTP_X_FORWARDED_FOR': '##.###.###.###',
  'HTTP_X_REAL_IP': '##.###.###.###',
  'PATH': '/sbin:/usr/sbin:/bin:/usr/bin',
  'PATH_INFO': u'/',
  'PATH_TRANSLATED': 'redirect:/dispatch.fcgi/',
  'QUERY_STRING': '',
  'REDIRECT_STATUS': '200',
  'REDIRECT_UNIQUE_ID': 'UxJiK0Fj7YUAAE6ava0N',
  'REDIRECT_URL': '/',
  'REMOTE_ADDR': '##.###.###.###',
  'REMOTE_PORT': '39403',
  'REQUEST_METHOD': 'GET',
  'REQUEST_URI': '/',
  'SCRIPT_FILENAME': '/home/somename/public_html/dispatch.fcgi',
  'SCRIPT_NAME': u'',
  'SERVER_ADDR': '###.##.##.###',
  'SERVER_ADMIN': 'webmaster @ thisisnottherealdomain .com',
  'SERVER_NAME': 'thisisnottherealdomain .com',
  'SERVER_PORT': '80',
  'SERVER_PROTOCOL': 'HTTP/1.0',
  'SERVER_SIGNATURE': '',
  'SERVER_SOFTWARE': 'Apache',
  'UNIQUE_ID': 'UxJiK0Fj7YUAAE6ava0N',
  'wsgi.errors': >>> 0x7f0b2868bf50>,
  'wsgi.input': >>> 0x7f0b2868bf90>,
  'wsgi.multiprocess': False,
  'wsgi.multithread': True,
  'wsgi.run_once': False,
  'wsgi.url_scheme': 'http',
  'wsgi.version': (1, 0)}>

 --
 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/3afc2a85-5bf1-4170-ace2-bd789babdb33%40googlegroups.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.

>>>  --
>>> 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/VXpy867egD8/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/CAPMFOb5PJn_uLvVYrDyBiwQ0Y97CGtL4YnxM8DDyASRLxKHXKA%40mail.gmail.com
>>> .
>>>
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
>> 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

Re: Trouble with Django in production server.

2014-03-01 Thread Jonathan Baker
Are you using multiple settings files, for example: dev.py, pro.py, etc.?
Are you sure that the settings file you're using is configured to use the
database on your production server?


On Sat, Mar 1, 2014 at 5:12 PM, Omar Acevedo  wrote:

> Yes!
>
>
> On Sat, Mar 1, 2014 at 8:11 PM, Jonathan Baker <
> jonathandavidba...@gmail.com> wrote:
>
>> When you ran the 'syncdb' management command, was 'auth_user' listed in
>> the output as a table that was created?
>>
>>
>> On Sat, Mar 1, 2014 at 3:52 PM, Omar Acevedo  wrote:
>>
>>> Hello people, I'm having an issue in/with Django, which is on a shared
>>> hosting, and I'm using virtualenv and fastcgi.  (<- saying this, just in
>>> case it helps in something)
>>>
>>> I'm getting
>>> "OperationalError at /admin/
>>> no such table: auth_user"
>>> after entering my credentials (username & pw) set when asked after
>>> running the syncdb.
>>> Yes, I created a project (django-admin.py startproject the_project),
>>>  then ran python manage.py syncdb.
>>> So it's supposed (which it says it does) to create the tables for the
>>> admin, but still, I'm getting that error when going to the admin through
>>> mydomain.com/admin.
>>>
>>> I'm a first-timer hosting a django app, so, what else I'm supposed to
>>> know, to do?
>>>
>>> When I put Debug to False (DEBUG = False) inside the settings.py file
>>> and my email in the ADMINS tuple (inside settings.py) I do get this error
>>> message to my email.
>>> Which is (I'm posting it, to see if someone can tell me what's going
>>> on.):
>>>
>>>  'HTTP_CONNECTION': 'close',
>>>  'HTTP_COOKIE': 'csrftoken=Ds5T9Lx4JLgO9m6vCu0EEeLX4tVHr7dH',
>>>  'HTTP_HOST': 'thisisnottherealdomain .com',
>>>  'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.3; WOW64)
>>> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',
>>>  'HTTP_X_FORWARDED_FOR': '##.###.###.###',
>>>  'HTTP_X_REAL_IP': '##.###.###.###',
>>>  'PATH': '/sbin:/usr/sbin:/bin:/usr/bin',
>>>  'PATH_INFO': u'/',
>>>  'PATH_TRANSLATED': 'redirect:/dispatch.fcgi/',
>>>  'QUERY_STRING': '',
>>>  'REDIRECT_STATUS': '200',
>>>  'REDIRECT_UNIQUE_ID': 'UxJiK0Fj7YUAAE6ava0N',
>>>  'REDIRECT_URL': '/',
>>>  'REMOTE_ADDR': '##.###.###.###',
>>>  'REMOTE_PORT': '39403',
>>>  'REQUEST_METHOD': 'GET',
>>>  'REQUEST_URI': '/',
>>>  'SCRIPT_FILENAME': '/home/somename/public_html/dispatch.fcgi',
>>>  'SCRIPT_NAME': u'',
>>>  'SERVER_ADDR': '###.##.##.###',
>>>  'SERVER_ADMIN': 'webmaster @ thisisnottherealdomain .com',
>>>  'SERVER_NAME': 'thisisnottherealdomain .com',
>>>  'SERVER_PORT': '80',
>>>  'SERVER_PROTOCOL': 'HTTP/1.0',
>>>  'SERVER_SIGNATURE': '',
>>>  'SERVER_SOFTWARE': 'Apache',
>>>  'UNIQUE_ID': 'UxJiK0Fj7YUAAE6ava0N',
>>>  'wsgi.errors': >> 0x7f0b2868bf50>,
>>>  'wsgi.input': >> 0x7f0b2868bf90>,
>>>  'wsgi.multiprocess': False,
>>>  'wsgi.multithread': True,
>>>  'wsgi.run_once': False,
>>>  'wsgi.url_scheme': 'http',
>>>  'wsgi.version': (1, 0)}>
>>>
>>> --
>>> 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/3afc2a85-5bf1-4170-ace2-bd789babdb33%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>  --
>> 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/VXpy867egD8/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/CAPMFOb5PJn_uLvVYrDyBiwQ0Y97CGtL4YnxM8DDyASRLxKHXKA%40mail.gmail.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> 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/CAH_X0gN%2Bj7DNz_4SYahAejLXXmxc%3Db5Vt2TQHGXCngH1RyhPSQ%40mail.gmail.c

Re: Trouble with Django in production server.

2014-03-01 Thread Omar Acevedo
Yes!


On Sat, Mar 1, 2014 at 8:11 PM, Jonathan Baker  wrote:

> When you ran the 'syncdb' management command, was 'auth_user' listed in
> the output as a table that was created?
>
>
> On Sat, Mar 1, 2014 at 3:52 PM, Omar Acevedo  wrote:
>
>> Hello people, I'm having an issue in/with Django, which is on a shared
>> hosting, and I'm using virtualenv and fastcgi.  (<- saying this, just in
>> case it helps in something)
>>
>> I'm getting
>> "OperationalError at /admin/
>> no such table: auth_user"
>> after entering my credentials (username & pw) set when asked after
>> running the syncdb.
>> Yes, I created a project (django-admin.py startproject the_project),
>>  then ran python manage.py syncdb.
>> So it's supposed (which it says it does) to create the tables for the
>> admin, but still, I'm getting that error when going to the admin through
>> mydomain.com/admin.
>>
>> I'm a first-timer hosting a django app, so, what else I'm supposed to
>> know, to do?
>>
>> When I put Debug to False (DEBUG = False) inside the settings.py file and
>> my email in the ADMINS tuple (inside settings.py) I do get this error
>> message to my email.
>> Which is (I'm posting it, to see if someone can tell me what's going on.):
>>
>>  'HTTP_CONNECTION': 'close',
>>  'HTTP_COOKIE': 'csrftoken=Ds5T9Lx4JLgO9m6vCu0EEeLX4tVHr7dH',
>>  'HTTP_HOST': 'thisisnottherealdomain .com',
>>  'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.3; WOW64)
>> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',
>>  'HTTP_X_FORWARDED_FOR': '##.###.###.###',
>>  'HTTP_X_REAL_IP': '##.###.###.###',
>>  'PATH': '/sbin:/usr/sbin:/bin:/usr/bin',
>>  'PATH_INFO': u'/',
>>  'PATH_TRANSLATED': 'redirect:/dispatch.fcgi/',
>>  'QUERY_STRING': '',
>>  'REDIRECT_STATUS': '200',
>>  'REDIRECT_UNIQUE_ID': 'UxJiK0Fj7YUAAE6ava0N',
>>  'REDIRECT_URL': '/',
>>  'REMOTE_ADDR': '##.###.###.###',
>>  'REMOTE_PORT': '39403',
>>  'REQUEST_METHOD': 'GET',
>>  'REQUEST_URI': '/',
>>  'SCRIPT_FILENAME': '/home/somename/public_html/dispatch.fcgi',
>>  'SCRIPT_NAME': u'',
>>  'SERVER_ADDR': '###.##.##.###',
>>  'SERVER_ADMIN': 'webmaster @ thisisnottherealdomain .com',
>>  'SERVER_NAME': 'thisisnottherealdomain .com',
>>  'SERVER_PORT': '80',
>>  'SERVER_PROTOCOL': 'HTTP/1.0',
>>  'SERVER_SIGNATURE': '',
>>  'SERVER_SOFTWARE': 'Apache',
>>  'UNIQUE_ID': 'UxJiK0Fj7YUAAE6ava0N',
>>  'wsgi.errors': > 0x7f0b2868bf50>,
>>  'wsgi.input': > 0x7f0b2868bf90>,
>>  'wsgi.multiprocess': False,
>>  'wsgi.multithread': True,
>>  'wsgi.run_once': False,
>>  'wsgi.url_scheme': 'http',
>>  'wsgi.version': (1, 0)}>
>>
>> --
>> 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/3afc2a85-5bf1-4170-ace2-bd789babdb33%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>  --
> 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/VXpy867egD8/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/CAPMFOb5PJn_uLvVYrDyBiwQ0Y97CGtL4YnxM8DDyASRLxKHXKA%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAH_X0gN%2Bj7DNz_4SYahAejLXXmxc%3Db5Vt2TQHGXCngH1RyhPSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Trouble with Django in production server.

2014-03-01 Thread Jonathan Baker
When you ran the 'syncdb' management command, was 'auth_user' listed in the
output as a table that was created?


On Sat, Mar 1, 2014 at 3:52 PM, Omar Acevedo  wrote:

> Hello people, I'm having an issue in/with Django, which is on a shared
> hosting, and I'm using virtualenv and fastcgi.  (<- saying this, just in
> case it helps in something)
>
> I'm getting
> "OperationalError at /admin/
> no such table: auth_user"
> after entering my credentials (username & pw) set when asked after running
> the syncdb.
> Yes, I created a project (django-admin.py startproject the_project),  then
> ran python manage.py syncdb.
> So it's supposed (which it says it does) to create the tables for the
> admin, but still, I'm getting that error when going to the admin through
> mydomain.com/admin.
>
> I'm a first-timer hosting a django app, so, what else I'm supposed to
> know, to do?  
>
> When I put Debug to False (DEBUG = False) inside the settings.py file and
> my email in the ADMINS tuple (inside settings.py) I do get this error
> message to my email.
> Which is (I'm posting it, to see if someone can tell me what's going on.):
>
>  'HTTP_CONNECTION': 'close',
>  'HTTP_COOKIE': 'csrftoken=Ds5T9Lx4JLgO9m6vCu0EEeLX4tVHr7dH',
>  'HTTP_HOST': 'thisisnottherealdomain .com',
>  'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.3; WOW64)
> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',
>  'HTTP_X_FORWARDED_FOR': '##.###.###.###',
>  'HTTP_X_REAL_IP': '##.###.###.###',
>  'PATH': '/sbin:/usr/sbin:/bin:/usr/bin',
>  'PATH_INFO': u'/',
>  'PATH_TRANSLATED': 'redirect:/dispatch.fcgi/',
>  'QUERY_STRING': '',
>  'REDIRECT_STATUS': '200',
>  'REDIRECT_UNIQUE_ID': 'UxJiK0Fj7YUAAE6ava0N',
>  'REDIRECT_URL': '/',
>  'REMOTE_ADDR': '##.###.###.###',
>  'REMOTE_PORT': '39403',
>  'REQUEST_METHOD': 'GET',
>  'REQUEST_URI': '/',
>  'SCRIPT_FILENAME': '/home/somename/public_html/dispatch.fcgi',
>  'SCRIPT_NAME': u'',
>  'SERVER_ADDR': '###.##.##.###',
>  'SERVER_ADMIN': 'webmaster @ thisisnottherealdomain .com',
>  'SERVER_NAME': 'thisisnottherealdomain .com',
>  'SERVER_PORT': '80',
>  'SERVER_PROTOCOL': 'HTTP/1.0',
>  'SERVER_SIGNATURE': '',
>  'SERVER_SOFTWARE': 'Apache',
>  'UNIQUE_ID': 'UxJiK0Fj7YUAAE6ava0N',
>  'wsgi.errors':  0x7f0b2868bf50>,
>  'wsgi.input':  0x7f0b2868bf90>,
>  'wsgi.multiprocess': False,
>  'wsgi.multithread': True,
>  'wsgi.run_once': False,
>  'wsgi.url_scheme': 'http',
>  'wsgi.version': (1, 0)}>
>
> --
> 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/3afc2a85-5bf1-4170-ace2-bd789babdb33%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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/CAPMFOb5PJn_uLvVYrDyBiwQ0Y97CGtL4YnxM8DDyASRLxKHXKA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: memcached and redis

2014-03-01 Thread Andy McKay
On Sat, Mar 1, 2014 at 12:39 PM, Andreas Kuhne
wrote:

> The main difference is that you can use redis as a session cache for
> django (save the session objects to memory instead of the database), which
> I haven't found a solution for memcache yet.
>

Memcache works just fine as a session backend:

https://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-sessions

Andy

-- 
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/CAOjXX8aCOZXQcVkb%3Dfk%2BcJtgphAJdY%2BrUAC7aDVnMEDWFq2Vgg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Using inlines on a one to many but not seeing "add another" link

2014-03-01 Thread Dennis Marwood
Hello. 
Here are my models and admin.py  dpaste.de 
And here is the what I am referring to 
https://docs.djangoproject.com/en/1.6/intro/tutorial02/#customize-the-admin-form
But I my not seeing the link to add another. 

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/aaeed9f1-e499-4d09-b7c5-4ca087a4119b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django won't send 500 or 404 emails, but django.core.mail.EmailMessage and django.utils.log.AdminEmailHandler work

2014-03-01 Thread benjaoming
I've run into this issue twice... both times I spent hours and finally 
found the error and was in tears... especially the second time I did it :)

I've made custom view handlers in urls.py like these:

handler500 = 'myproject.views.server_error'
handler404 = 'myproject.views.page_not_found'

However, my 404 view extended the 500 and did not set a 404 response code 
on the response object.. thus, no 404 mails from the middleware.

Idiotic, but true :)

Benjamin

On Friday, January 4, 2013 2:46:37 PM UTC+1, nkryptic wrote:
>
> The 404 emails are sent via the mail_managers method, which uses emails 
> from the django.conf.settings.MANAGERS setting, as opposed to errors which 
> go to the ADMINS.  Double-check what MANAGERS (and ADMINS) is actually set 
> to:
>
> $ python manage.py shell
> >>> from django.conf import settings
> >>> settings.MANAGERS
> (('Me', 'm...@example.com '),)
> >>> settings.ADMINS
> (('Me', 'm...@example.com '),)
>
>
> On Thursday, January 3, 2013 8:14:54 PM UTC-5, Jan Paricka wrote:
>>
>> Same problem here.
>>
>> 1) CommonMiddleware in place
>>
>> 2) debug = False
>>
>> 3) SEND_BROKEN_LINK_EMAILS = True
>>
>> And yet no 404 emails...
>>
>> Otherwise the app is happily emailing...
>>
>> Any thoughts?
>>
>> Thanks
>>
>> Jan
>>
>>
>> On Friday, June 24, 2011 9:56:23 PM UTC+2, Kyle Gong wrote:
>>>
>>> For some reason, I can't get my server to send 500 or 404 emails.  I 
>>> am set up to send email through gmail, and it is working properly when 
>>> I send error emails through a logger set up using 
>>> django.utils.log.AdminEmailHandler, and also when I send mail using 
>>> django.core.mail.EmailMessage. 
>>>
>>> I have DEBUG = False and SEND_BROKEN_LINK_EMAILS = True. 
>>>
>>> The server is a linode running Ubuntu 10.04, Django 1.3 and Python 
>>> 2.6.5. 
>>>
>>> Any idea where I could look to track down the problem?
>>
>>

-- 
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/04ca5903-18cf-4f50-82b8-fc52eca55c6e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: memcached and redis

2014-03-01 Thread Russell Keith-Magee
On Sun, Mar 2, 2014 at 4:39 AM, Andreas Kuhne wrote:

> Ok,
>
> Redis and Memcache really solve the same problems.
>

Erm... no, they don't.

They are both in-memory stores, but that's where the similarities ends.

Memcache is a simple in-memory cache, and that's it. It's designed to
provide you an easy way to cache common but expensive operations - be that
template rendering, view construction, database retrieval operations, or
whatever. If an operation is slow to perform, performed frequently, and
changes much less frequently than the frequency with which it is called,
you can use memcache to insert the computed value into memory, and retrieve
it easily when it is next needed.

Values inserted into memcache are set with an expiry time -- so you can say
things like "the content of the homepage is cached for 5 minutes".

Memcache isn't stored anywhere permanent; if your memcache instance is
restarted, you lose everything stored in it. It is, by design a transient
data store.

Redis is a much more sophisticated data store than memcache.

At a superficial level, it can be used in the same way as memcache, but
with persistence (so if Redis restarts, you don't lose data). However, this
only scratches the surface of Redis' capabilities.

Redis has a whole lot of capabilities for handling sets of data, lists of
data, bitmaps, publish/subscribe operations, and much more. Check out the
Redis docs [1] if you want to get a feel for what you can do.

[1] http://redis.io/commands

So - don't fall into the trap of thinking Redis is "Memcache, but with
persistence". Yes, you could use it like this if you wanted to, but it's
not the right tool for that job.

Yours,
Russ Magee %-)

-- 
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/CAJxq84_DEOp85g8haUdkyVw11bNZq%3DZxZVB7ODheaEx5GWNAPw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Trouble with Django in production server.

2014-03-01 Thread Omar Acevedo
Hello people, I'm having an issue in/with Django, which is on a shared 
hosting, and I'm using virtualenv and fastcgi.  (<- saying this, just in 
case it helps in something)

I'm getting
"OperationalError at /admin/
no such table: auth_user"
after entering my credentials (username & pw) set when asked after running 
the syncdb.
Yes, I created a project (django-admin.py startproject the_project),  then 
ran python manage.py syncdb.
So it's supposed (which it says it does) to create the tables for the 
admin, but still, I'm getting that error when going to the admin through 
mydomain.com/admin.

I'm a first-timer hosting a django app, so, what else I'm supposed to know, 
to do?  

When I put Debug to False (DEBUG = False) inside the settings.py file and 
my email in the ADMINS tuple (inside settings.py) I do get this error 
message to my email. 
Which is (I'm posting it, to see if someone can tell me what's going on.):

 'HTTP_CONNECTION': 'close',
 'HTTP_COOKIE': 'csrftoken=Ds5T9Lx4JLgO9m6vCu0EEeLX4tVHr7dH',
 'HTTP_HOST': 'thisisnottherealdomain .com',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 
(KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',
 'HTTP_X_FORWARDED_FOR': '##.###.###.###',
 'HTTP_X_REAL_IP': '##.###.###.###',
 'PATH': '/sbin:/usr/sbin:/bin:/usr/bin',
 'PATH_INFO': u'/',
 'PATH_TRANSLATED': 'redirect:/dispatch.fcgi/',
 'QUERY_STRING': '',
 'REDIRECT_STATUS': '200',
 'REDIRECT_UNIQUE_ID': 'UxJiK0Fj7YUAAE6ava0N',
 'REDIRECT_URL': '/',
 'REMOTE_ADDR': '##.###.###.###',
 'REMOTE_PORT': '39403',
 'REQUEST_METHOD': 'GET',
 'REQUEST_URI': '/',
 'SCRIPT_FILENAME': '/home/somename/public_html/dispatch.fcgi',
 'SCRIPT_NAME': u'',
 'SERVER_ADDR': '###.##.##.###',
 'SERVER_ADMIN': 'webmaster @ thisisnottherealdomain .com',
 'SERVER_NAME': 'thisisnottherealdomain .com',
 'SERVER_PORT': '80',
 'SERVER_PROTOCOL': 'HTTP/1.0',
 'SERVER_SIGNATURE': '',
 'SERVER_SOFTWARE': 'Apache',
 'UNIQUE_ID': 'UxJiK0Fj7YUAAE6ava0N',
 'wsgi.errors': ,
 'wsgi.input': ,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}>

-- 
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/3afc2a85-5bf1-4170-ace2-bd789babdb33%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django and amazon web services

2014-03-01 Thread CLIFFORD ILKAY
On 03/01/2014 11:21 AM, Robin Lery wrote:
> Very nicely explained! I was actually hoping to use Amazon RDS  with
> postgresql. Your help was very useful. Thank you!

There is another issue if your application has to deal with user
uploaded files, such as photos, PDFs, etc. You must consider the
instances in an autoscaling cluster to be volatile because they can come
and go automatically. Consequently, you must have a way of ensuring that
either the filesystems of those instances are synchronized or store user
contributed files on Amazon S3. Fortunately, we have pluggable storage
in Django so it's easy to do the latter.

If you ever have to deploy an application that doesn't have that, as we
did, we ended up creating an NFS cluster in a VPC (Virtual Private
Cloud) and the instances in the autoscaling group mounted the exported
NFS filesystem. The autoscale instances had two network interfaces, one
for the public Internet and another for the internal network in the VPC,
so the NFS cluster was not exposed to the Internet.

-- 
Regards,

Clifford Ilkay

647-778-8696

Dinamis



-- 
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/53123CF0.9030005%40dinamis.com.
For more options, visit https://groups.google.com/groups/opt_out.


"No such table" error.

2014-03-01 Thread Omar Acevedo
Hello, I'm having an issue in/with Django, which is on a shared hosting, 
and I'm using virtualenv and fastcgi.  (<- saying this, just in case it 
helps in something)

I'm getting
"OperationalError at /admin/
no such table: auth_user" 
after entering my credentials (username & pw) that were set when asked 
after running the syncdb.
Yes, I created a project (django-admin.py startproject the_project),  then 
ran python manage.py syncdb.
So it's supposed (which it says it does) to create the tables for the 
admin, but still, I'm getting that error when going to the admin through 
mydomain.com/admin.

I'm a first-timer hosting a django app, so, what else I'm supposed to know, 
to do?  

-- 
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/9def0a08-c58f-4bff-9525-2892aff18b12%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: memcached and redis

2014-03-01 Thread Robin Lery
Ok, I think I get it now. Thank you so much! Just one more question though,
does redis has feature similar to *getidentifiable()* and *putifuntouched()
*like memcache, I think these are for consistency?


On Sun, Mar 2, 2014 at 2:09 AM, Andreas Kuhne wrote:

> Ok,
>
> Redis and Memcache really solve the same problems. The main difference is
> that you can use redis as a session cache for django (save the session
> objects to memory instead of the database), which I haven't found a
> solution for memcache yet. Also redis CAN be persisted (saved to disk), if
> you setup your own redis server.
>
> But otherwise, you can use both memcache and redis for your cache.
> Examples where a cache can be useful:
> 1. You want to do a complex database query that takes a long time to run,
> but doesn't update often. Just cache the results and use the result if it
> is present.
> 2. You can also cache the result of a view. If the view takes a long time
> to render AND is the same for all users, then cache the entire view result.
> 3. There is also the possibility to  create portions of a template and
> cache just those portions.
>
> Thats what I can think of off the top of my head. You can find more
> information about it here:
> https://docs.djangoproject.com/en/dev/topics/cache/
> http://memcached.org/
> http://redis.io/
>
> The main thing to remember is that both memcache and redis are in memory
> databases (key-value store) (even though redis can be persisted) and if the
> server is rebooted, then the cache is empty. Also being a in memory
> database means that getting information back from the key-value store is
> more or less instantanious especially if you compare to a standard sql
> database.
>
> Regards,
>
> Andréas
>
>
> 2014-03-01 21:27 GMT+01:00 Robin Lery :
>
>> Use cases with memcached and redis please.
>>
>>
>> On Sun, Mar 2, 2014 at 1:45 AM, Andreas Kuhne > > wrote:
>>
>>> Hi again,
>>>
>>> Do you mean use cases with redis and memcache or with S3?
>>>
>>> Regards,
>>>
>>> Andréas
>>>
>>> 2014-03-01 21:00 GMT+01:00 Robin Lery :
>>>
  Hello,
 Thank you for your answer. Would you please elaborate a little more
 about the use cases with these? And can I use them together?

 Thank you.


 On Sun, Mar 2, 2014 at 1:01 AM, Andreas Kuhne <
 andreas.ku...@suitopia.com> wrote:

> Hi,
>
> In response to your question about memcache and redis, they are
> extremely useful, if you use them correctly. For example if you are
> generating a query to your database that takes 1 second to finish, and you
> cache the results in memcache or redis, then you would be able to get the
> second request down to 50 ms instead. Thats the difference in response
> time. Redis and memcache are in memory databases and are extremely fast!
>
> Regarding your second question, if you need to store alot of pictures
> and videos, I would use Amazon S3 with the django storages backend for S3.
>
> Regards,
>
> Andréas
>
>
> 2014-03-01 17:28 GMT+01:00 Robin Lery :
>
>>  Hello,
>> Another noob question. Please bear with me. I am really very confused
>> between memcached and redis. I know they both are used for caching. But I
>> don't know how much does they help. And lastly, I would like know what
>> would you use for a site with users uploaded pictures and videos too? I
>> hope I was clear. If not please ask. Your help and guidance will be very
>> much appreciated.
>>
>> Thank you.
>> Robin.
>>
>> --
>> 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%2B4-nGqoYH24%2BSLzM8Jx3dN_xiPFYpZ90-gqfRNVpcWUEK%3DVsw%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> 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/CALXYUbmmkXRQE8m92S7NncYg4BN18VCbhVm13hgUbYrq1H5B%3Dw%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

  --
 You received this message because you are subscribed to the Goo

Re: memcached and redis

2014-03-01 Thread Andreas Kuhne
Ok,

Redis and Memcache really solve the same problems. The main difference is
that you can use redis as a session cache for django (save the session
objects to memory instead of the database), which I haven't found a
solution for memcache yet. Also redis CAN be persisted (saved to disk), if
you setup your own redis server.

But otherwise, you can use both memcache and redis for your cache. Examples
where a cache can be useful:
1. You want to do a complex database query that takes a long time to run,
but doesn't update often. Just cache the results and use the result if it
is present.
2. You can also cache the result of a view. If the view takes a long time
to render AND is the same for all users, then cache the entire view result.
3. There is also the possibility to  create portions of a template and
cache just those portions.

Thats what I can think of off the top of my head. You can find more
information about it here:
https://docs.djangoproject.com/en/dev/topics/cache/
http://memcached.org/
http://redis.io/

The main thing to remember is that both memcache and redis are in memory
databases (key-value store) (even though redis can be persisted) and if the
server is rebooted, then the cache is empty. Also being a in memory
database means that getting information back from the key-value store is
more or less instantanious especially if you compare to a standard sql
database.

Regards,

Andréas


2014-03-01 21:27 GMT+01:00 Robin Lery :

> Use cases with memcached and redis please.
>
>
> On Sun, Mar 2, 2014 at 1:45 AM, Andreas Kuhne 
> wrote:
>
>> Hi again,
>>
>> Do you mean use cases with redis and memcache or with S3?
>>
>> Regards,
>>
>> Andréas
>>
>> 2014-03-01 21:00 GMT+01:00 Robin Lery :
>>
>>>  Hello,
>>> Thank you for your answer. Would you please elaborate a little more
>>> about the use cases with these? And can I use them together?
>>>
>>> Thank you.
>>>
>>>
>>> On Sun, Mar 2, 2014 at 1:01 AM, Andreas Kuhne <
>>> andreas.ku...@suitopia.com> wrote:
>>>
 Hi,

 In response to your question about memcache and redis, they are
 extremely useful, if you use them correctly. For example if you are
 generating a query to your database that takes 1 second to finish, and you
 cache the results in memcache or redis, then you would be able to get the
 second request down to 50 ms instead. Thats the difference in response
 time. Redis and memcache are in memory databases and are extremely fast!

 Regarding your second question, if you need to store alot of pictures
 and videos, I would use Amazon S3 with the django storages backend for S3.

 Regards,

 Andréas


 2014-03-01 17:28 GMT+01:00 Robin Lery :

>  Hello,
> Another noob question. Please bear with me. I am really very confused
> between memcached and redis. I know they both are used for caching. But I
> don't know how much does they help. And lastly, I would like know what
> would you use for a site with users uploaded pictures and videos too? I
> hope I was clear. If not please ask. Your help and guidance will be very
> much appreciated.
>
> Thank you.
> Robin.
>
> --
> 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%2B4-nGqoYH24%2BSLzM8Jx3dN_xiPFYpZ90-gqfRNVpcWUEK%3DVsw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

  --
 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/CALXYUbmmkXRQE8m92S7NncYg4BN18VCbhVm13hgUbYrq1H5B%3Dw%40mail.gmail.com
 .

 For more options, visit https://groups.google.com/groups/opt_out.

>>>
>>>  --
>>> 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%

Re: memcached and redis

2014-03-01 Thread Robin Lery
Use cases with memcached and redis please.


On Sun, Mar 2, 2014 at 1:45 AM, Andreas Kuhne wrote:

> Hi again,
>
> Do you mean use cases with redis and memcache or with S3?
>
> Regards,
>
> Andréas
>
> 2014-03-01 21:00 GMT+01:00 Robin Lery :
>
>> Hello,
>> Thank you for your answer. Would you please elaborate a little more about
>> the use cases with these? And can I use them together?
>>
>> Thank you.
>>
>>
>> On Sun, Mar 2, 2014 at 1:01 AM, Andreas Kuhne > > wrote:
>>
>>> Hi,
>>>
>>> In response to your question about memcache and redis, they are
>>> extremely useful, if you use them correctly. For example if you are
>>> generating a query to your database that takes 1 second to finish, and you
>>> cache the results in memcache or redis, then you would be able to get the
>>> second request down to 50 ms instead. Thats the difference in response
>>> time. Redis and memcache are in memory databases and are extremely fast!
>>>
>>> Regarding your second question, if you need to store alot of pictures
>>> and videos, I would use Amazon S3 with the django storages backend for S3.
>>>
>>> Regards,
>>>
>>> Andréas
>>>
>>>
>>> 2014-03-01 17:28 GMT+01:00 Robin Lery :
>>>
  Hello,
 Another noob question. Please bear with me. I am really very confused
 between memcached and redis. I know they both are used for caching. But I
 don't know how much does they help. And lastly, I would like know what
 would you use for a site with users uploaded pictures and videos too? I
 hope I was clear. If not please ask. Your help and guidance will be very
 much appreciated.

 Thank you.
 Robin.

 --
 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%2B4-nGqoYH24%2BSLzM8Jx3dN_xiPFYpZ90-gqfRNVpcWUEK%3DVsw%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.

>>>
>>>  --
>>> 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/CALXYUbmmkXRQE8m92S7NncYg4BN18VCbhVm13hgUbYrq1H5B%3Dw%40mail.gmail.com
>>> .
>>>
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
>> 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%2B4-nGrHb_QH1YbXA4wOnW-nVJ-sVfTWfxUOxH%2Bvz%2BihxjC2XQ%40mail.gmail.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> 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/CALXYUbmBhXY%2BJcC2ghmL5%3DcEeMhjdnqj7XB3tWAacVxt99XBuw%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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%2B4-nGpmxLcJQignKqP%3DPK1h7V0n5-953mSF%3D%2Bd%3DE53w9P2xZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: memcached and redis

2014-03-01 Thread Robin Lery
Hello,
Thank you for your answer. Would you please elaborate a little more about
the use cases with these? And can I use them together?

Thank you.


On Sun, Mar 2, 2014 at 1:01 AM, Andreas Kuhne wrote:

> Hi,
>
> In response to your question about memcache and redis, they are extremely
> useful, if you use them correctly. For example if you are generating a
> query to your database that takes 1 second to finish, and you cache the
> results in memcache or redis, then you would be able to get the second
> request down to 50 ms instead. Thats the difference in response time. Redis
> and memcache are in memory databases and are extremely fast!
>
> Regarding your second question, if you need to store alot of pictures and
> videos, I would use Amazon S3 with the django storages backend for S3.
>
> Regards,
>
> Andréas
>
>
> 2014-03-01 17:28 GMT+01:00 Robin Lery :
>
>> Hello,
>> Another noob question. Please bear with me. I am really very confused
>> between memcached and redis. I know they both are used for caching. But I
>> don't know how much does they help. And lastly, I would like know what
>> would you use for a site with users uploaded pictures and videos too? I
>> hope I was clear. If not please ask. Your help and guidance will be very
>> much appreciated.
>>
>> Thank you.
>> Robin.
>>
>> --
>> 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%2B4-nGqoYH24%2BSLzM8Jx3dN_xiPFYpZ90-gqfRNVpcWUEK%3DVsw%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> 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/CALXYUbmmkXRQE8m92S7NncYg4BN18VCbhVm13hgUbYrq1H5B%3Dw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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%2B4-nGrHb_QH1YbXA4wOnW-nVJ-sVfTWfxUOxH%2Bvz%2BihxjC2XQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: memcached and redis

2014-03-01 Thread Andreas Kuhne
Hi,

In response to your question about memcache and redis, they are extremely
useful, if you use them correctly. For example if you are generating a
query to your database that takes 1 second to finish, and you cache the
results in memcache or redis, then you would be able to get the second
request down to 50 ms instead. Thats the difference in response time. Redis
and memcache are in memory databases and are extremely fast!

Regarding your second question, if you need to store alot of pictures and
videos, I would use Amazon S3 with the django storages backend for S3.

Regards,

Andréas


2014-03-01 17:28 GMT+01:00 Robin Lery :

> Hello,
> Another noob question. Please bear with me. I am really very confused
> between memcached and redis. I know they both are used for caching. But I
> don't know how much does they help. And lastly, I would like know what
> would you use for a site with users uploaded pictures and videos too? I
> hope I was clear. If not please ask. Your help and guidance will be very
> much appreciated.
>
> Thank you.
> Robin.
>
> --
> 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%2B4-nGqoYH24%2BSLzM8Jx3dN_xiPFYpZ90-gqfRNVpcWUEK%3DVsw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CALXYUbmmkXRQE8m92S7NncYg4BN18VCbhVm13hgUbYrq1H5B%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


memcached and redis

2014-03-01 Thread Robin Lery
Hello,
Another noob question. Please bear with me. I am really very confused
between memcached and redis. I know they both are used for caching. But I
don't know how much does they help. And lastly, I would like know what
would you use for a site with users uploaded pictures and videos too? I
hope I was clear. If not please ask. Your help and guidance will be very
much appreciated.

Thank you.
Robin.

-- 
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%2B4-nGqoYH24%2BSLzM8Jx3dN_xiPFYpZ90-gqfRNVpcWUEK%3DVsw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django and amazon web services

2014-03-01 Thread Robin Lery
Very nicely explained! I was actually hoping to use Amazon RDS  with
postgresql. Your help was very useful. Thank you!



On Sat, Mar 1, 2014 at 3:03 PM, Russell Keith-Magee  wrote:

> Hi Robin,
>
> In the simplest deployment case, your entire Django (or, for that matter,
> any other framework) website will run on a single server. That single
> server will contain the web server, the database, any files that have been
> uploaded, any any other services your site needs (such as memcache, a mail
> server, or anything else)
>
> Amazon EC2 is essentially selling you "a server". So, if you spool up a
> single EC2 instance, you could install all the bits you need to run your
> site on that single server.
>
> If you're using autoscale and elastic load balancer, what you're getting
> is the ability to spool up new web servers as traffic increases.
>
> However, when you move to having more than one server, you have a problem.
> What do you do with your database? No matter how many web servers you have,
> your application still needs to have a *single* database.
>
> Django's syncdb command is the step of creating the database schema (i.e.,
> the collection of tables) that your application will run. You should only
> be running it once for your application -- on the single database.
>
> If you're setting up load balancing and autoscaling for your web app, you
> have three options for your database.
>
> Firstly, you can set up a *separate* EC2 instance for your database. The
> idea here is that you would have multiple small EC2 instances serving web
> traffic (scaling up and down as required), but a single large EC2 instance
> running your database.
>
> Secondly, if you're looking for redundancy, you might set up *multiple*
> large EC2 instances for your database, and link them in a master-slave
> configuration. This provides some redundancy (in case one of the database
> servers goes down), and also provides some load balancing capability.
> Again, these instances are independent of your web server instances, and
> aren't affected by any load balancing behaviour.
>
> Thirdly, and probably the best option if you're looking to deploy on
> Amazon - use Amazon RDS. This is Amazon's autoscaling
> database-as-a-service. You create a database on RDS, and get charged for
> how much data you store, and how much you serve. Amazon worries about
> scaling, backup, and all the rest.
>
> In any of these three cases, you only run syncdb once -- you only ever
> have *one* User table, and you only need to run syncdb once to get it.
>
> I hope that clarifies things.
>
> Yours,
> Russ Magee %-)
>
> Hello.
>> I have a very basic noob question, which I don't know. Please help me
>> understand this concepts. When I use *ec2* for my application web
>> server, and if I use the services like *autoscale *and *elastic load
>> balancer*, do I always have to sync the database with the new *ec2*instances 
>> that are created? Or its not required? Your help and guidance
>> will be greatly appreciated.
>>
>> Thank you!
>> Robin
>>
>> --
>> 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%2B4-nGpSoxqr6ff5-D%2B-%2BGvLEADU8RW%3D%3DTSdepk9daWSY6zFNw%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> 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/CAJxq84_miF9N8r1e5gMC-Ee3dq0m-vwkc0%3DDzVv1Dt9%2BWFS7vQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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%2B4-nGrJmMhRiwoXYA4-XXE2_%3DRE_Tmuq5u%2B6SyfvHz5v%2B%2B%3D4A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to detect clear checkbox chequed on ClearableFileInput

2014-03-01 Thread Héctor Urbina
Hello,

I ended with this code:

if insumoForm.is_valid() and not insumoForm.cleaned_data["DELETE"]:
insumoRecurso = insumoForm.save(commit=False)
if not insumoRecurso.archivo.name:
  continue
insumoRecurso.recurso = recurso
insumoRecurso.save()


On Thursday, February 27, 2014 12:46:02 PM UTC-3, Héctor Urbina wrote:
>
> Hello,
>
> I have a edit view to modify an object. The model includes an inline 
> formset of insumoRecurso objects, for including files associated with the 
> main object. These files appear with a checkbox for clearing files 
> (ClearableFileInput widget). What should I test on my view to detect that 
> the checkbox has been selected?
>
> Here's the code of my view:
>
> @login_required
> def editarRecurso(request, recurso_id):
>   recurso = get_object_or_404(Recurso, pk=recurso_id)
>   objetos = {}
>   objetos["recurso"] = recurso
>   u = request.user
>   if recurso.creador != u and not (usuarioEsSupervisor(u) or 
> usuarioEsCoordinador(u)):
>   objetos["mensaje_de_error"] = "Usted no puede editar este recurso."
>   else:
> InsumoFormset = inlineformset_factory(Recurso, InsumoRecurso, extra=1)
> if request.method == 'POST':
>   recursoForm = RecursoForm(request.POST, instance=recurso)
>   insumoFormset = InsumoFormset(request.POST, request.FILES, instance 
> = recurso)
>   if recursoForm.is_valid():
> recurso = recursoForm.save(commit=False)
> recurso.save()
> notificarCreacionRecurso(request, recurso)
> for insumoForm in insumoFormset:
>   if insumoForm.is_valid():
> insumoRecurso = insumoForm.save(commit=False)
> if not insumoRecurso.archivo.name: #This is the way I found 
> for not saving objects that doesn't have an uploaded file (i.e., when user 
> doesn't choose a file to upload)!!! is there a better way?
>   continue
> ir = insumoRecurso.save()
> if insumoRecurso.archivo.remove: #This is not working, 
> "remove" attribute doesn't exist... but here is where I expect a way of 
> detecting clear checkbox selection. If there is no file, then the whole 
> insumoRecurso object must be deleted.
>   ir.delete()
> return redirect(reverse('recursos:detalle', args=(recurso.id,)))
>   else:
> objetos["recursoForm"] = recursoForm
> objetos["insumoFormset"] = insumoFormset
> else:
>   objetos["recursoForm"] = RecursoForm(instance=recurso)
>   objetos["recursoForm"].fields["curso"].queryset = 
> Curso.objects.filter(owner=request.user)
>   objetos["insumoFormset"] = InsumoFormset(instance=recurso)
>
>   template = loader.get_template('recursos/editarRecurso.html')
>   context = RequestContext(request, objetos)
>   return HttpResponse(template.render(context))
>
> I would appreciate any help, By the way, even though I check the clear 
> checkbox, the file is never deleted (I would assume that would happen on 
> insumoRecurso.save(), but the files always remain there)
>
> Thanks,
> Hector.
>

-- 
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/1beb3875-f09f-4dfd-adef-3dba14c65106%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Is there a complete pinax-based or similar starter project available?

2014-03-01 Thread Thomas Weholt
Is there a complete pinax-based (with all the pinax apps installed
including templates) or similar starter project available? I'm looking for
a starter project with social features similar to facebook and the
pinaxproject is the closest I've come so far.

Is pinax still in development? What is the current status of the project?
Are there other projects to base a social site on, similar to pinax?



-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.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/CACkDSm83s4HxhpapkZSnVoBVk0QEGLNC8Li1YOLykdMUW67h%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Bus Error on Development Server

2014-03-01 Thread François Schiettecatte
Looks like you have a bad disc drive too, sda is throwing IO errors.

François

On Feb 28, 2014, at 10:03 PM, Thomas Lockhart  wrote:

> On 2/28/14 6:16 PM, Gkpetrak wrote:
>> Hello,
>> 
>> I was trying to process Images with some python scripts, when I receive bus 
>> error. After that I had many bus errors on different programs.
>> Finally I tried to start django' development server, and I received the same 
>> error.
> The "after that I had many bus errors on different programs" is the clue that 
> perhaps your physical memory has a bad spot.
> 
> Your image processing might have used more physical memory than your typical 
> computer load uses, and ended up in a bad part of memory.
> 
> I would recommend running an intensive memory test (e.g. memtest86+) to 
> isolate which memory chip is at fault, and either yank it or replace it.
> 
> hth
> 
> - Tom
> 
>> I know that this error happens when a process is trying to access memory
>> that the CPU cannot physically address.
>> 
>> I checked my log files and the output of the error is the following:
>> 
>> 
>> T02:13:26.879355+02:00 suse-pc kernel: [ 9976.488797] ata1.00: exception 
>> Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
>> 
>> 
>> 2014-03-01T02:13:26.879402+02:00 suse-pc kernel: [ 9976.488806] ata1.00: 
>> irq_stat 0x4008
>> 
>> 
>> 2014-03-01T02:13:26.879413+02:00 suse-pc kernel: [ 9976.488813] ata1.00: 
>> failed command: READ FPDMA QUEUED
>> 
>> 
>> 2014-03-01T02:13:26.879419+02:00 suse-pc kernel: [ 
>> 9976.488826] ata1.00: cmd 60/08:00:50:8d:75/00:00:39:00:00/40 tag 0 ncq 
>> 4096 in
>> 
>> 
>> 2014-03-01T02:13:26.879428+02:00 suse-pc kernel: [ 
>> 9976.488826]  res 41/40:08:51:8d:75/00:00:39:00:00/00 Emask 
>> 0x409 (media 
>> error) 
>> 2014-03-01T02:13:26.879434+02:00 suse-pc kernel: [ 9976.488832] ata1.00: 
>> status: { DRDY ERR }
>> 
>> 
>> 2014-03-01T02:13:26.879437+02:00 suse-pc kernel: [ 9976.488836] ata1.00: 
>> error
>> : { UNC }
>> 
>> 
>> 2014-03-01T02:13:26.948294+02:00 suse-pc kernel: [ 9976.557999] ata1.00: 
>> configured for UDMA/133
>> 
>> 
>> 2014-03-01T02:13:26.948313+02:00 suse-pc kernel: [ 9976.558034] sd 0:0:0:0: 
>> [sda] Unhandled sense code
>> 
>> 
>> 2014-03-01T02:13:26.948315+02:00 suse-pc kernel: [ 9976.558040] sd 0:0:0:0: 
>> [sda]  
>> 
>> 
>> 2014-03-01T02:13:26.948316+02:00 suse-pc kernel: [ 9976.558044] Result: 
>> hostbyte=DID_OK driverbyte=DRIVER_SENSE
>> 
>> 
>> 2014-03-01T02:13:26.948317+02:00 suse-pc kernel: [ 9976.558048] sd 0:0:0:0: 
>> [sda]  
>> 
>> 
>> 2014-03-01T02:13:26.948318+02:00 suse-pc kernel: [ 9976.558052] Sense Key : 
>> Medium Error
>>  [current] [descriptor]
>> 
>> 
>> 2014-03-01T02:13:26.948320+02:00 suse-pc kernel: [ 9976.558059] Descriptor 
>> sense data with sense descriptors (in hex):
>> 
>> 
>> 2014-03-01T02:13:26.948321+02:00 suse-pc kernel: [ 9976.558062] 72 
>> 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
>> 
>> 
>> 2014-03-01T02:13:26.948321+02:00 suse-pc kernel: [ 9976.558081] 39 
>> 75 8d 51
>> 
>> 
>> 2014-03-01T02:13:26.948335+02:00 suse-pc kernel: [ 9976.558090] sd 0:0:0:0: 
>> [sda]  
>> 
>> 
>> 2014-03-01T02:13:26.948338+02:00 suse-pc kernel: [ 9976.558095] Add. Sense: 
>> Unrecovered read error
>>  - auto reallocate failed
>> 
>> 
>> 2014-03-01T02:13:26.948339+02:00 suse-pc kernel: [ 9976.558099] sd 0:0:0:0: 
>> [sda] CDB:
>> 
>> 
>> 2014-03-01T02:13:26.948340+02:00 suse-pc kernel: [ 9976.558102] Read(10): 28 
>> 00 39 75 8d 50 00 00 08 00
>> 
>> 
>> 2014-03-01T02:13:26.948341+02:00 suse-pc kernel: [ 9976.558119] end_request: 
>> I/O error
>> , dev sda, sector 964005201
>> 
>> 
>> 2014-03-01T02:13:26.948342+02:00 suse-pc kernel: [ 9976.558207] ata1: EH 
>> complete
>> 
>> 
>> 
>> 
>> 
>> Any ideas ? 
>> 
>> How can I fix it ?
>> 
>> Regards,
>> George 
>> 
>> 
>> -- 
>> 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/33d3ed3a-fd7a-49a4-a897-b0a80ee7c77e%40googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> -- 
> 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/53114E0B.2090606%40gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.



s

Re: Template/Form Errors and DynaTree.js

2014-03-01 Thread Timothy W. Cook
Still not there yet.  There is something I am not understanding about
capturing the response back from the server.   It still opens the template
as an HTML page and not inside the div.  Is it possibly how I am using the
HTTPResponse?  Since I am not modifying it at all.


*View:*
class DvBooleanCreateView(CreateView):
template_name = 'dvboolean_create.html'
success_url = '/dashboard'
model = DvBoolean
fields =
['prj_name','data_name','lang','valid_trues','valid_falses','description','sem_attr','resource_uri','asserts',]
form_class = DvBooleanCreateForm

*Form:*
class DvBooleanCreateForm(forms.ModelForm):
class Meta:
model = DvBoolean
localized_fields = ('__all__',)
fields =
['prj_name','data_name','lang','valid_trues','valid_falses','description','sem_attr','resource_uri','asserts',]

widgets = {
'data_name': TextInput(attrs={'size':90}),
'description': Textarea(attrs={'cols':80,
'rows':5,'wrap':'off'}),
'sem_attr': Textarea(attrs={'cols':15,
'rows':3,'wrap':'off'}),
'resource_uri': Textarea(attrs={'cols':60,
'rows':3,'wrap':'off'}),
'asserts': Textarea(attrs={'cols':80,
'rows':2,'wrap':'off'}),
'valid_trues': Textarea(attrs={'cols':20,
'rows':5,'wrap':'off'}),
'valid_falses': Textarea(attrs={'cols':20,
'rows':5,'wrap':'off'}),

   }



*Template:*


  $(document).ready(function($){
  $('#editbox').perfectScrollbar('update');
  });




$( "pct_form" ).submit(function( event ) {
$.ajax({
type: 'POST',
url: $('pct_form').attr('action'),
dataType: 'html',
data: $form.serialize(),
success: function(data){
$("#editbox").html(data);
},
error: function(xhr, textStatus, errorThrown) {
console.log('AJAX communication failed:', textStatus,
errorThrown);
}
})});


Create a new Boolean
Type.  * = input is required.
  
   {% csrf_token %}

  
  *Project: {{ form.prj_name }}
  *PcT
Name: {{ form.data_name }}
  
  
  *PcT
Language: {{ form.lang }} 
  *Description: {{ form.description }}
  
  
   Semantics
   AttributeURI
   {{ form.sem_attr
}}{{ form.resource_uri
}}
 

  
  Asserts:{{ form.asserts }}
  

  

 
   Boolean Sets
   TruesFalses
   {{ form.valid_trues
}}{{ form.valid_falses
}}
 
  
  

  








On Fri, Feb 28, 2014 at 12:36 PM, Andreas Kuhne
wrote:

> Hi Timothy,
>
> What you could do is create a function that gets the id of the form. It
> can then query the action of the form and the parameters of the form. It
> would look something like this:
>
> function submitForm(form_id) {
> var $form = $("#" + form_id);
>
> $.ajax({
> type: 'POST',
> url: $form.attr('action'),
>  dataType: 'html', data: $form.serialize(), success: function(data){
> $("#old_div_content").html(data); }, error: function(xhr, textStatus,
> errorThrown) { console.log('AJAX communication failed:',
> textStatus, errorThrown); } });
> }
>
> This way it is pretty generic as long as the "old_div_content" div id
> stays the same.
>
> Regards,
>
> Andréas
>
>
>
> Med vänliga hälsningar,
>
> Andréas Kühne
> Software Development Manager
> Suitopia Scandinavia AB
>
>
> 2014-02-28 15:48 GMT+01:00 Timothy W. Cook :
>
>>
>> On Thu, Feb 27, 2014 at 10:18 AM, Andreas Kuhne <
>> andreas.ku...@suitopia.com> wrote:
>>
>>> Hi again Timothy,
>>>
>>> Actually it's much easier than you think.
>>>
>>
>>
>> Great news!  :-)
>>
>>
>>>
>>> The error you showed is a validation error, is it not?
>>>
>>>
>> Yes.
>>
>>
>> In the example that you gave (below) it seems that I will need an AJAX
>> function for each different form.  Correct?
>>  IOW:
>> There are 25 different forms/views/models that can be selected, one at a
>> time, for create or update in this div.  So, do I understand correctly that
>> I need a function with the correct URL and data map for each one of those?
>>  If so, what is the approach to calling the one the user has selected?  My
>> urks are named, for example: dvtemporal_create and dvtemporal_update.  Of
>> course the _update has the record id as well.
>>
>> There is a lot of information in the Django request so I want to be able
>> to reuse this with an 'abstract as possible' ajax function.
>>
>> Thoughts?
>>
>> --Tim
>>
>>
>>
>>> What you do is that you submit the form via jquery ajax, something like
>>> this should work:
>>>
>>>   $.ajax({ type: 'POST', url: the_form_url, dataType: 'html', data: {
>>> email : $('#id_email').val(), name : $('#id_name').val(), phone :
>>> $('#id_phone').val() }, success: function(data){
>>> $("#old_div_content").html(data); }, error: function(xhr, textStatus,
>>> errorThrown) { console.log('AJAX communication failed:',
>>> textStatus, errorThrown); } });
>>>
>>> Now you will have to change the function so that the parameters sent 

Re: django and amazon web services

2014-03-01 Thread Russell Keith-Magee
Hi Robin,

In the simplest deployment case, your entire Django (or, for that matter,
any other framework) website will run on a single server. That single
server will contain the web server, the database, any files that have been
uploaded, any any other services your site needs (such as memcache, a mail
server, or anything else)

Amazon EC2 is essentially selling you "a server". So, if you spool up a
single EC2 instance, you could install all the bits you need to run your
site on that single server.

If you're using autoscale and elastic load balancer, what you're getting is
the ability to spool up new web servers as traffic increases.

However, when you move to having more than one server, you have a problem.
What do you do with your database? No matter how many web servers you have,
your application still needs to have a *single* database.

Django's syncdb command is the step of creating the database schema (i.e.,
the collection of tables) that your application will run. You should only
be running it once for your application -- on the single database.

If you're setting up load balancing and autoscaling for your web app, you
have three options for your database.

Firstly, you can set up a *separate* EC2 instance for your database. The
idea here is that you would have multiple small EC2 instances serving web
traffic (scaling up and down as required), but a single large EC2 instance
running your database.

Secondly, if you're looking for redundancy, you might set up *multiple*
large EC2 instances for your database, and link them in a master-slave
configuration. This provides some redundancy (in case one of the database
servers goes down), and also provides some load balancing capability.
Again, these instances are independent of your web server instances, and
aren't affected by any load balancing behaviour.

Thirdly, and probably the best option if you're looking to deploy on Amazon
- use Amazon RDS. This is Amazon's autoscaling database-as-a-service. You
create a database on RDS, and get charged for how much data you store, and
how much you serve. Amazon worries about scaling, backup, and all the rest.

In any of these three cases, you only run syncdb once -- you only ever have
*one* User table, and you only need to run syncdb once to get it.

I hope that clarifies things.

Yours,
Russ Magee %-)

Hello.
> I have a very basic noob question, which I don't know. Please help me
> understand this concepts. When I use *ec2* for my application web server,
> and if I use the services like *autoscale *and *elastic load balancer*,
> do I always have to sync the database with the new *ec2* instances that
> are created? Or its not required? Your help and guidance will be greatly
> appreciated.
>
> Thank you!
> Robin
>
> --
> 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%2B4-nGpSoxqr6ff5-D%2B-%2BGvLEADU8RW%3D%3DTSdepk9daWSY6zFNw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAJxq84_miF9N8r1e5gMC-Ee3dq0m-vwkc0%3DDzVv1Dt9%2BWFS7vQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


django and amazon web services

2014-03-01 Thread Robin Lery
Hello.
I have a very basic noob question, which I don't know. Please help me
understand this concepts. When I use *ec2* for my application web server,
and if I use the services like *autoscale *and *elastic load balancer*, do
I always have to sync the database with the new *ec2* instances that are
created? Or its not required? Your help and guidance will be greatly
appreciated.

Thank you!
Robin

-- 
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%2B4-nGpSoxqr6ff5-D%2B-%2BGvLEADU8RW%3D%3DTSdepk9daWSY6zFNw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.