Re: Greyed out models in Django Admin

2013-08-15 Thread huw_at1
Hi,

I still have this issue and can't really figure out what the problem is. I 
have found that if I turn on DEBUG then the apps models become active again 
such that I can add new records via the admin interface. However when 
turning off DEBUG they become inactive and greyed out again.

I have tried altering the order in which my apps are loaded and also 
altered the permissions on the applications folder however nothing seems to 
solve this.

Sorry for the BUMP but does anyone have any further info on this?

Many thanks

Huw Jones

On Thursday, 31 January 2013 22:56:05 UTC, huw_at1 wrote:
>
> Hi,
>
> Using Django 1.4, have registered 3 model classes with admin. When 
> accessing admin page provided by test server can select each class and edit 
> entries. However when accessing production admin the classes are greyed 
> out, only the users, groups and sites are selectable. I thought this might 
> be database access issues however I can run syncdb without any problems. 
> Any ideas?
>
> Many thanks
>
> Huw Jones.
>

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


Re: django-popup-forms

2013-08-15 Thread Brian Millham
That's the only info I've been able to find on it. I did dig deeper, and 
finally made some progress. To my dismay, I found that django-popup-forms 
seems to require jquery. I'm trying to avoid jquery if at all possible. I 
planed on using HTML5/CSS3 instead, as I think I can get it do do all that 
I'm looking for.

I'll look at modifying django-popup-forms to use HTML5.

As to my original complaint about documentation, the site you linked does 
not tell you important things. I had to look at the test pages to figure 
most of it out. And there is no example showing what the view should look 
like that calls the page containing the popup link.


On Thursday, August 15, 2013 1:37:27 AM UTC-4, Timothy Makobu wrote:
>
> Reading this https://github.com/joinourtalents/django-popup-forms It does 
> show how to set it up. Where are you getting stuck?
>
>
> On Thu, Aug 15, 2013 at 2:41 AM, Brian Millham  > wrote:
>
>> I've been trying to use django-popup-forms, but with no success. Has 
>> anyone used this? 
>>
>> I suspect that I didn't install it correctly. I just ran sudo python 
>> setup.py install, but it doesn't seem available under django.
>>
>> It looks like a nice package, and will do exactly what I'm looking for. 
>> It's a shame that the documentation with it doesn't show how to properly 
>> install it, and has no working examples with it.
>>
>> Brian
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> 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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Is Django FrontEnd Skeleton easy to use and integrate ?

2013-08-15 Thread Jose Galvan
Rafael,

En realidad me falta ver la funcionalidad del Admin, suena bien tu consejo, 
creo que empezaré por estudiar más esta parte, la pondré en práctica, de hecho, 
los sistemas que desarrollo son para aplicaciones de Bases de Datos, así que el 
Admin se ajusta bien, solo tendría que estudiar más sobre Jquery, ajax, etc. 
para hacer pantallas más interactivas. 

Gracias. !

José

- Original Message - 
  From: Rafael E. Ferrero 
  To: django-users@googlegroups.com 
  Sent: Thursday, August 15, 2013 3:40 PM
  Subject: Re: Is Django FrontEnd Skeleton easy to use and integrate ?


  José podes reducir considerablemente el tiempo de desarrollo de tu front end 
usando los templates de Django (django te permite usar otros lenguajes de 
templates también). Vos creas un template base con toda la programación que 
tenes que repetir en cada html estático (las librerías javascript, diseños css, 
etc) y despues podes crear templates que hereden de esta base poniendo los 
controles específicos a la vista que quieras mostrar (no necesariamente tenes 
que hacer un template por cada vista).

  Podes usar Bootstrap si queres... ahora... todo esto si es que lo queres 
tener sumamente personalizado sino el Django Admin es sumamente poderoso (ni 
que hablar de lo rápido que tendrás una interfaz de gestión de tu modelo) y vi 
por ahí  también que hay un proyecto que lo hacen sumamente atractivo 
visualmente al Django Admin. (http://grappelliproject.com/)





  2013/8/15 Jose Galvan 

Hi,

I am newbie in Django..I already followed the Django's official tutorial 
but it does not cover enough about front end side, my doubt is if "Django front 
end skeleton"  is suitable to help me and save time in the process to learn all 
concerning with the front end programming side ?, just an example, I would like 
to learn how to make a real life order entry system with a very user friendly 
and interactive screens...go I in the right direction ?  any other advice will 
be greatly apreciated.  

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




  -- 
  Rafael E. Ferrero
  Claro: (03562) 15514856 

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


Re: Usage of django-model-utils TimeFramedModel manager

2013-08-15 Thread Bill Freeman
Maybe:

   Event.objects.filter(start=X, end=Y)

Just guessing.


On Thu, Aug 15, 2013 at 1:05 PM, Ogre  wrote:

> Hi all,
>
> I've a model defined as thus:
>
> from model_utils.models import TimeFramedModel
>
> class Event(TimeFramedModel):
> title=models.CharField(max_length=100)
> ...
>
> The 
> docsare
>  a bit slim on the ground for this one, but how do you use the added
> "timeframed" 
> manager
> ?
>
> I've tried Event.timeframed.filter(start=X, end=Y) but to no avail. Any
> help?
>
> Cheers.
>
> --
> 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Is Django FrontEnd Skeleton easy to use and integrate ?

2013-08-15 Thread Rafael E. Ferrero
José podes reducir considerablemente el tiempo de desarrollo de tu front
end usando los templates de Django (django te permite usar otros lenguajes
de templates también). Vos creas un template base con toda la programación
que tenes que repetir en cada html estático (las librerías javascript,
diseños css, etc) y despues podes crear templates que hereden de esta base
poniendo los controles específicos a la vista que quieras mostrar (no
necesariamente tenes que hacer un template por cada vista).
Podes usar Bootstrap si queres... ahora... todo esto si es que lo queres
tener sumamente personalizado sino el Django Admin es sumamente poderoso
(ni que hablar de lo rápido que tendrás una interfaz de gestión de tu
modelo) y vi por ahí  también que hay un proyecto que lo hacen sumamente
atractivo visualmente al Django Admin. (http://grappelliproject.com/)



2013/8/15 Jose Galvan 

> Hi,
>
> I am newbie in Django..I already followed the Django's official tutorial
> but it does not cover enough about front end side, my doubt is if "Django
> front end skeleton"  is suitable to help me and save time in the process to
> learn all concerning with the front end programming side ?, just an
> example, I would like to learn how to make a real life order entry system
> with a very user friendly and interactive screens...go I in the right
> direction ?  any other advice will be greatly apreciated.
>
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Rafael E. Ferrero
Claro: (03562) 15514856

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


Re: How do you use dbshell ALTER TABLE correctly?

2013-08-15 Thread Pepsodent Cola
When I try the entire thing I get the below error message.  What am I doing 
wrong?

sqlite> ALTER TABLE navi_polls_altword ADD COLUMN "wordy2_id" integer NOT 
NULL PRIMARY KEY REFERENCES "navi_polls_word" ("id") DEFAULT '';
Error: Cannot add a PRIMARY KEY column




On Thursday, August 15, 2013 10:30:01 PM UTC+2, Pepsodent Cola wrote:
>
> I found this example on a Stack Overflow webpage.  But I'm not sure if I did 
> things correctly?
>
>
> $ python manage.py dbshell> ALTER TABLE  ADD COLUMN 
>  DEFAULT '';
>
>
>
> $ python manage.py sqlall navi_polls
>
> CREATE TABLE "navi_polls_altword" (
> "rosword_id" integer NOT NULL REFERENCES "navi_polls_word" ("id"),
> "wordy_id" integer NOT NULL PRIMARY KEY REFERENCES 
> "navi_polls_word" ("id"),
> );
>
>
>
> Is this the correct syntax?  Because things at admin page doesn't behave 
> 100% normal.
>
> sqlite> ALTER TABLE navi_polls_altword ADD COLUMN "wordy_id" integer NOT 
> NULL DEFAULT '';
>
>

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


How do you use dbshell ALTER TABLE correctly?

2013-08-15 Thread Pepsodent Cola


I found this example on a Stack Overflow webpage.  But I'm not sure if I did 
things correctly?


$ python manage.py dbshell> ALTER TABLE  ADD COLUMN 
 DEFAULT '';



$ python manage.py sqlall navi_polls

CREATE TABLE "navi_polls_altword" (
"rosword_id" integer NOT NULL REFERENCES "navi_polls_word" ("id"),
"wordy_id" integer NOT NULL PRIMARY KEY REFERENCES 
"navi_polls_word" ("id"),
);



Is this the correct syntax?  Because things at admin page doesn't behave 
100% normal.

sqlite> ALTER TABLE navi_polls_altword ADD COLUMN "wordy_id" integer NOT 
NULL DEFAULT '';

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


Is Django FrontEnd Skeleton easy to use and integrate ?

2013-08-15 Thread Jose Galvan
Hi,

I am newbie in Django..I already followed the Django's official tutorial 
but it does not cover enough about front end side, my doubt is if "Django 
front end skeleton"  is suitable to help me and save time in the process to 
learn all concerning with the front end programming side ?, just an 
example, I would like to learn how to make a real life order entry system 
with a very user friendly and interactive screens...go I in the right 
direction ?  any other advice will be greatly apreciated.  

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


Re: is it possible to use REST API with HTML within Django?

2013-08-15 Thread Kelvin Wong
To make calls to remote http-enabled servers, use Requests within your 
view. The results can be passed to the template in the standard way.

http://docs.python-requests.org/en/latest/

K



On Thursday, August 15, 2013 9:27:26 AM UTC-7, evh wrote:
>
> Hi,
>
> I am having trouble getting REST to work within Django.  Has anyone 
> succeeded in doing this?  How do I embed REST API calls within the HTML 
> that runs my webpage?  I am trying to send "commands" to a device that is 
> connected to my webpage and can do this outside of Django manually in a 
> PowerShell window, but just within my HTML code.
>
> Thanks for any help or advice,
> Ed
>
>

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


django-cms like model translation

2013-08-15 Thread Avraham Serour
Hi,

I'm making a site using django-cms with an app hook for django shop
this is a multilanguage site, so in settings.py I have

LANGUAGES = [
('pt-br', 'Portuguese'),
('en', 'English'),

]

so when adding a page, I have two tabs, one version of the page for each
language
I need to have translations for my product model also, I only found
this,
but this approach have two problems:
I am repeating myself on which languages I want, for each I add/remove I
need to migrate, this should work like the cms pagemodel
and a minor problem of inconvenience of the user of the admin page, it
would be nice to have the same interface (tab for each language)

I took a look at pagemodel.py but I failed to actually understand in order
to repeat, maybe I didn't have enough coffee

any thoughts?

thanks
avraham

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


Fwd: Django url error

2013-08-15 Thread Satinderpal Singh
I started new app on django, and configure http.conf file as :

WSGIScriptAlias /lret /home/goraya/lret/lret/apache/django.wsgi

Order allow,deny
Allow from all


and django.wsgi as:

import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = 'lret.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
sys.path.append('/home/goraya/')

But got the error:
The requested URL /lret was not found on this server.

 please check where i am going wrong?

-- 
Satinderpal Singh

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


Usage of django-model-utils TimeFramedModel manager

2013-08-15 Thread Ogre
Hi all,

I've a model defined as thus:

from model_utils.models import TimeFramedModel

class Event(TimeFramedModel):
title=models.CharField(max_length=100)
...

The 
docsare
 a bit slim on the ground for this one, but how do you use the added 
"timeframed" 
manager
?

I've tried Event.timeframed.filter(start=X, end=Y) but to no avail. Any 
help?

Cheers.

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


Re: is it possible to use REST API with HTML within Django?

2013-08-15 Thread evh
I am not too concerned about anything being returned (JSON or otherwise), 
it is just getting the command to the device.  So for example, I have a DVR 
connected to my webserver, the following is the REST API call:


def play(self):
"""
Convenience method to start playback.
"""
self.sendTransportCommandByDescription("Play Command")


which should simply start the DVR playback.


On Thursday, August 15, 2013 12:45:01 PM UTC-4, BFSchott wrote:
>
> You need to provide a lot more information before anyone can help.  
>
> Sound like you have at least a view handling GET or POST returning JSON?
>
> https://docs.djangoproject.com/en/1.5/topics/class-based-views/mixins/#jsonresponsemixin-example
> http://django-rest-framework.org
>
> If you are talking about calling AJAX from inside the browser, I recommend 
> you check out:
> http://www.dajaxproject.com
>
> There are other tools, but it makes life easier.
>
> Brian Schott
> bfsc...@gmail.com 
>
>
>  
> On Aug 15, 2013, at 12:27 PM, evh  wrote:
>
> Hi,
>
> I am having trouble getting REST to work within Django.  Has anyone 
> succeeded in doing this?  How do I embed REST API calls within the HTML 
> that runs my webpage?  I am trying to send "commands" to a device that is 
> connected to my webpage and can do this outside of Django manually in a 
> PowerShell window, but just within my HTML code.
>
> Thanks for any help or advice,
> Ed
>
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/django-users.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django install existing project

2013-08-15 Thread Gerd Koetje
one of the errors i encounter when i just copy the project is:

_mysql_exceptions.OperationalError: (1193, "Unknown system variable 
'innodb_strict_mode'")

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


Re: is it possible to use REST API with HTML within Django?

2013-08-15 Thread Brian Schott
You need to provide a lot more information before anyone can help.  

Sound like you have at least a view handling GET or POST returning JSON?
https://docs.djangoproject.com/en/1.5/topics/class-based-views/mixins/#jsonresponsemixin-example
http://django-rest-framework.org

If you are talking about calling AJAX from inside the browser, I recommend you 
check out:
http://www.dajaxproject.com

There are other tools, but it makes life easier.

Brian Schott
bfsch...@gmail.com



On Aug 15, 2013, at 12:27 PM, evh  wrote:

> Hi,
> 
> I am having trouble getting REST to work within Django.  Has anyone succeeded 
> in doing this?  How do I embed REST API calls within the HTML that runs my 
> webpage?  I am trying to send "commands" to a device that is connected to my 
> webpage and can do this outside of Django manually in a PowerShell window, 
> but just within my HTML code.
> 
> Thanks for any help or advice,
> Ed
> 
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Django install existing project

2013-08-15 Thread Gerd Koetje
anyone willing to install it to see what i am doing wrong?
i tried to copy the contents but that gives me all sorts of errors

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


Re: Django install existing project

2013-08-15 Thread Gerd Koetje
anyone willing to install it to see what i am doing wrong?
i tried to copy the contents but that gives me all sorts of errors

Op donderdag 15 augustus 2013 17:02:57 UTC+2 schreef Gerd Koetje:
>
> Hi,
>
> Im fairly new to django and trying to install a existing project
> https://github.com/ossobv/pstore
>
> Im kinda stuck on how to install this
> i tried pip install django-pstore and it installs something but when i 
> check the directory i dont see an pstore website directory
> i do find it in the site-packages
>
> im kinda confused how to get this properly installed
> anyone care to help me out a bit?
>

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


Re: Django install existing project

2013-08-15 Thread Bill Freeman
Normally pip install will put it in your site-packages directory.  Try
starting python, then:

>>> import django
>>> django

That should mention a file path that will tell you where things get
installed.

If the project isn't set up to run that way (for example, if you need to
customize settings.py or urls.py), then probably better than installing it
is just unpacking it where you need it.  You should be able to get github
to give you a zip file.

Bill


On Thu, Aug 15, 2013 at 11:02 AM, Gerd Koetje
wrote:

> Hi,
>
> Im fairly new to django and trying to install a existing project
> https://github.com/ossobv/pstore
>
> Im kinda stuck on how to install this
> i tried pip install django-pstore and it installs something but when i
> check the directory i dont see an pstore website directory
> i do find it in the site-packages
>
> im kinda confused how to get this properly installed
> anyone care to help me out a bit?
>
> --
> 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.


is it possible to use REST API with HTML within Django?

2013-08-15 Thread evh
Hi,

I am having trouble getting REST to work within Django.  Has anyone 
succeeded in doing this?  How do I embed REST API calls within the HTML 
that runs my webpage?  I am trying to send "commands" to a device that is 
connected to my webpage and can do this outside of Django manually in a 
PowerShell window, but just within my HTML code.

Thanks for any help or advice,
Ed

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


Django install existing project

2013-08-15 Thread Gerd Koetje
Hi,

Im fairly new to django and trying to install a existing project
https://github.com/ossobv/pstore

Im kinda stuck on how to install this
i tried pip install django-pstore and it installs something but when i 
check the directory i dont see an pstore website directory
i do find it in the site-packages

im kinda confused how to get this properly installed
anyone care to help me out a bit?

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


Re: django ajax jquery

2013-08-15 Thread carlos
Hi
maybe you need find in google.com for example


http://fromzerotocodehero.blogspot.com/2011/01/django-ajax-tutorial-part-1.html

I think there are more tutorials

Cheers,


On Thu, Aug 15, 2013 at 6:09 AM, Scheck Nyori  wrote:

> Hello!
> I am a noob in web development. Just finished polls tuts. Can anyone give
> me any insight in using jquery and ajax with django! If possible any
> tutorial. Any help will be appreciated!
> Thank you.
>
> --
> 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Want solution for CSRF problem in django please........

2013-08-15 Thread JAI PRAKASH SINGH
Thanking you sir .
I  paste  {% csrf_token %}  after form tag  in my contact_form.html

and it worked!!
thank you lot


On Thu, Aug 15, 2013 at 6:50 PM, Jonathan Baker <
jonathandavidba...@gmail.com> wrote:

> The bullet points in the error message provide some possible solutions.
> I'd start by adding {% csrf_token %} after your opening  tag in the
> template. Also of note though is that you've imported 'csrf' and
> 'RequestContext' in your view but you don't appear to be using them
> anywhere (at least not in the views code snippet you provided here).
>
>
> On Thu, Aug 15, 2013 at 7:16 AM, JAI PRAKASH SINGH <
> jaiprakashsingh...@gmail.com> wrote:
>
>> code in views.py
>>
>> =
>>
>> from django.http import HttpResponseRedirect
>> from django.core.mail import send_mail
>>
>>
>> def contact1(request):
>> errors = []
>> if request.method == 'POST':
>> if not request.POST.get('subject', ''):
>> errors.append('Enter a subject.')
>> if not request.POST.get('message', ''):
>> errors.append('Enter a message.')
>> if request.POST.get('email') and '@' not in request.POST['email']:
>> errors.append('Enter a valid e-mail address.')
>> if not errors:
>> send_mail(
>> request.POST['subject'],
>> request.POST['message'],
>> request.POST.get('email', 'nore...@example.com'),
>> ['siteow...@example.com'],
>> )
>> return HttpResponseRedirect('/contact/thanks/')
>> return render(request, 'contact_form.html',{'errors': errors})
>>
>>
>> ===
>> code in contact_form.html
>> =
>> 
>> 
>> Contact us
>> 
>> 
>> Contact us
>>
>> {% if errors %}
>> 
>> {% for error in errors %}
>> {{ error }}
>> {% endfor %}
>> 
>> {% endif %}
>>
>> {% csrf_token %}
>> Subject: 
>> Your e-mail (optional): 
>> Message: > cols="50">
>> 
>> 
>> 
>> 
>>
>>
>>
>>
>> =
>> error
>>
>> Forbidden (403)
>>
>> CSRF verification failed. Request aborted.
>>  Help
>>
>> Reason given for failure:
>>
>> CSRF cookie not set.
>>
>>
>> In general, this can occur when there is a genuine Cross Site Request
>> Forgery, or when Django's CSRF 
>> mechanismhas
>>  not been used correctly. For POST forms, you need to ensure:
>>
>>- Your browser is accepting cookies.
>>- The view function uses 
>> RequestContextfor
>>  the template, instead of
>>Context.
>>- In the template, there is a {% csrf_token %} template tag inside
>>each POST form that targets an internal URL.
>>- If you are not using CsrfViewMiddleware, then you must use
>>csrf_protect on any views that use the csrf_token template tag, as
>>well as those that accept the POST data.
>>
>> You're seeing the help section of this page because you have DEBUG = Truein 
>> your Django settings file. Change that to
>> False, and only the initial error message will be displayed.
>>
>> You can customize this page using the CSRF_FAILURE_VIEW setting.
>>
>>  --
>> 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.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> Jonathan D. Baker
> Developer
> http://jonathandbaker.com
>
> --
> 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/NqLEzga6HoY/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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Want solution for CSRF problem in django please........

2013-08-15 Thread Jonathan Baker
The bullet points in the error message provide some possible solutions. I'd
start by adding {% csrf_token %} after your opening  tag in the
template. Also of note though is that you've imported 'csrf' and
'RequestContext' in your view but you don't appear to be using them
anywhere (at least not in the views code snippet you provided here).


On Thu, Aug 15, 2013 at 7:16 AM, JAI PRAKASH SINGH <
jaiprakashsingh...@gmail.com> wrote:

> code in views.py
>
> =
>
> from django.http import HttpResponseRedirect
> from django.core.mail import send_mail
> from django.core.context_processors import csrf
> from django.template import RequestContext
>
> def contact1(request):
> errors = []
> if request.method == 'POST':
> if not request.POST.get('subject', ''):
> errors.append('Enter a subject.')
> if not request.POST.get('message', ''):
> errors.append('Enter a message.')
> if request.POST.get('email') and '@' not in request.POST['email']:
> errors.append('Enter a valid e-mail address.')
> if not errors:
> send_mail(
> request.POST['subject'],
> request.POST['message'],
> request.POST.get('email', 'nore...@example.com'),
> ['siteow...@example.com'],
> )
> return HttpResponseRedirect('/contact/thanks/')
> return render(request, 'contact_form.html',{'errors': errors})
>
>
> ===
> code in contact_form.html
> =
> 
> 
> Contact us
> 
> 
> Contact us
>
> {% if errors %}
> 
> {% for error in errors %}
> {{ error }}
> {% endfor %}
> 
> {% endif %}
>
> 
> Subject: 
> Your e-mail (optional): 
> Message:  cols="50">
> 
> 
> 
> 
>
>
>
>
> =
> error
>
> Forbidden (403)
>
> CSRF verification failed. Request aborted.
>  Help
>
> Reason given for failure:
>
> CSRF cookie not set.
>
>
> In general, this can occur when there is a genuine Cross Site Request
> Forgery, or when Django's CSRF 
> mechanismhas
>  not been used correctly. For POST forms, you need to ensure:
>
>- Your browser is accepting cookies.
>- The view function uses 
> RequestContextfor
>  the template, instead of
>Context.
>- In the template, there is a {% csrf_token %} template tag inside
>each POST form that targets an internal URL.
>- If you are not using CsrfViewMiddleware, then you must use
>csrf_protect on any views that use the csrf_token template tag, as
>well as those that accept the POST data.
>
> You're seeing the help section of this page because you have DEBUG = Truein 
> your Django settings file. Change that to
> False, and only the initial error message will be displayed.
>
> You can customize this page using the CSRF_FAILURE_VIEW setting.
>
>  --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Jonathan D. Baker
Developer
http://jonathandbaker.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Want solution for CSRF problem in django please........

2013-08-15 Thread JAI PRAKASH SINGH
code in views.py

=

from django.http import HttpResponseRedirect
from django.core.mail import send_mail
from django.core.context_processors import csrf
from django.template import RequestContext

def contact1(request):
errors = []
if request.method == 'POST':
if not request.POST.get('subject', ''):
errors.append('Enter a subject.')
if not request.POST.get('message', ''):
errors.append('Enter a message.')
if request.POST.get('email') and '@' not in request.POST['email']:
errors.append('Enter a valid e-mail address.')
if not errors:
send_mail(
request.POST['subject'],
request.POST['message'],
request.POST.get('email', 'nore...@example.com'),
['siteow...@example.com'],
)
return HttpResponseRedirect('/contact/thanks/')
return render(request, 'contact_form.html',{'errors': errors})


===
code in contact_form.html
=


Contact us


Contact us

{% if errors %}

{% for error in errors %}
{{ error }}
{% endfor %}

{% endif %}


Subject: 
Your e-mail (optional): 
Message: 








=
error

Forbidden (403) 

CSRF verification failed. Request aborted.
 Help 

Reason given for failure:

CSRF cookie not set.


In general, this can occur when there is a genuine Cross Site Request 
Forgery, or when Django's CSRF 
mechanismhas
 not been used correctly. For POST forms, you need to ensure:

   - Your browser is accepting cookies.
   - The view function uses 
RequestContextfor
 the template, instead of 
   Context.
   - In the template, there is a {% csrf_token %} template tag inside each 
   POST form that targets an internal URL.
   - If you are not using CsrfViewMiddleware, then you must use csrf_protecton 
any views that use the 
   csrf_token template tag, as well as those that accept the POST data.

You're seeing the help section of this page because you have DEBUG = Truein 
your Django settings file. Change that to 
False, and only the initial error message will be displayed. 

You can customize this page using the CSRF_FAILURE_VIEW setting.

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


django ajax jquery

2013-08-15 Thread Scheck Nyori
Hello!
I am a noob in web development. Just finished polls tuts. Can anyone give
me any insight in using jquery and ajax with django! If possible any
tutorial. Any help will be appreciated!
Thank you.

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


Re: Do we need to setup Database Settings before Using Admin feature in Django?

2013-08-15 Thread Daniel Roseman
On Wednesday, 14 August 2013 21:29:54 UTC+1, Christophe Pettus wrote:
>
>
> On Aug 14, 2013, at 11:31 AM, Harmeet Singh wrote: 
>
> > Can we use the built in ADMIN feature in Django by just configuring 
> 'django.contrib.admin' under INSTALLED_APPS in settings.py file without 
> configuring DATABASES settings ? 
>
> No.  In fact, it's not clear what good the Django admin would be without a 
> database to use.  The admin works on your Model classes, so it needs a 
> database, and the database tables that correspond to the Model objects, 
> already created. 
>
> Not to mention the fact that you need a database to hold the user records 
for authentication purposes, without which it would be impossible to log 
into the admin interface.
--
DR.

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


couchbase as db backend

2013-08-15 Thread Sven
Hi Guys,

has someone of you any experience with the NoSQL db couchbase together with 
django? I mean real practically experience..

Or any good experience with the other famos NoSQL databases and django?

If so, what piece of code will be good to use as Manager for be able to use 
still the django model layer?

-- 


Best Regards
 
Sven

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


Re: Subtitle upload images

2013-08-15 Thread Laurent Meunier

Hi,

On 14/08/2013 12:11, Hélio Miranda wrote:

Hi
I have a problem, that I am not able to solve it is:
I'm uploading pictures, and wanted to introduce their legends too, so
did the following, which was a preview of the images to the user before
uploading. My html code is this:

http://plnkr.co/edit/fm0hAZFkVUE7zA3BnZLw?p=preview


When you populate your div#result with previews of selected images, you 
add an input text field with always the same 'name' attribute. Those 
'name' attributes should have unique value for each input text field 
(and not always name="legend").



And this preview is that there is.

Now in my view, I have this code:

http://plnkr.co/edit/u8ZSrFJCCKFO1PjhO8Tw?p=preview

The problem that happens is that it does well upload the photos without
problem but the subtitles he inserts in every picture the caption that
is only in the last.


And then, in your django view, you have to use 
request.POST['the_unique_name_attribute_for_that_photo'] to get the 
legend for a particular photo.



--
Laurent Meunier 

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


Re: Model verbose name appears to split up on capitalisation (e.g. "iOS") - any way to suppress this?

2013-08-15 Thread Mike Dewhirst

On 15/08/2013 4:57pm, Victor Hooi wrote:

Hi,

That works =):



I just found the same thing mentioned on SO as well:

http://stackoverflow.com/a/9111694

Hmm, I'm guessing this is a known gotcha and workaround, right? Is it
documented anywhere in the Django docs, or is it considered too much of
an edge case?


Personally, I think it is a Django bug. There are two cases. One is that 
Django figures out what to display from the model class name (or field 
name) all by itself. The other is that I decide what to display via 
verbose_name and additionally for model classes, verbose_name_plural.


I think it should not be getting title case.

I did some digging in Django source and found it won't be easy for 
someone like me to fix it. Hence the workaround.


Mike






Cheers,
Victor

On Thursday, 15 August 2013 15:08:00 UTC+10, Mike Dewhirst wrote:

On 15/08/2013 2:06pm, Victor Hooi wrote:
 > For example, verbose_name-Plural on the main admin page (/admin)
still
 > seems to insist on capitalising the first "i" - as in, it appears as
 > "IOS clients", rather than "iOS clients", as it's set in class Meta:
 >

Try verbose_name = " iOS Clients" with a leading space

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


Re: Model verbose name appears to split up on capitalisation (e.g. "iOS") - any way to suppress this?

2013-08-15 Thread Victor Hooi
Hi,

That works =):


I just found the same thing mentioned on SO as well:

http://stackoverflow.com/a/9111694

Hmm, I'm guessing this is a known gotcha and workaround, right? Is it 
documented anywhere in the Django docs, or is it considered too much of an 
edge case?

Cheers,
Victor

On Thursday, 15 August 2013 15:08:00 UTC+10, Mike Dewhirst wrote:
>
> On 15/08/2013 2:06pm, Victor Hooi wrote: 
> > For example, verbose_name-Plural on the main admin page (/admin) still 
> > seems to insist on capitalising the first "i" - as in, it appears as 
> > "IOS clients", rather than "iOS clients", as it's set in class Meta: 
> > 
>
> Try verbose_name = " iOS Clients" with a leading space 
>

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