serving client uploaded files

2012-05-01 Thread Nenad Cikic
Hello, how can i serve the file uploaded files (images)? What I mean I have few model with images, and I see images in the change form. The problem is that I can see the same images by writing directly the media path in the web address. And since the model is designed to have data split between

startproject/startapp template context

2012-05-01 Thread Sam Simmons
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'

HELP with unicode!!!!!

2012-05-01 Thread dizzydoc
Hi , i have lost a lot of time looking for a solution. My problem is, while i a reading csv in python using csv_file = open(path_file, "rb") reader = csv.reader(csv_file) whenever i perform any operation on the string returned in each cell i get this error *** UnicodeEncodeError: 'ascii' code

Re: HELP with unicode!!!!!

2012-05-01 Thread Alexandr Aibulatov
Write at first line on your py file: # -*- coding: utf-8 -*- 2012/5/1 dizzydoc : > Hi , > > i have lost a lot of time looking for a solution. > > My problem is, while i a reading csv in python using > > csv_file  = open(path_file, "rb") > reader = csv.reader(csv_file) > > whenever i perform any op

Re: [JOB] Urgent - PHP/Python Developer needed

2012-05-01 Thread Cal Leeming [Simplicity Media Ltd]
Thanks to everyone for your feedback and to everyone who applied for the position - we had some really great applicants, and one or two exceptionally good ones. The position has now been filled, but we will keep everyone who applied on file for future ref. I should also take the opportunity to me

Re: html5 + Django

2012-05-01 Thread collectiveSQL
Thanks guys, both posts helped. Cheers. On Tuesday, 1 May 2012 01:51:08 UTC+8, HarpB 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

Re: ValueError: unknown locale: UTF-8

2012-05-01 Thread Timothy Makobu
Update: When I downgraded to 1.3, everything worked ok. So I'll be using 1.3 for a while now to avoid surprises. On Sun, Apr 29, 2012 at 1:45 PM, Timothy Makobu wrote: > The database is PostgreSQL 9.1.3 > > > > On Sun, Apr 29, 2012 at 1:09 PM, Timothy Makobu < > makobu.mwambir...@gmail.com> wr

Re: startproject/startapp template context

2012-05-01 Thread Sam Simmons
Checked the src and it's the case that the 'any options' means the ones available to the command. I could see an additional context option being useful. I'm thinking a good way to go about this would be passing a path to a config file that can be consumed by ConfigParser: django-admin.py startp

Getting checkbox value in controller

2012-05-01 Thread Larry Martell
I have a template that creates a text entry field and a checkbox. When the checkbox is unchecked, the text field is disabled and cleared, when it's checked, it's enabled, and the user may or may not have typed in it. In my controller I need to distinguish between the 2 cases when the checkbox is un

Re: Django timezone doesn't show the right time?

2012-05-01 Thread akaariai
On Apr 30, 11:03 pm, Dan Santos wrote: > 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-... > > And I'm still confused after reading these explana

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

2012-05-01 Thread Aditya Sriram M
Okay!! My bad.. was using the wrong function to fetch. Use fetchone() instead. On Tuesday, 1 May 2012 07:22:11 UTC+5:30, Aditya Sriram M wrote: > > > I have been trying a lot but could not make out why it happens, > > class FortressUserAdmin(admin.ModelAdmin): > list_display(. . . , get_my_s

Re: startproject/startapp template context

2012-05-01 Thread Sam Simmons
This has turned into a topic for django developers. On Tuesday, May 1, 2012 7:18:34 AM UTC-5, Sam Simmons wrote: > > Checked the src and it's the case that the 'any options' means the ones > available to the command. I could see an additional context option being > useful. I'm thinking a good wa

No Module Named Generic

2012-05-01 Thread Gerald Klein
Hi, I am having a problem, where as django doesn't find the generics module. Here is my urls.py thanks in advance. from django.conf.urls.defaults import * from django.views.generic import * from coltrane.models import Entry entry_info_dict = { 'queryset': Entry.objects.all(), '

Re: [JOB] Urgent - PHP/Python Developer needed

2012-05-01 Thread Kurtis Mullins
Congrats on finding people to fill your position(s), Cal! At first I read that and thought "man, that's almost insulting". I can honestly say that it's not completely unfair to pay someone $20/hour -- especially if they're still in school. I barely make more than that as a lead-developer for a sta

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

2012-05-01 Thread Kurtis Mullins
Raphael, According to another topic -- some developers are being paid roughly $20/hour. It's under a post by Cal Lemmings where he is trying to hire some entry level developer(s). You might be able to use that information as well. I just thought I'd let you know. On Mon, Apr 30, 2012 at 4:24 PM,

Re: serving client uploaded files

2012-05-01 Thread Kurtis Mullins
You could use a pseudo-random filename so that it's very unlikely people will be able to easily find other's photos. If you're very concerned with users being authenticated before viewing the media (which to me, sounds like there won't be a huge load on that segment of your web application) then y

Re: No Module Named Generic

2012-05-01 Thread Xavier Ordoquy
Hi, You should replace django.generic in the urlspatterns string with django.views.generic Regards, Xavier Ordoquy Linovia. Le 1 mai 2012 à 16:30, Gerald Klein a écrit : > Hi, I am having a problem, where as django doesn't find the generics module. > Here is my urls.py > > thanks in advance.

Re: HELP with unicode!!!!!

2012-05-01 Thread Ian Clelland
On Tuesday, May 1, 2012, dizzydoc wrote: > Hi , > > i have lost a lot of time looking for a solution. > > My problem is, while i a reading csv in python using > > csv_file = open(path_file, "rb") > reader = csv.reader(csv_file) > > whenever i perform any operation on the string returned in each c

Re: The template tag {% load tz %}

2012-05-01 Thread Kurtis Mullins
http://stackoverflow.com/questions/550632/favorite-django-tips-features -- Fourth Answer Down from the Top: from django import template template.add_to_builtins('project.app.templatetags.custom_tag_module') On Mon, Apr 30, 2012 at 9:40 PM, CLIFFORD ILKAY wrote: > On 04/30/2012 09:21 PM, Rajat

Re: No Module Named Generic

2012-05-01 Thread Gerald Klein
Wow, and thanks I must have been staring at it far too long, I appreciate your help. A fresh set of eyes often is the answer. thanks again,. --jerry On Tue, May 1, 2012 at 9:48 AM, Xavier Ordoquy wrote: > Hi, > > You should replace django.generic in the urlspatterns string with > django.views.

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

2012-05-01 Thread Kurtis Mullins
Judging from your Import Error -- I think you're having a problem with Django not being on the Python path. In my uwsgi configuration file (I used .xml), it looks like this: DJANGO_SETTINGS_MODULE=fireflie.settings 4 0.0.0.0:7999 /home/fireflie/staging/fireflie/ django.co

Re: serving client uploaded files

2012-05-01 Thread Nenad Cikic
OK, 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/-/SCat4Yqd-gkJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe

Re: [JOB] Urgent - PHP/Python Developer needed

2012-05-01 Thread Cal Leeming [Simplicity Media Ltd]
On Tue, May 1, 2012 at 3:41 PM, Kurtis Mullins wrote: > Congrats on finding people to fill your position(s), Cal! Thank you! > > At first I read that and thought "man, that's almost insulting". I can > honestly say that it's not completely unfair to pay someone $20/hour > -- especially if they

[VVIP] Displaying Tables in Admin Interface using non-foreign key

2012-05-01 Thread Aditya Sriram M
My models: * * > > *# models.py > class Model1(models.Model): > pk = models.BigIntegerField(primary_key=True) > col1 = models.IntegerField() > class Model2(models.Model): > fk = models.ForeignKey(Model1) > col1 = models.CharField(max_length=255) > # admin.py > class Model1Admin(adm

Re: serving client uploaded files

2012-05-01 Thread Tino de Bruijn
You probably want to implement this with X-Sendfile (or X-Accel-Redirect for Nginx) headers. Those tell the frontend server to serve a specific file. This explains it a bit. http://stackoverflow.com/questions/1156246/having-django-serve-downloadable-files By googling you will find many example

Tools for extending the admin?

2012-05-01 Thread Roy Smith
I'm working on a site which makes extensive use of admin, and we're starting to look at extending/customizing it. I am aware of django-admin-tools and django-grappelli. Are there other projects I should be looking at for admin extension/customization ideas? -- You received this message becau

Paramiko EOFErrors start to occur after a while

2012-05-01 Thread Tino de Bruijn
Hi, My setup is the following: I have two webservers that serve all dynamic request. I have a seperate static file server (that also has some celery queue workers running). When images are uploaded by users, those images are uploaded to the webservers, and processed async by a queue. In the job

Re: Problem with a clean in inline formset

2012-05-01 Thread Ernesto Guevara
Solution: 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() displa

Re: Django timezone doesn't show the right time?

2012-05-01 Thread Dan Santos
Hi thanks for taking the time to explain to me! Unfortunately I still don't understand the outputs that I get in Python console, maybe it's because I don't understand the concept of templates. But this is what I tried to do in Python console. >>> p=Poll(question="Giddeup'ah!", pub_date=timezone.

Re: Django timezone doesn't show the right time?

2012-05-01 Thread akaariai
I see I am talking about concepts which are not yet familiar to you. By template I mean Django's HTML template engine. This is introduced in part 3 of the tutorial. The reason for the errors is that Poll is not an instance, it is the class so it doesn't have pub_date. poll isn't assigned to yet.

Re: Tools for extending the admin?

2012-05-01 Thread Marc Aymerich
On Tue, May 1, 2012 at 5:43 PM, Roy Smith wrote: > I'm working on a site which makes extensive use of admin, and we're starting > to look at extending/customizing it.  I am aware of django-admin-tools > and django-grappelli.  Are there other projects I should be looking at for > admin extension/cu

Re: Tools for extending the admin?

2012-05-01 Thread Giovanni Bronzini
Maybe that one ? https://github.com/saxix/django-iadmin On 1 May 2012 21:12, Marc Aymerich wrote: > On Tue, May 1, 2012 at 5:43 PM, Roy Smith wrote: > > I'm working on a site which makes extensive use of admin, and we're > starting > > to look at extending/customizing it. I am aware of djang

Re: django and oracle --

2012-05-01 Thread Giovanni Bronzini
Simple one you are missing * item* just before *['prezzo']* :-) On 28 April 2012 18:30, gmail wrote: > hello django boys, > > i hope someone here can help me. i have a problem with django e oracle. > above the code with problem: > > insert = """insert into modello (title, descrizione, url

Re: html5 + Django

2012-05-01 Thread Daniel Sokolowski
Hi there, you may also just serve both your static files and django through one apache instance – makes for simple setup and you’ll know when you need something more complicated. Sample apache script: http://dpaste.com/741128/ From: yati sagade Sent: Monday, April 30, 2012 3:47 PM To: django-u

Re: Paramiko EOFErrors start to occur after a while

2012-05-01 Thread Kurtis Mullins
I messed with the SFTP implementatoin a while back. I noticed it was pretty tough and, if I'm not mistaken, a bit out-dated. We ended up moving to Amazon S3 so it wasn't a big deal. Anyways, maybe you could try using another file system? SSH isn't really an ideal solution for this sort of a proble

Re: serving client uploaded files

2012-05-01 Thread Nenad Cikic
This looks interesting, thanks Il giorno martedì 1 maggio 2012 17:37:33 UTC+2, Tino de Bruijn ha scritto: > > You probably want to implement this with X-Sendfile (or X-Accel-Redirect > for Nginx) headers. Those tell the frontend server to serve a specific file. > > This explains it a bit. > http

Re: HELP with unicode!!!!!

2012-05-01 Thread JHeasly
Also, have a look at this slidedeck: http://farmdev.com/talks/unicode/ It's from a PyCon 2008 talk, "Unicode In Python, Completely Demystified" A video of the talk is at http://www.youtube.com/watch?v=cecJ9o5GGmw, but the audio's miserable, and the slides are pretty good, so it may be all you n

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

2012-05-01 Thread easypie
how would i start that? sudo uwsgi start sudo service nginx start? On Sunday, April 29, 2012 12:01:27 PM UTC-7, Karl Sutt wrote: > > Here is my uWSGI command and nginx.conf contents: > > uwsgi -- http://www.dpaste.org/aiJuq/ > nginx -- http://www.dpaste.org/bAG0o/ > > I've used it for a Flask appl

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

2012-05-01 Thread easypie
Thanks. I was missing the virtualenv= mentions earlier. I'm glad I know this those settings are meant for development only. I was a little confused thinking that was ready for deployment. I'm new to all this and get confuse sometimes. On Tuesday, May 1, 2012 8:04:00 AM UTC-7, Kurtis wrote: > >

Re: HELP with unicode!!!!!

2012-05-01 Thread Kejun He
Hi, it may because of the csv file sometimes, try to save the file as utf-8 or utf-8 no-bom. On Tue, May 1, 2012 at 7:08 PM, dizzydoc wrote: > Hi , > > i have lost a lot of time looking for a solution. > > My problem is, while i a reading csv in python using > > csv_file = open(path_file, "