Monday, April 30, 2012

Re: Trouble with query syntax in Django view

First of all. Student.objects.filter(pk=id) returns QuerySet not
instance of Student.
If you want get current student use
get_object_or_404()(https://docs.djangoproject.com/en/1.4/topics/http/shortcuts/#get-object-or-404)
or Student.objects.get(pk=id).

Teacher and parents can bee retrived via Student instance:
teacher = student.teacher
parents = student.parents.all()

2012/5/1 LJ <ljayadams@gmail.com>:
> I have a Student model that stores information about a student,
> including the student's teacher.
> The teacher's information is stored in the Employee model that
> inherits from the Person Model.
> I am having trouble figuring out how to query the teacher, when a
> student id is passed as an ajax argument to the view function.
> I have no trouble returning the data about the parents and the
> student, but my filter for querying the teacher info is incorrect.
> Does anyone have any ideas how I can query for the teacher information
> based on the models below?
>
> #models.py
> class Student(Person):
>    grade = models.ForeignKey('schools.Grade')
>    school = models.ManyToManyField('schools.School', blank=True,
> null=True, related_name="school")
>    parents = models.ManyToManyField('parents.Parent', blank=True,
> null=True)
>    teacher = models.ForeignKey(Employee, blank=True, null=True,
> related_name='teacher')
>
> class Employee(Person):
>    ''' Employee model inherit Person Model'''
>    role=models.ForeignKey(EmployeeType, blank=True, null=True)
>    user=models.ForeignKey(User)
>    schools =
> models.ManyToManyField(School,blank=True,null=True)
>
> # views.py
> def get_required_meeting_participants(request, template):
>    try:
>        id=request.GET['id']
>    except:
>        id=None
>
>    parents = Parent.objects.filter(student=id)
>    student = Student.objects.filter(pk=id)
>    teacher = Employee.objects.filter(pk=student.teacher_id)  #this
> line is incorrect...help, please?
>
>    data = {
>        'parents': parents,
>        'student': student,
>        'teacher': teacher,
>    }
>
>    return
> render_to_response(template,data,
>                            context_instance=RequestContext(request))
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re:: Trouble with query syntax in Django view

You can get teacher and parents objects from student instance. student.teacher and student.teachers.all()

01.05.2012 11:46 пользователь "LJ" <ljayadams@gmail.com> написал:
I have a Student model that stores information about a student,
including the student's teacher.
The teacher's information is stored in the Employee model that
inherits from the Person Model.
I am having trouble figuring out how to query the teacher, when a
student id is passed as an ajax argument to the view function.
I have no trouble returning the data about the parents and the
student, but my filter for querying the teacher info is incorrect.
Does anyone have any ideas how I can query for the teacher information
based on the models below?

#models.py
class Student(Person):
   grade = models.ForeignKey('schools.Grade')
   school = models.ManyToManyField('schools.School', blank=True,
null=True, related_name="school")
   parents = models.ManyToManyField('parents.Parent', blank=True,
null=True)
   teacher = models.ForeignKey(Employee, blank=True, null=True,
related_name='teacher')

class Employee(Person):
   ''' Employee model inherit Person Model'''
   role=models.ForeignKey(EmployeeType, blank=True, null=True)
   user=models.ForeignKey(User)
   schools =
models.ManyToManyField(School,blank=True,null=True)

# views.py
def get_required_meeting_participants(request, template):
   try:
       id=request.GET['id']
   except:
       id=None

   parents = Parent.objects.filter(student=id)
   student = Student.objects.filter(pk=id)
   teacher = Employee.objects.filter(pk=student.teacher_id)  #this
line is incorrect...help, please?

   data = {
       'parents': parents,
       'student': student,
       'teacher': teacher,
   }

   return
render_to_response(template,data,
                           context_instance=RequestContext(request))

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Trouble with query syntax in Django view

I have a Student model that stores information about a student,
including the student's teacher.
The teacher's information is stored in the Employee model that
inherits from the Person Model.
I am having trouble figuring out how to query the teacher, when a
student id is passed as an ajax argument to the view function.
I have no trouble returning the data about the parents and the
student, but my filter for querying the teacher info is incorrect.
Does anyone have any ideas how I can query for the teacher information
based on the models below?

#models.py
class Student(Person):
grade = models.ForeignKey('schools.Grade')
school = models.ManyToManyField('schools.School', blank=True,
null=True, related_name="school")
parents = models.ManyToManyField('parents.Parent', blank=True,
null=True)
teacher = models.ForeignKey(Employee, blank=True, null=True,
related_name='teacher')

class Employee(Person):
''' Employee model inherit Person Model'''
role=models.ForeignKey(EmployeeType, blank=True, null=True)
user=models.ForeignKey(User)
schools =
models.ManyToManyField(School,blank=True,null=True)

# views.py
def get_required_meeting_participants(request, template):
try:
id=request.GET['id']
except:
id=None

parents = Parent.objects.filter(student=id)
student = Student.objects.filter(pk=id)
teacher = Employee.objects.filter(pk=student.teacher_id) #this
line is incorrect...help, please?

data = {
'parents': parents,
'student': student,
'teacher': teacher,
}

return
render_to_response(template,data,
context_instance=RequestContext(request))

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Dojo Rich Editor Implementation in Admin.py

Hi All,

I'm building a blog, with models "Post" and "Image" (each blog post can have multiple images; they're related by ForeignKey) and I'm trying to implement the Dojo rich editor in my admin site by following the example here:

https://gist.github.com/868595

However, the rich editor is not showing up.  I have a feeling I don't have something set up correctly in my admin.py file; could anyone tell me what it is?  Here are the contents of admin.py:

from blogs.models import Post,Image
from django.contrib import admin
from django.contrib.admin import site, ModelAdmin
import models


class CommonMedia:
  js = (
    'https://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js',
    '/home/guillaume/mysite/blogs/static/editor.js',
  )
  css = {
    'all': ('/home/guillaume/mysite/blogs/static/editor.css',),
  }

class PostImageInline(admin.TabularInline):
    model = Image
    extra = 5

class PostAdmin(admin.ModelAdmin):
    inlines = [PostImageInline]

site.register(models.Post,
    list_display = ('text',),
    search_fields = ['text',],
    Media = CommonMedia,
)

admin.site.unregister(Post)

admin.site.register(Post, PostAdmin)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/IPDPAY_Z5skJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

startproject/startapp template context

I was pretty excited to see the template option for startapp/startproject. Especially when I read your context can be any option passed to the command and it clicked that the files are rendered using django's templating system. This could make for a really nice configurable boilerplate. But, after playing with it it looks like by any option they just meant the options available to the commands (django-admin.py help startapp/project).

If that's the case, that's quite a bubble burst. Is there any way to pass in arbitrary context to the template? e.g.

django-admin.py startproject --template=/path/to/boilerplate --compass=true --coffee=true myproject

Or maybe a standard way to define a python dictionary and pass it in as the context:

django-admin.py startproject --template=/path/to/boilerplate --template-context=config.py myproject

Thanks!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/-Y0DLtgIkNwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Django admin site display (None) even when values are non-null/empty


I have been trying a lot but could not make out why it happens,

class FortressUserAdmin(admin.ModelAdmin):    
list_display
(. . . , get_my_schema)    
def get_my_schema(self, obj):
    sql_query
= "select prop_val from customer_property where customer_id = %d and property_value like '%%%%SCHEMA%%%%'" % obj.customer_id.customer_id    
    property_value
= connection.cursor().execute(sql_query).fetch_one()        
   
print sql_query        
   
return 1
   
# return "aditya"
get_my_schema
.short_description = 'Schema Instance'

  • why the column values are always (None)
  • why the print 1 or print 'aditya' won't print anything to the console

Screen shot of the column admin site: enter image description here

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/liHNhbNpk_QJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: The template tag {% load tz %}

On 04/30/2012 09:21 PM, Rajat Jain wrote:
> Hi,
>
> I am shifting to Django 1.4 and want to use the timezone support (for
> which I want to use {% load tz %} in my templates). The problem is that
> I have aroudn 30-40 templates, and manually adding these tags to each
> template is a pain. Is there a way by which I can do this loading by
> default in all the templates?

Hi Rajat,

You can use sed. See: <http://www.grymoire.com/Unix/Sed.html#uh-39>.
--
Regards,

Clifford Ilkay
Dinamis
1419-3230 Yonge St.
Toronto, ON
Canada M4N 3P6

<http://dinamis.com>
+1 416-410-3326

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

The template tag {% load tz %}

Hi,

I am shifting to Django 1.4 and want to use the timezone support (for which I want to use {% load tz %} in my templates). The problem is that I have aroudn 30-40 templates, and manually adding these tags to each template is a pain. Is there a way by which I can do this loading by default in all the templates?

Thanks,
Rajat

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: executing raw sql

On Mon, Apr 30, 2012 at 6:26 PM, Dennis Lee Bieber
<wlfraed@ix.netcom.com> wrote:
> On Mon, 30 Apr 2012 15:29:08 -0600, Larry Martell
> <larry.martell@gmail.com> declaimed the following in
> gmane.comp.python.django.user:
>
>>
>> But in django I am doing this:
>>
>> from django.db import connection
>> cursor = connection.cursor()
>> cursor.execute(sql)
>>
>> and it's getting the error, so that would mean that the sql isn't
>> getting executed for some reason. I'll have to investigate that
>> avenue.
>
>        You still haven't show us what "sql" contains... Given your three
> statements I'd expect to get an error message since "sql" itself is
> undefined.

I figured out the problem. I had %s in my sql, and they was getting
treated as a format specifier. When I built the sql I did put in '%%',
but I had to put in 4 '%%%%' for it to work.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: executing raw sql

On Mon, 30 Apr 2012 15:29:08 -0600, Larry Martell
<larry.martell@gmail.com> declaimed the following in
gmane.comp.python.django.user:

>
> But in django I am doing this:
>
> from django.db import connection
> cursor = connection.cursor()
> cursor.execute(sql)
>
> and it's getting the error, so that would mean that the sql isn't
> getting executed for some reason. I'll have to investigate that
> avenue.

You still haven't show us what "sql" contains... Given your three
statements I'd expect to get an error message since "sql" itself is
undefined.

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Chicago openings?

Does anyone have a Chicago opening for an end-to-end web developer using Python and Django?

--
Christos Jonathan Hayward
Jonathan Hayward, an Orthodox Christian author.

Amazon  Author Bio  Books  Email • Facebook • Google Plus Kindle • LinkedIn • Twitter • Web • What's New?

I invite you to visit my "theology, literature, and other creative works" site. See a random page!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: [help] Server Config: django + uwsgi + nginx

I am not entirely sure what you mean by that. If you mean the nginx equivalent of Apache VirtualHosts then the nginx wiki explains it quite nicely http://wiki.nginx.org/ServerBlockExample. Is that what you meant?

Karl Sutt


On Mon, Apr 30, 2012 at 7:04 PM, easypie <program.py@gmail.com> wrote:
does your configuration allow for running multiple sites?


On Sunday, April 29, 2012 12:01:27 PM UTC-7, Karl Sutt wrote:
Here is my uWSGI command and nginx.conf contents:


I've used it for a Flask application, but I've just tested it and it works for a Django project as well. Note that wsgi.py file in the uwsgi command is the Python file that Django generates when you first create a project, there is no need to change it.

Good luck!

Karl Sutt


On Sun, Apr 29, 2012 at 6:49 PM, easypie <program.py@gmail.com> wrote:
I have this file that was created for me by one of the users in django's irc channel. I edited to have the right information inserted but I"m not sure what I'm doing wrong to not make it work. I've spent some time trying to understand each line by searching the web. There's still a thing or two that's missing from the puzzle. Maybe it's the server config that has a flaw or the way I went about it. I haven't done a fresh install of uwsgi and nginx yet. However, please take a look to see if there's an error or solution that could work. Thanks.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/2rekHP0I6V0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/sMsRN5iG9NQJ.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: executing raw sql

On Mon, Apr 30, 2012 at 2:32 PM, Larry Martell <larry.martell@gmail.com> wrote:
> On Mon, Apr 30, 2012 at 12:46 PM, Larry Martell <larry.martell@gmail.com> wrote:
>> I'm trying to execute some raw sql. I found some code that did this:
>>
>> from django.db import connection
>> cursor = connection.cursor()
>> cursor.execute(sql)
>> data = cursor.fetchall()
>>
>> But the cursor.execute(sql) is blowing up with:
>>
>> 'Cursor' object has no attribute '_last_executed'
>>
>> What is the best or proper way for me to execute my raw sql?
>
> I traced this with the debugger,  and it's blowing up in
> django/db/backends/mysql/base.py in this:
>
>    def last_executed_query(self, cursor, sql, params):
>        # With MySQLdb, cursor objects have an (undocumented) "_last_executed"
>        # attribute where the exact query sent to the database is saved.
>        # See MySQLdb/cursors.py in the source distribution.
>        return cursor._last_executed
>
> Could this have something to do with the version of django and/or mysql?
>
> I'm running django 1.5 and MySQL 5.5.19, and MySQLdb 1.2.3. I just
> tried this and that does not exist on my system:
>
> $ python
> Python 2.6.7 (r267:88850, Jan 11 2012, 06:42:34)
> [GCC 4.0.1 (Apple Inc. build 5490)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import MySQLdb
>>>> conn = MySQLdb.connect(host, user, passwd, db)
>>>> cursor = conn.cursor()
>>>> print cursor._last_executed
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> AttributeError: 'Cursor' object has no attribute '_last_executed'
>>>> print cursor.__dict__
> {'_result': None, 'description': None, 'rownumber': None, 'messages':
> [], '_executed': None, 'errorhandler': <bound method
> Connection.defaulterrorhandler of <_mysql.connection open to
> 'localhost' at 889810>>, 'rowcount': -1, 'connection': <weakproxy at
> 0x62f630 to Connection at 0x889810>, 'description_flags': None,
> 'arraysize': 1, '_info': None, 'lastrowid': None, '_warnings': 0}

I've found that cursor._last_executed doesn't exist until a query has
been executed (it's not initialized to None)

But in django I am doing this:

from django.db import connection
cursor = connection.cursor()
cursor.execute(sql)

and it's getting the error, so that would mean that the sql isn't
getting executed for some reason. I'll have to investigate that
avenue.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Templates not working properly

No problem eveyone has one of those moments

On Mon, Apr 30, 2012 at 4:07 PM, Zaerion <zaerion@gmail.com> wrote:
Yup, I caught it just after I posted it and spent about 30 minutes trying to figure out what I did wrong. Thanks for the help! :)

On Monday, April 30, 2012 2:05:37 PM UTC-7, Gerald Klein wrote:
Hi, the delimiters use are using are wrong it should be {% not (%

On Mon, Apr 30, 2012 at 3:41 PM, Zaerion <zaerion@gmail.com> wrote:
I'm new to using Django and was working my way through the tutorial to get a better feel of it. I'm stuck on part 3 of the tutorial and the section where they show you how to use templates. When I hard-code the HttpResponse object everything works fine, but when I try to use a template it appears that none of the python code is being interpreted and it displays in the web browser. I am using Debian 6, Python 2.6, and Django 1.4 and things have been going smoothly up until this point. I'm sure I missed a setting somewhere or have something configured incorrectly, but I can't seem to find it. Any help is appreciated.

-- You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/IErgzK-V4BYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--

Gerald Klein DBA

ContactMe@geraldklein.com

www.geraldklein.com

jk@zognet.com

708-599-0352


Linux registered user #548580 



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/XS7TMWWSqNYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--

Gerald Klein DBA

ContactMe@geraldklein.com

www.geraldklein.com

jk@zognet.com

708-599-0352


Linux registered user #548580 



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Templates not working properly

Yup, I caught it just after I posted it and spent about 30 minutes trying to figure out what I did wrong. Thanks for the help! :)

On Monday, April 30, 2012 2:05:37 PM UTC-7, Gerald Klein wrote:
Hi, the delimiters use are using are wrong it should be {% not (%

On Mon, Apr 30, 2012 at 3:41 PM, Zaerion <zaerion@gmail.com> wrote:
I'm new to using Django and was working my way through the tutorial to get a better feel of it. I'm stuck on part 3 of the tutorial and the section where they show you how to use templates. When I hard-code the HttpResponse object everything works fine, but when I try to use a template it appears that none of the python code is being interpreted and it displays in the web browser. I am using Debian 6, Python 2.6, and Django 1.4 and things have been going smoothly up until this point. I'm sure I missed a setting somewhere or have something configured incorrectly, but I can't seem to find it. Any help is appreciated.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/IErgzK-V4BYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--

Gerald Klein DBA

ContactMe@geraldklein.com

www.geraldklein.com

jk@zognet.com

708-599-0352


Linux registered user #548580 



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/XS7TMWWSqNYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Templates not working properly

Nevermind. I'm just an idiot. I had used parenthesis instead of curly braces. Sorry!

On Monday, April 30, 2012 1:41:25 PM UTC-7, Zaerion wrote:
I'm new to using Django and was working my way through the tutorial to get a better feel of it. I'm stuck on part 3 of the tutorial and the section where they show you how to use templates. When I hard-code the HttpResponse object everything works fine, but when I try to use a template it appears that none of the python code is being interpreted and it displays in the web browser. I am using Debian 6, Python 2.6, and Django 1.4 and things have been going smoothly up until this point. I'm sure I missed a setting somewhere or have something configured incorrectly, but I can't seem to find it. Any help is appreciated.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/PJwPbj7qm10J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Templates not working properly

Hi, the delimiters use are using are wrong it should be {% not (%

On Mon, Apr 30, 2012 at 3:41 PM, Zaerion <zaerion@gmail.com> wrote:
I'm new to using Django and was working my way through the tutorial to get a better feel of it. I'm stuck on part 3 of the tutorial and the section where they show you how to use templates. When I hard-code the HttpResponse object everything works fine, but when I try to use a template it appears that none of the python code is being interpreted and it displays in the web browser. I am using Debian 6, Python 2.6, and Django 1.4 and things have been going smoothly up until this point. I'm sure I missed a setting somewhere or have something configured incorrectly, but I can't seem to find it. Any help is appreciated.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/IErgzK-V4BYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--

Gerald Klein DBA

ContactMe@geraldklein.com

www.geraldklein.com

jk@zognet.com

708-599-0352


Linux registered user #548580 



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: executing raw sql

On Mon, 30 Apr 2012 12:46:34 -0600, Larry Martell
<larry.martell@gmail.com> declaimed the following in
gmane.comp.python.django.user:

> I'm trying to execute some raw sql. I found some code that did this:
>
> from django.db import connection
> cursor = connection.cursor()
> cursor.execute(sql)
> data = cursor.fetchall()
>
> But the cursor.execute(sql) is blowing up with:
>
> 'Cursor' object has no attribute '_last_executed'
>
> What is the best or proper way for me to execute my raw sql?

What's the actual code (you list a sample you found somewhere, which
not complete -- for example, just what does "sql" contain?).

What database engine are you using?

What is the traceback of the error?

etc... too much information is missing to make a guess... (Well,
I'll make an hypothesis based upon the so-called error message: you have
an engine which saves previous SQL statements, and if "sql" in None will
attempt to re-execute the previously saved SQL -- but you don't have a
previously saved SQL statement.)
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Templates not working properly

I'm new to using Django and was working my way through the tutorial to get a better feel of it. I'm stuck on part 3 of the tutorial and the section where they show you how to use templates. When I hard-code the HttpResponse object everything works fine, but when I try to use a template it appears that none of the python code is being interpreted and it displays in the web browser. I am using Debian 6, Python 2.6, and Django 1.4 and things have been going smoothly up until this point. I'm sure I missed a setting somewhere or have something configured incorrectly, but I can't seem to find it. Any help is appreciated.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/IErgzK-V4BYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: executing raw sql

On Mon, Apr 30, 2012 at 12:46 PM, Larry Martell <larry.martell@gmail.com> wrote:
> I'm trying to execute some raw sql. I found some code that did this:
>
> from django.db import connection
> cursor = connection.cursor()
> cursor.execute(sql)
> data = cursor.fetchall()
>
> But the cursor.execute(sql) is blowing up with:
>
> 'Cursor' object has no attribute '_last_executed'
>
> What is the best or proper way for me to execute my raw sql?

I traced this with the debugger, and it's blowing up in
django/db/backends/mysql/base.py in this:

def last_executed_query(self, cursor, sql, params):
# With MySQLdb, cursor objects have an (undocumented) "_last_executed"
# attribute where the exact query sent to the database is saved.
# See MySQLdb/cursors.py in the source distribution.
return cursor._last_executed

Could this have something to do with the version of django and/or mysql?

I'm running django 1.5 and MySQL 5.5.19, and MySQLdb 1.2.3. I just
tried this and that does not exist on my system:

$ python
Python 2.6.7 (r267:88850, Jan 11 2012, 06:42:34)
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>> conn = MySQLdb.connect(host, user, passwd, db)
>>> cursor = conn.cursor()
>>> print cursor._last_executed
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Cursor' object has no attribute '_last_executed'
>>> print cursor.__dict__
{'_result': None, 'description': None, 'rownumber': None, 'messages':
[], '_executed': None, 'errorhandler': <bound method
Connection.defaulterrorhandler of <_mysql.connection open to
'localhost' at 889810>>, 'rowcount': -1, 'connection': <weakproxy at
0x62f630 to Connection at 0x889810>, 'description_flags': None,
'arraysize': 1, '_info': None, 'lastrowid': None, '_warnings': 0}

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Django - Worldwide Developer Rates - Hourly Income - location and project duration specific

Dear djangos,

if you want to hand-in your data anonymously - just send us an email to django[at]develissimo.com
we really need more data to achieve some meaningful results.

http://develissimo.com/forum/topic/107887/

Cheers,
Raphael


Django timezone doesn't show the right time?

Hi I'm a total programming newbie!

### INTRO ###
I have been following this tutorial and the timezone outputs confuses
me.
https://docs.djangoproject.com/en/1.4/intro/tutorial01/#playing-with-the-api

And I'm still confused after reading these explanations, I basically
need some really dumbed down answers to understand this timezone
business:

<b>TIME_ZONE setting: How does it work?</b>
http://groups.google.com/group/django-users/browse_thread/thread/bebbc1310f24e945/100d0fc3e8620684?lnk=gst&q=timezone+problems#



### QUESTION ###
* Europe/Brussels has UTC+2 during summer time.

When I run this as I follow the Django tutorial, then the time (20:34)
is behind by 2 hours to my local time and UTC displays +00:00.
Shouldn't it display 22:34 +02:00 instead for a server located at
Europe/Brussels?

>>> Poll.objects.all()
<Poll: How do you do? 2012-04-26 20:34:33.337247+00:00>]

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Storing Sorl-thumbnail created images in separate folder

Okay in the latest version every images generated is getting saved to cache. My issue is resolved. Thanks all for your kind help :)

Thanks and Regards,
Swaroop Shankar V



On Tue, May 1, 2012 at 1:24 AM, Swaroop Shankar V <swaroopsv@gmail.com> wrote:
It looks like i was using an old version which came with satchmo. Am currently testing my project with new version. 

Thanks and Regards,
Swaroop Shankar V



On Tue, May 1, 2012 at 12:59 AM, Swaroop Shankar V <swaroopsv@gmail.com> wrote:
It looks like the latest version of solr-thumnails or the version that i have currently installed supports THUMBNAIL_STORAGE. When i checked i could see a file under the path solr/thumbnail called defaults.py. In this file there are following options 

DEBUG = False
BASEDIR = ''
SUBDIR = ''
PREFIX = ''
QUALITY = 85
CONVERT = '/usr/bin/convert'
WVPS = '/usr/bin/wvPS'
EXTENSION = 'jpg'
PROCESSORS = (
    'sorl.thumbnail.processors.colorspace',
    'sorl.thumbnail.processors.autocrop',
    'sorl.thumbnail.processors.scale_and_crop',
    'sorl.thumbnail.processors.filters',
)
IMAGEMAGICK_FILE_TYPES = ('eps', 'pdf', 'psd')

which i guess can be overridden from the django settings file. Here there is BASEDIR and SUBDIR and i guess those are the settings to be used but not sure. When i tried to override the default i could see no change. So anyone having experience in setting the same please let me know. 

Thanks and Regards,

Swaroop Shankar V




On Mon, Apr 30, 2012 at 7:27 PM, Tiago Almeida <tiago.b.almeida@gmail.com> wrote:
Have you tried changing the THUMBNAIL_STORAGE setting? I haven't done what you ask for but you should give it a try.



Domingo, 29 de Abril de 2012 17:27:56 UTC+1, Swaroop Shankar escreveu:
Thanks Kelly, could you tell me what all settings you had provided for it to cache into a separate directory?

Thanks and Regards,
Swaroop Shankar V



On Sun, Apr 29, 2012 at 8:09 PM, Kelly Nicholes <kelbolicious@gmail.com> wrote:
It always just caches the files for me in a completely different directory.

On Saturday, April 28, 2012 1:06:12 PM UTC-6, Swaroop Shankar wrote:
Hello All,
I am using sorl-thumbnail extensively in my project. It works perfectly fine except for one issue which is regarding the storage. The default behaviour of sorl-thumbnail is to create the images in the same folder where the original image is stored. Is it possible to provide a separate location for storage of generated file rather than the source folder? I could find a setting called THUMBNAIL_STORAGE, is it the one to be used? I am not able to figure it out from the documentation. If yes then should i provide the absolute or relative path?

Thanks and Regards,

Swaroop Shankar V

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Tfl7B7Xir_gJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/bh_2yiDPjF0J.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Storing Sorl-thumbnail created images in separate folder

It looks like i was using an old version which came with satchmo. Am currently testing my project with new version. 

Thanks and Regards,
Swaroop Shankar V



On Tue, May 1, 2012 at 12:59 AM, Swaroop Shankar V <swaroopsv@gmail.com> wrote:
It looks like the latest version of solr-thumnails or the version that i have currently installed supports THUMBNAIL_STORAGE. When i checked i could see a file under the path solr/thumbnail called defaults.py. In this file there are following options 

DEBUG = False
BASEDIR = ''
SUBDIR = ''
PREFIX = ''
QUALITY = 85
CONVERT = '/usr/bin/convert'
WVPS = '/usr/bin/wvPS'
EXTENSION = 'jpg'
PROCESSORS = (
    'sorl.thumbnail.processors.colorspace',
    'sorl.thumbnail.processors.autocrop',
    'sorl.thumbnail.processors.scale_and_crop',
    'sorl.thumbnail.processors.filters',
)
IMAGEMAGICK_FILE_TYPES = ('eps', 'pdf', 'psd')

which i guess can be overridden from the django settings file. Here there is BASEDIR and SUBDIR and i guess those are the settings to be used but not sure. When i tried to override the default i could see no change. So anyone having experience in setting the same please let me know. 

Thanks and Regards,

Swaroop Shankar V




On Mon, Apr 30, 2012 at 7:27 PM, Tiago Almeida <tiago.b.almeida@gmail.com> wrote:
Have you tried changing the THUMBNAIL_STORAGE setting? I haven't done what you ask for but you should give it a try.



Domingo, 29 de Abril de 2012 17:27:56 UTC+1, Swaroop Shankar escreveu:
Thanks Kelly, could you tell me what all settings you had provided for it to cache into a separate directory?

Thanks and Regards,
Swaroop Shankar V



On Sun, Apr 29, 2012 at 8:09 PM, Kelly Nicholes <kelbolicious@gmail.com> wrote:
It always just caches the files for me in a completely different directory.

On Saturday, April 28, 2012 1:06:12 PM UTC-6, Swaroop Shankar wrote:
Hello All,
I am using sorl-thumbnail extensively in my project. It works perfectly fine except for one issue which is regarding the storage. The default behaviour of sorl-thumbnail is to create the images in the same folder where the original image is stored. Is it possible to provide a separate location for storage of generated file rather than the source folder? I could find a setting called THUMBNAIL_STORAGE, is it the one to be used? I am not able to figure it out from the documentation. If yes then should i provide the absolute or relative path?

Thanks and Regards,

Swaroop Shankar V

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Tfl7B7Xir_gJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/bh_2yiDPjF0J.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: html5 + Django

I suggest Nginx to serve your static files, and possibly also as a reverse proxy to point to your Django with Gunicorn/Apache setup (If you haven't considered Gunicorn as a production server yet, please do. It is fantastic).

On Mon, Apr 30, 2012 at 11:21 PM, HarpB <hsbsitez@gmail.com> wrote:
It is much better to use Apache for static files than Django. You can still run DJango for data validation, but all static content is typically served via Apache. In your  virtualhost, you should proxy the /static/ endpoint to the /static/ folder in Django app.


On Sunday, April 29, 2012 5:39:15 AM UTC-7, collectiveSQL wrote:
Hi Everyone,

I'm working on a heavily animated web site using the html5 canvas tag.
Its mainly made of html, javascript and css static files and I'd like
to integrate the Google Identity Toolkit for an Oauth 2.0 account
chooser for signup and registration.

The first question is Django a good candidate for serving up mainly
static files and using a small Django app for authentication?

And secondly what performance impact would this have over straight
apache?

More info:

1. Static web files such as html, javascript and css are stored on
Amazon AWS S3
2. Data is loaded via oData using jsdata for animations
3. Amazon AWS EC2 is used to scale apache web servers

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/p30N-x76AEgJ.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
Yati Sagade

Twitter: @yati_itay

Organizing member of TEDx EasternMetropolitanBypass
http://www.ted.com/tedx/events/4933
https://www.facebook.com/pages/TEDx-EasternMetropolitanBypass/337763226244869


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Storing Sorl-thumbnail created images in separate folder

It looks like the latest version of solr-thumnails or the version that i have currently installed supports THUMBNAIL_STORAGE. When i checked i could see a file under the path solr/thumbnail called defaults.py. In this file there are following options 

DEBUG = False
BASEDIR = ''
SUBDIR = ''
PREFIX = ''
QUALITY = 85
CONVERT = '/usr/bin/convert'
WVPS = '/usr/bin/wvPS'
EXTENSION = 'jpg'
PROCESSORS = (
    'sorl.thumbnail.processors.colorspace',
    'sorl.thumbnail.processors.autocrop',
    'sorl.thumbnail.processors.scale_and_crop',
    'sorl.thumbnail.processors.filters',
)
IMAGEMAGICK_FILE_TYPES = ('eps', 'pdf', 'psd')

which i guess can be overridden from the django settings file. Here there is BASEDIR and SUBDIR and i guess those are the settings to be used but not sure. When i tried to override the default i could see no change. So anyone having experience in setting the same please let me know. 

Thanks and Regards,

Swaroop Shankar V



On Mon, Apr 30, 2012 at 7:27 PM, Tiago Almeida <tiago.b.almeida@gmail.com> wrote:
Have you tried changing the THUMBNAIL_STORAGE setting? I haven't done what you ask for but you should give it a try.



Domingo, 29 de Abril de 2012 17:27:56 UTC+1, Swaroop Shankar escreveu:
Thanks Kelly, could you tell me what all settings you had provided for it to cache into a separate directory?

Thanks and Regards,
Swaroop Shankar V



On Sun, Apr 29, 2012 at 8:09 PM, Kelly Nicholes <kelbolicious@gmail.com> wrote:
It always just caches the files for me in a completely different directory.

On Saturday, April 28, 2012 1:06:12 PM UTC-6, Swaroop Shankar wrote:
Hello All,
I am using sorl-thumbnail extensively in my project. It works perfectly fine except for one issue which is regarding the storage. The default behaviour of sorl-thumbnail is to create the images in the same folder where the original image is stored. Is it possible to provide a separate location for storage of generated file rather than the source folder? I could find a setting called THUMBNAIL_STORAGE, is it the one to be used? I am not able to figure it out from the documentation. If yes then should i provide the absolute or relative path?

Thanks and Regards,

Swaroop Shankar V

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Tfl7B7Xir_gJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/bh_2yiDPjF0J.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Problem with a clean in inline formset

Hello!

The (if display.max_windows() >= display.windows) works fine to
prevent insert. Behaves as expected.
But is raised even when the row is REMOVED from the edit formset. =/

## Models

class Display(models.Model):
windows = models.IntegerField()

def max_windows(self):
total = self.window_set.all().count() #window is a
intermediary class to campaign
if total:
return total

## Clean method in CampaignInlineFormSet

def clean(self):
if any(self.errors):
# Don't bother validating the formset unless each form is
valid on its own
return
for i in range(0, self.total_form_count()):
form = self.forms[i]
cleaned_data = form.clean()
display = cleaned_data.get('display', None)
if display.max_windows() >= display.windows:
raise forms.ValidationError("The display have all
windows occupied.")

This "if" can not stop me remove a row in inline formset. How can I
fix this?
Regards.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

executing raw sql

I'm trying to execute some raw sql. I found some code that did this:

from django.db import connection
cursor = connection.cursor()
cursor.execute(sql)
data = cursor.fetchall()

But the cursor.execute(sql) is blowing up with:

'Cursor' object has no attribute '_last_executed'

What is the best or proper way for me to execute my raw sql?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

cPanel Python/Django support

For the past couple of years, cPanel (the most widely deployed hosting control panel system) has been taking pulse on user demand for native Django support (similar to their Rails installer). Just saw this note from cPanel devs and thought some folks here might be interested. This is a great opportunity to help shape the future of what could become one of the most widely available routes to Django deployment on commodity hosting.

./s

Begin forwarded message:
>
> Dear shacker23,
>
> cPanelDavidG has just replied to a thread you have subscribed to entitled - After EA3 Django support [Case 33011] - in the Feature Requests for cPanel/WHM forum of cPanel Forums.
>
> This thread is located at:
> http://forums.cpanel.net/f145/django-support-case-33011-a-146541-new-post.html
>
> Here is the message that has just been posted:
> ***************
> For those who are not aware, we are soliciting feedback regarding a preferred Python implementation via a new mailing list devoted specifically for this subject. If you want to participate, you can visit: cPanel (http://go.cpanel.net/python)
> ***************
>


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: [help] Server Config: django + uwsgi + nginx

does your configuration allow for running multiple sites?

On Sunday, April 29, 2012 12:01:27 PM UTC-7, Karl Sutt wrote:
Here is my uWSGI command and nginx.conf contents:


I've used it for a Flask application, but I've just tested it and it works for a Django project as well. Note that wsgi.py file in the uwsgi command is the Python file that Django generates when you first create a project, there is no need to change it.

Good luck!

Karl Sutt


On Sun, Apr 29, 2012 at 6:49 PM, easypie <program.py@gmail.com> wrote:
I have this file that was created for me by one of the users in django's irc channel. I edited to have the right information inserted but I"m not sure what I'm doing wrong to not make it work. I've spent some time trying to understand each line by searching the web. There's still a thing or two that's missing from the puzzle. Maybe it's the server config that has a flaw or the way I went about it. I haven't done a fresh install of uwsgi and nginx yet. However, please take a look to see if there's an error or solution that could work. Thanks.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/2rekHP0I6V0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/sMsRN5iG9NQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: html5 + Django

It is much better to use Apache for static files than Django. You can still run DJango for data validation, but all static content is typically served via Apache. In your  virtualhost, you should proxy the /static/ endpoint to the /static/ folder in Django app.

On Sunday, April 29, 2012 5:39:15 AM UTC-7, collectiveSQL wrote:
Hi Everyone,

I'm working on a heavily animated web site using the html5 canvas tag.
Its mainly made of html, javascript and css static files and I'd like
to integrate the Google Identity Toolkit for an Oauth 2.0 account
chooser for signup and registration.

The first question is Django a good candidate for serving up mainly
static files and using a small Django app for authentication?

And secondly what performance impact would this have over straight
apache?

More info:

1. Static web files such as html, javascript and css are stored on
Amazon AWS S3
2. Data is loaded via oData using jsdata for animations
3. Amazon AWS EC2 is used to scale apache web servers

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/p30N-x76AEgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Import from local ftp server

On Mon, Apr 30, 2012 at 11:53 AM, orsomannaro <orsomannaro@gmail.com> wrote:
> On 30/04/2012 17:44, Thomas Weholt wrote:
>>
>> Might not be exactly what you need, but want to mention it anyway:
>
>
> Thank you very much, but I nedd a ftp client, not a server.
>
> I must build with Django something like this:
>
> http://www.net2ftp.com/
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
There is a python library called subprocess :
http://docs.python.org/library/subprocess.html#using-the-subprocess-module
You can just enter your ftp command as arguments
subprocess.call(["ftp://username:password@hostname/path/to/files/*"])

I haven't tried it before, but give it a try

--
Joel Goldstick

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Import from local ftp server

On 30/04/2012 17:44, Thomas Weholt wrote:
> Might not be exactly what you need, but want to mention it anyway:

Thank you very much, but I nedd a ftp client, not a server.

I must build with Django something like this:

http://www.net2ftp.com/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.