Re: How-to for static files?

2011-11-21 Thread Xavier Ordoquy
Hi, > What follows are my current settings. In settings.py, I have: > > STATIC_URL = '/static/' > INSTALLED_APPS = ('django.contrib.staticfiles',) In order to get their static files served, apps need to be listed in the INSTALLED_APPS list. As you don't mention it, you probably need to add

How-to for static files?

2011-11-21 Thread Gchorn
Hello All, I am currently building a website using the Django built-in development server (python manage.py runserver). I have been using the main djangoproject tutorial for this, and it has worked very well. I have added a lot of internal CSS to the HTML templates that make up my project's

python, django, regex, θæŋkfəli

2011-11-21 Thread gintare
This is corrected question. The first time it was submitted on 2011.11.22 nd. I am not able to save string with special characters, such as θæŋ after re.search(string). #saving to the model Textfield does not work. Instead of θæŋkfəli, i am getting shown "\xce\xb8\xc3\xa6\xc5\x8bkf\xc9\x99li" in

Accessing Model Property from Admin Index Page

2011-11-21 Thread Lee
I've opened a hundred docs/postings and can't find the correct syntax for this simple task. In my model I have a method and a property to return the result of the method: class MyModel(models.Model) ... def get_my_property(self): return '1234' my_property = property(get_my_property)

Re: How to display an image from model

2011-11-21 Thread Nikolas Stevenson-Molnar
What is the URL you are trying to reach? From what you've provided here, the author id would be 1-2 digits and would need to match a valid Author record in the database. Any chance that either of those are incorrect for your request? (also make sure your request URL ends with a forward slash) On

[no subject]

2011-11-21 Thread Duane Hilton
http://bookobrothers.com/modules/mod_wdbanners/site.php?html138 -- 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 for a large social networking or photo sharing site?

2011-11-21 Thread badlearner
Hello, [This is the first time I am using Google Groups and/or mailing lists, so please bear with me if I do something wrong initially.] Is Django web framework apt for a large social networking or photo sharing site? (Think one that has to easily and seamlessly scale to the size of Facebook or

How to display an image from model

2011-11-21 Thread antonio
I'm newbie using django, and I neeto to display a image from the model, I've read about serving static conten but it's not clear to me how to do it. This is my model: class Author(models.Model): first_name = models.CharField(max_length=30) headshot = models.ImageField(upload_to='img/') So i

Re: IOError: request data read error

2011-11-21 Thread Russell Keith-Magee
On Tue, Nov 22, 2011 at 8:02 AM, Rich Jones wrote: > Uh-oh, some of you are saying, not this one again!.. > > I've read all of the posts on this error that I could find, but I'm > still not finding anything useful. Can somebody please explain what > this error is all about? It

Re: anti-join query in Django

2011-11-21 Thread Russell Keith-Magee
On Tue, Nov 22, 2011 at 1:39 AM, dmitry b wrote: > Hi Russ, > > Thanks for a quick response. > > I don't think Django needs to make the decision of whether or not to > do a join.  That can be done by the underlying database as long as > Django generates a query that the

Re: Editable datagrid

2011-11-21 Thread Ivo Brodien
> Can't this be done in django itself? Without resorting to java, ajax > and other fancy stuff? Yes, it does. Did you try the tutorials? the admin is probably what you are looking for but should only be used by staff. -- You received this message because you are subscribed to the Google

Re: Detect runserver in settings.py?

2011-11-21 Thread Jim
On Nov 21, 5:29 pm, Simon Bächler wrote: > if 'runserver' in sys.argv: Thank you, Simon. Jim -- 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

Re: Detect runserver in settings.py?

2011-11-21 Thread Jim
> import socket > if socket.gethostname() == '': >      DEBUG = True > else: >      DEBUG = False Thanks Mike, however I happening to be running it two different ways on a single machine so the issue is not of determining the machine but instead of determining on that machine the way that Django

Field.to_python not working as expected for me...

2011-11-21 Thread Nathan Hoad
I've written a custom field (I'm using Django nonrel) for storing users in a SetField. The SetField doesn't seem to handle serialising the set of User objects properly, so what I've done is implement the pre_save method, which returns a set of strings which are the ids in MongoDB. The

Re: Editable datagrid

2011-11-21 Thread Jeff Heard
You have multiple licensing options. One of those licenses is the GPL. How that translates to "open source" is the source of an eternal flamewar that we'll quietly skip. If your organization permits GPL then you're fine. -- Jeff On Mon, Nov 21, 2011 at 11:43 PM, Vikas Rawal <

IOError: request data read error

2011-11-21 Thread Rich Jones
Uh-oh, some of you are saying, not this one again!.. I've read all of the posts on this error that I could find, but I'm still not finding anything useful. Can somebody please explain what this error is all about? It happens only on the POST requests to one of my pages. It isn't a page which has

Re: Editable datagrid

2011-11-21 Thread Vikas Rawal
> I would look at Sencha. Does not seem open-source. Is it? Vikas -- 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

Re: Editable datagrid

2011-11-21 Thread Vikas Rawal
> I would look at Sencha. They seem to have a nice clean grid > control. It uses > a RESTful interface for importing / exporting data from local data > models via > an AJAX proxy. You use JSON to ship data back and forth. I'd > think you could > use something like django-piston to expose

Re: Detect runserver in settings.py?

2011-11-21 Thread Mike Dewhirst
I found this in stackoverflow some time ago. Not sure who to thank but it works for me ... import socket if socket.gethostname() == '': DEBUG = True else: DEBUG = False hth Mike On 22/11/2011 8:03am, Jim wrote: Hello, Inside of my settings.py I'd like to know whether I am running

Re: Detect runserver in settings.py?

2011-11-21 Thread Simon Bächler
Hi Jim use: import sys if 'runserver' in sys.argv: Regards Simon -- 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

Re: Problem with Django and AJAX: Empty responsetext

2011-11-21 Thread Furbee
Disclaimer: I don't know if this is at all related, but I had an issue with an AJAX object I created outside a function. Can you try this and let me know if it works? Change this: var searchReq = getXmlHttpRequestObject(); to this: searchReq = getXmlHttpRequestObject(); and move it into

Problem with Django and AJAX: Empty responsetext

2011-11-21 Thread Schmidtchen Schleicher
I'm trying to do a simple google-suggest like thing with django and ajax. I wrote a view for creating the response and try to use it via an XMLHttpRequest. Here's my view: def category_suggest(request): > if request.method == "GET": > return_categories = '' > received_str =

Re: django tutorial versions

2011-11-21 Thread Jesse Aldridge
Ah, yes, thanks.  Somehow I didn't notice the "dev" in the url.  FYI, the dev version of the tutorial is the first link that comes up when you google "django tutorial". On Nov 21, 12:21 pm, Anoop Thomas Mathew wrote: > Hi, > The tutorial you where following was dev version and

Re: LFS 0.6 beta 1 released

2011-11-21 Thread Tim Makobu
>From the demo, it looks pretty neat. On Mon, Nov 21, 2011 at 11:09 AM, Kai wrote: > Hi, > > I'm happy to announce the release of LFS 0.6 beta 1. > > LFS is an online shop based on Django and jQuery. > > If you want to read more information please refer to: > >

Re: syncdb not finding and syncing my MySQL database

2011-11-21 Thread BillB1951
To clarify the I entered the command "python manage.py syncdb" from the the terminal prompt (current directory) which is consistent with my apps directory. Manage.py is in the project root and executes because its in my search path. I am currently at my day job so I am not able to send the

Re: syncdb not finding and syncing my MySQL database

2011-11-21 Thread Furbee
Yes, please offer more details. One thing I noticed off the bat, though, was that you said you are running "python manage.py syncdb" from the directory where your models.py is. The manage.py file is at the root of your project, not in the apps folder(s) where models.py is. Furbee On Mon, Nov 21,

Re: django tutorial versions

2011-11-21 Thread Anoop Thomas Mathew
Hi, The tutorial you where following was dev version and the version you have installed is 1.3.1 https://docs.djangoproject.com/en/1.3/intro/tutorial01/ This would be helpful I guess. Thanks, Anoop atm ___ Life is short, Live it hard. On 21 November 2011 23:28, Jesse Aldridge

Re: syncdb not finding and syncing my MySQL database

2011-11-21 Thread Anoop Thomas Mathew
Hi, "I am getting an error" This is not a proper way to ask question. Please post your trace-back somewhere and send the link to the group or at least specify what error is it, so that, we could help you. Thanks, Anoop atm ___ Life is short, Live it hard. On 21 November 2011 23:31,

syncdb not finding and syncing my MySQL database

2011-11-21 Thread BillB1951
I am attempting to run "python manage.py syncdb" from my apps directory (directory where model.py exists for the app). The settings.py database settings all appear to be ok. I have created MySQL database with the same name as in settings.py and I have verified its creation on the MySQL server.

django tutorial versions

2011-11-21 Thread Jesse Aldridge
Looking at https://docs.djangoproject.com/en/dev/intro/tutorial01/ When I run `django-admin.py startproject mysite` I get a flat layout rather than the nested layout the tutorial says I should see. There's a note that says, 'The default project layout recently changed. If you're seeing a

Re: string indices must be integers, not str

2011-11-21 Thread MikeKJ
Yep, you found it a missing comma.cheers Ian Clelland-2 wrote: > > On Mon, Nov 21, 2011 at 9:37 AM, MikeKJ wrote: > >> >> Traceback >> >> string indices must be integers, not str >> >> Request Method: POST >> Request URL:

Re: string indices must be integers, not str

2011-11-21 Thread Ian Clelland
On Mon, Nov 21, 2011 at 9:37 AM, MikeKJ wrote: > > Traceback > > string indices must be integers, not str > > Request Method: POST > Request URL:http://newrutherford.paston2.webfactional.com/question/ > Django Version: 1.3.1 > Exception Type:

Re: anti-join query in Django

2011-11-21 Thread dmitry b
Hi Russ, Thanks for a quick response. I don't think Django needs to make the decision of whether or not to do a join. That can be done by the underlying database as long as Django generates a query that the database can understand and optimize properly. In this case, it would imply that

Re: string indices must be integers, not str

2011-11-21 Thread MikeKJ
Traceback string indices must be integers, not str Request Method: POST Request URL:http://newrutherford.paston2.webfactional.com/question/ Django Version: 1.3.1 Exception Type: TypeError Exception Value: string indices must be integers, not str Exception

Re: will an empty middleware class consume any time (except during initial import?)

2011-11-21 Thread Stuart Laughlin
I'm not so sure, Tom. It took me a few minutes to deduce an answer from the page of code you linked. And I'm extremely clever! ;) At any rate, in the case of a middleware class consisting of just a pass statement, at startup load_middleware will find and validate the existence of the entry in

Re: string indices must be integers, not str

2011-11-21 Thread Andre Terra
Please paste your full traceback every time you are asking for help with debugging. Cheers, AT On Mon, Nov 21, 2011 at 3:10 PM, MikeKJ wrote: > > 1st time I have hit this and I am confused the subject error is returned as > in the send_mail line > all the fields in

string indices must be integers, not str

2011-11-21 Thread MikeKJ
1st time I have hit this and I am confused the subject error is returned as in the send_mail line all the fields in the model are either CharField or TextField settings.py DEFAULT_FROM_EMAIL = 'x...@.co.uk' valid email address CONTACT_EMAIL_TO = 'x...@.co.uk' valid

string indices must be integers, not str

2011-11-21 Thread MikeKJ
1st time I have hit this and I am confused the subject error is returned as in the send_mail line all the fields in the model are either CharField or TextField settings.py DEFAULT_FROM_EMAIL = 'x...@.co.uk' valid email address CONTACT_EMAIL_TO = 'x...@.co.uk' valid

Re: Startproject Project layout

2011-11-21 Thread Andre Terra
You may have a problem with your Python install and multiple django versions installed for the same environment. In a shell/cmd try: $ python -c "import django; print django.get_version()" and double check that you're not using a legacy version. Post back with your findings should you have any

Re: Editable datagrid

2011-11-21 Thread Jeff Heard
I would look at Sencha. They seem to have a nice clean grid control. It uses a RESTful interface for importing / exporting data from local data models via an AJAX proxy. You use JSON to ship data back and forth. I'd think you could use something like django-piston to expose your models to the

Re: Build mobile apps for DJango sites — Would XML/JSON passing be the best approach?

2011-11-21 Thread esatterwh...@wi.rr.com
I'll have ot agree with the Andre. I had a pretty large django project That I wanted to "Make Mobile". I used minidetector to determine mobile browsers http://code.google.com/p/minidetector/ tastypie to feed data sencha touch to build a UI based on the data from tasty pie.

Re: Build mobile apps for DJango sites — Would XML/JSON passing be the best approach?

2011-11-21 Thread Andre Terra
You could probably use some help with the API. https://github.com/toastdriven/django-tastypie Cheers, AT On Mon, Nov 21, 2011 at 8:21 AM, Alec Taylor wrote: > Good evening, > > I am strongly considering building my project using DJango. > > My project will provide a

Re: how django forms.ChoiceField with queryset ?

2011-11-21 Thread CrabbyPete
Do want to initialize a choice field? You can do this with forms class SomeForm(forms.Form): interest = forms.ChoiceField( choices=(), widget=forms.Select(attrs={}) ) def __init__(self, *args, **kwargs): super(SomeForm,

Editable datagrid

2011-11-21 Thread Vikas Rawal
I am new to django and to web programming. I am trying to build a database application for entering/querying/viewing data from a mysql database. The data entry module needs to have datagrids where users can enter multiple rows of data belonging to a particular set. Would be grateful for pointers

Re: ImportError: No module named django

2011-11-21 Thread victoria
Hi, You mentioned that you installed BitNami DjangoStack. For using it you should first go to the Windows Start Menu and click in the 'Use DjangoStack" link. Then you can execute python and 'import django' should work. You also have Python 2.7 installed so if you don't load the BitNami

Re: will an empty middleware class consume any time (except during initial import?)

2011-11-21 Thread Tom Evans
On Sat, Nov 19, 2011 at 10:53 PM, Gelonida N wrote: > Just out of curiousity, > > Let's assume I add a middleware in settings.MIDDLEWARE_CLASSES and the > middleware class is empty. (just a pass statement) > > Will it consume any CPU time while handling a request? > > > To

Re: os.listdir() not returning unicode

2011-11-21 Thread Tom Evans
On Mon, Nov 21, 2011 at 7:05 AM, Marc wrote: > OK I found a clue regarding that issue: > print(sys.getfilesystemencoding()) at the console prompt produces > 'UTF-8' whereas in the failing script ' ANSI_X3.4-1968'. I now > understand why the conversion fails (in that case Python

Build mobile apps for DJango sites — Would XML/JSON passing be the best approach?

2011-11-21 Thread Alec Taylor
Good evening, I am strongly considering building my project using DJango. My project will provide a web-interface and a mobile app. I was thinking to build the mobile app from XML sheets, i.e.: text here text here text here text here text here Then I could easily parse the XML file using

Re: Beginner: how to display the list of records with subrecords?

2011-11-21 Thread Petr Přikryl
Hi Javier, > Od: "Javier Guerra Giraldez" >>PP wrote... >> I tried the tutorial, and I like it, but it is too much of new things >> for me. > >but all these new things are needed to solve your problem. > >for us (or anybody) to help you, we'd need first a common language, or >else we would waste

LFS 0.6 beta 1 released

2011-11-21 Thread Kai
Hi, I'm happy to announce the release of LFS 0.6 beta 1. LFS is an online shop based on Django and jQuery. If you want to read more information please refer to: http://www.getlfs.com/released-06-beta-1 Thanks Kai -- You received this message because you are subscribed to the Google Groups