Re: Traceback from csrf_exempt in 1.3.1

2012-03-02 Thread Thomas Orozco
You seem to have no 500.html page. This traceback won't actually show the error that happened, but error out on the fact that it can't find a template to display the 500 error. 1. Are you running DEBUG = True? 2. Wouldn't you rather want to simplejson.dum > > I have never used csrf_exempt

Re: social graph

2012-03-05 Thread Thomas Orozco
You might want to look into the Django socialauth app Le 5 mars 2012 14:08, "suresh dokania" a écrit : > How to access user 's facebook profile information using django ? > And how to find their friends and use their info as well ? > > -- > You received this message

Re: Traceback from csrf_exempt in 1.3.1

2012-03-05 Thread Thomas Orozco
on/ > json") > > Here is my urls.py > > url(r'^auth/', 'auth.views.json_api'), > > Once I uncomment the two csrf_exempt statements, I get the 500 error? > Any ideas? > > > > On Mar 2, 6:57 am, Thomas Orozco <g.orozco.tho...@gmail.com> wrote: > > You seem to

Best practices for calling an external service in a Django app

2012-05-11 Thread Thomas Orozco
Hi, Here's my situation: one of my views needs to call an external service (through a socket ; actually the said service is on the same server). I don't even need to know about the service's response as I'll inquire about it asynchronously in an effort to avoid delay on the user's end. What are

Re: Best practices for calling an external service in a Django app

2012-05-11 Thread Thomas Orozco
nce was like). > > On Fri, May 11, 2012 at 9:50 AM, Thomas Orozco > <g.orozco.tho...@gmail.com>wrote: > >> Hi, >> >> Here's my situation: one of my views needs to call an external service >> (through a socket ; actually the said service is on the same se

Re: ForeignKey and Performance

2012-06-08 Thread Thomas Orozco
Why not use a lookup: TheA = ... TheCs = C.objects.filter(b__a = TheA) Le 8 juin 2012 15:01, "bo.schwarzst...@gmail.com" a écrit : > ** > Hi all, > > Is there any guideline about SQL performance ? > > For example, now we have 3 models, > > class A(Model): > ... > >

Re: Upload a valid image. The file you uploaded was either not an image or a corrupted image.

2012-07-01 Thread Thomas Orozco
Do you have jpeg support installed for PIL? Le 1 juil. 2012 18:13, "Nikhil Verma" a écrit : > > Hi All > > I am trying to add jpeg image in a ImageField. and it gives this error . > It is not allowing me to save the image. > > I have installed PIL and image other

Re: Upload a valid image. The file you uploaded was either not an image or a corrupted image.

2012-07-01 Thread Thomas Orozco
mand/easy_install.py", > line 434, in easy_install > File > "/home/nikhil/Citysom/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/package_index.py", > line 475, in fetch_distribution > > AttributeError: 'NoneType' object has no attribute 'clon

Re: Management form in Model Formsets

2012-07-01 Thread Thomas Orozco
You might want to check this snippet out: djangosnippets.org/snippets/1389*/ * Le 1 juil. 2012 06:27, "Knight Samar" a écrit : > Hi, > > I am using Django 1.2 and developing using Model formsets. Using > JavaScript, I am allowing the user to dynamically "Add another"

Re: Upload a valid image. The file you uploaded was either not an image or a corrupted image.

2012-07-01 Thread Thomas Orozco
gt; Selecting previously deselected package libjpeg62-dev. > (Reading database ... 302567 files and directories currently installed.) > Unpacking libjpeg62-dev (from .../libjpeg62-dev_6b1-1ubuntu2_amd64.deb) ... > Setting up libjpeg62-dev (6b1-1ubuntu2) ... > nikhil@nikhil-desktop:~$ &g

Re: Upload a valid image. The file you uploaded was either not an image or a corrupted image.

2012-07-01 Thread Thomas Orozco
PIL-1.1.7-py2.7.egg-info >> changing mode of /home/nikhil/Citysom/bin/pilfont.py to 775 >> changing mode of /home/nikhil/Citysom/bin/pilfile.py to 775 >> >> >> changing mode of /home/nikhil/Citysom/bin/pilprint.py to 775 >> changing mode of

Re: settings and constants on a reusable app

2012-07-01 Thread Thomas Orozco
Have a default settings, that you only use when the required setting is not found in the actual settings file. Le 30 juin 2012 20:09, "Bill Freeman" a écrit : > Support an additional variable MY_APP_USE_OTHER_CONSTANT (MY and > MY_APP, are, I hope, not the prefixes you are

Re: Problem with DetailView

2012-07-08 Thread Thomas Orozco
Could you give us the fill error message displaying what ended up being passed to the view? Also, are you sure a car exists with the id / pk you're passing? Le 7 juil. 2012 23:10, "Soviet" a écrit : > But the ListView is working fine. And they don't use in the >

Re: how to use HTTPS with django

2012-07-08 Thread Thomas Orozco
This comes down to a simple middleware that intercepts http requests and redirects them to https. This is very to do in django. You can find plenty of such middleware on djangosnippets. Now, if your app is running behind a reverse proxy (e.g. nginx + gunicorn) , things get a little bit more

Re: Missing 'SITE_ID' breaks first Django app

2012-07-08 Thread Thomas Orozco
What is kills the whole app supposed to mean? Just pulling this out of thin air, but do you have a record in your database (sites) that corresponds to your SITE_ID setting (when you add it) Le 6 juil. 2012 13:43, "Melvyn Sopacua" a écrit : > On 6-7-2012 7:38, DF wrote: >

Re: Cacheing and JSON

2012-07-08 Thread Thomas Orozco
I think you're going to need to provide more context here. Are you telling us that reading from your database takes minutes? Do your remote clients periodically poll your api? What's the overall flow and what's the issue you have? I hardly believe that caching is useful here, unless you're

Re: how to use HTTPS with django

2012-07-08 Thread Thomas Orozco
re bad. I've used a few of those on snippets :) They are great. > > And for many people, there is usually more than one Django site, or > multiple applications deploy (custom backend, etc) which run as HTTP > services too. So enabling SSL at server level is a lot easier to maintain. > > >

Re: Directory indexes are not allowed here. for Grappilli

2012-07-16 Thread Thomas Orozco
What is your actual problem here? Do you not understand the message? Do you have a reason for which you'd want this directory indexed? Le 16 juil. 2012 13:24, "chhots" a écrit : > Page not found (404) Request Method: GET Request URL: >

Re: Template Loader Error: (It's been really frustrating till now..!)

2012-07-19 Thread Thomas Orozco
You can also have a "templates" directory in any app of yours and Django will pick them up from there. It's also best practice to start your template path with your app name. For instance: myapp/templates/myapp/my template.html Or; mytemplatedir/myapp/mytemplate.html Indeed django does not

Re: INSTALLED Grappelli App and getting some error

2012-07-19 Thread Thomas Orozco
Never use grappeli so take this advice for what it's worth, but did you check the version compatibility of your grappeli install and your django install? Le 18 juil. 2012 20:12, "chhots" a écrit : > TemplateSyntaxError at /admin/ > > 'url' is not a valid tag library:

Re: Tutorial question

2012-07-19 Thread Thomas Orozco
A model is just a class, so the methods just "go there", yes. You could check out apps in django.contrib for styling best practices (the django doc itself also covers this I think*,* but I can't remember where) Le 17 juil. 2012 19:49, "jeffsarge" a écrit : > Hi, > I'm learning

Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-07-19 Thread Thomas Orozco
Did you visit the page where the broken link exists with the same browser as your user and searched for : + JS warnings + JS errors + Requests on the broken link + The actual broken url somewhere in the DOM tree Chrome has an integrated full featured debugger, you could use it. The

Re: SuspiciousOperation exception on ImageField upload

2012-07-19 Thread Thomas Orozco
Here you're trying to upload to a directory, whose path starts with a / : /images. On *nix, / means system root. Obviously your django process does not have permission to write there unless you set that up so. You should remove the leading slash in your upload to path. Your files will then

Re: CachedStaticFilesStorage unavailable in debug mode

2012-07-19 Thread Thomas Orozco
CachedStaticFiledStorage will work, only it will not append the hashes as it usually does and behave like a standard file storage. The use case for this storage is to set very long expires dates on the static files and rely and their url changing (due to the hash changing ) whenever you change

Re: Query with 3 models

2012-07-19 Thread Thomas Orozco
Shouldn't that be a prefetch related and not select related? Le 19 juil. 2012 16:52, "Tomas Neme" a écrit : > > > {Empresa1, Sucursal1, Platillo1, Horario1}, > > {Empresa1, Sucursal1, Platillo2, Horario1}, > > {Empresa2, Sucursal1, Platillo1, Horario1}... > > I'm guessing

Re: Checking if a dynamicallygenerated dropdown has a selected item

2012-07-23 Thread Thomas Orozco
Are you using django forms? Should be pretty straightforward once you have the input nicely formatted to just count the number of fields that have been filled in. Le 23 juil. 2012 19:01, "Babatunde Akinyanmi" a écrit : > Maybe I don't really understand the question but I

Re: Adding Button in admin form

2012-08-17 Thread Thomas Orozco
If you're using a ForeignKey for this field, you'll get this behavior by default in the Django admin. Le 17 août 2012 08:45, "Madhu" a écrit : > Hello, > > I want to add the button along with field in admin form. > > ex. Field name "URL" with the "Choose Page" button. >

Re: django makemessages doesn't recognize trans in templates

2012-08-17 Thread Thomas Orozco
You gave us the project layout, but where are the templates? My guess is that Django is basically not picking them templates *up*, but I might be off. There are arguments to the makemessages command that can help you indicate the directory you want messages created for. You can also use higher

Re: Django Admin doesn't show all fields from model when registered.

2012-08-17 Thread Thomas Orozco
This is not really django specific, several objects bearing the same name in the same namespace will always lead to trouble ; ) (And this is not even python specific) Glad you could fix it and thanks for posting your solution in case someone else has the same issue though. : ) Le 16 août 2012

Re: Auto login with external cookie from different system

2012-08-17 Thread Thomas Orozco
Huge props for having the python docs on localhost :-D Le 16 août 2012 20:08, "Melvyn Sopacua" a écrit : > On 16-8-2012 6:02, Kurtis Mullins wrote: > > > Not all of us host the Python docs, locally, haha. > > Lies! But yea, forgot to check that so thanks :) > > -- > Melvyn

Re: Adding Button in admin form

2012-08-17 Thread Thomas Orozco
list, but i want the URL as the > character field and "Choose Page" button which having the function which > retrieves the database query list. > > > On Friday, August 17, 2012 12:51:35 PM UTC+5:30, Thomas Orozco wrote: >> >> If you're using a ForeignKey for this fie

Re: Adding Button in admin form

2012-08-17 Thread Thomas Orozco
It's raw_id_fields! (see the docs for more detail : ) ) On your modeladmin, set that to a list including the name (as string) of your field, and you should have what you want. Let me know if I misunderstood. Le 17 août 2012 09:47, "Thomas Orozco" <g.orozco.tho...@gmail.com> a écr

Re: Adding Button in admin form

2012-08-17 Thread Thomas Orozco
I might be off, but I believe that they want to get a list of objects from the database, a ForeignKey seems more appropriate here, or am I missing something? Le 17 août 2012 09:58, "Amyth Arora" a écrit : > Change the ModelField to type "CharField" and you should have

Re: Using sessions in Django

2012-08-17 Thread Thomas Orozco
Session key is the session 's primary key. Not the session itself. What you want to assign to your field is a session, not its key. So use request.session. However. Please very careful when using FK' s to sessions, sessions are meant to be short lived, and could / should be deleted once they

Re: Using sessions in Django

2012-08-17 Thread Thomas Orozco
I'm sorry, I have some trouble understanding exactly what you need, could you please try and provide a bit more context ? :-) Le 17 août 2012 10:27, "Sandeep kaur" <mkaurkha...@gmail.com> a écrit : > On Fri, Aug 17, 2012 at 1:42 PM, Thomas Orozco > <g.orozco.tho...@gmai

Re: Using sessions in Django

2012-08-17 Thread Thomas Orozco
My mistake then, sorry about that! Le 17 août 2012 10:34, "Tom Evans" <tevans...@googlemail.com> a écrit : > On Fri, Aug 17, 2012 at 9:12 AM, Thomas Orozco > <g.orozco.tho...@gmail.com> wrote: > > Session key is the session 's primary key. Not the session itsel

Re: Adding Button in admin form

2012-08-17 Thread Thomas Orozco
(again) did you try using raw_id_fields? Le 17 août 2012 11:26, "Madhu" a écrit : > Can you please tell me how to add the Buttom on admin form in django? > I want to add the button beside the field. > > -- > You received this message because you are subscribed to the

Re: Adding Button in admin form

2012-08-17 Thread Thomas Orozco
Then there must be something I don't understand in what you need, could you describe a bit more? Le 17 août 2012 12:02, "Madhu" a écrit : > > I try the row_id_fields, but its not helpful for me. > I want the button will be display in admin form. > Using row_id_fields

Re: Adding Button in admin form

2012-08-17 Thread Thomas Orozco
So you would want to have a link to the url that was entered? Le 17 août 2012 12:15, "Madhu" a écrit : > Ok. I will explain it in brief. > > I want the button like the image field having the Browse button with the > Image field in admin side i want the same button but

Re: Adding Button in admin form

2012-08-17 Thread Thomas Orozco
I'm sorry, I really have a hard time understanding what you need, but you might want to try overriding the form template to add your button? If so, try the change_form_template parameter. Le 17 août 2012 12:42, "Madhu" a écrit : > No. URL linking is not the problem. I

Re: Updating a model instance with extra checks.

2012-08-20 Thread Thomas Orozco
A few suggestions : Circumvent the problem with smarter design: don't store the money on the object, make the user's money the sum of all their transactions (credit - debit). You get lesser performance, but you also get history! Maybe you could try (not sure about that):

Re: Updating a model instance with extra checks.

2012-08-20 Thread Thomas Orozco
pacua" <m.r.sopa...@gmail.com> a écrit : > On 20-8-2012 19:37, Thomas Orozco wrote: > > > Circumvent the problem with smarter design: don't store the money on the > > object, make the user's money the sum of all their transactions (credit - > > debit). > > You ge

Re: [ImageField -Upload a valid image]

2012-08-20 Thread Thomas Orozco
I'd you believe PIL is not picking up your libjpeg when it should be, you could give Pillow a shot ; its basically a PIL installer that makes installation easier. Le 20 août 2012 22:30, "Kurtis Mullins" a écrit : > Whenever you compile PIL, make sure that libjpeg is

Re: Updating a model instance with extra checks.

2012-08-20 Thread Thomas Orozco
ot; >= 4 AND "testapp_testmodel"."id" = 1 ); args=(4, 4, 1) 0 *So this seems to generate a single SQL statement.* * * *I'm not totally familiar with database administration though, so as** Melvyn rightly pointed out, it's always better if you can get the extra securi

Re: Updating a model instance with extra checks.

2012-08-21 Thread Thomas Orozco
save signals > wont be triggered. > It seems strange to me to be using the objects manager instead of the > model instance directly, no? > > Seb > > Le mardi 21 août 2012 02:11:42 UTC+2, Thomas Orozco a écrit : >> >> As a followup to the suggestion of MyModel.objects.fi

Re: How I do to centralize logins OpenID in django?

2012-08-22 Thread Thomas Orozco
+1 - If you are running both apps using the same database server, this would probably be the simpler solution! Le 22 août 2012 04:26, "Kurtis Mullins" a écrit : > I've never tried this approach; but maybe you could use the multi-database > feature of Django to share a

Re: Any good Open Source Django-Based CRM's ?

2012-09-01 Thread Thomas Orozco
Django crm is pretty good and open source! On Sep 1, 2012 4:53 PM, "pajju" wrote: > HI > > I'm looking for Django Powered Open Sourced CRM's which is ready for > Production use. > I did not find much help google'ing for the same. :) > > And In other Technologies, Open

Re: Any good Open Source Django-Based CRM's ?

2012-09-01 Thread Thomas Orozco
Dismiss what I said, I misread (and miswrote) CRM for CMS -_- 2012/9/1 Thomas Orozco <tho...@orozco.fr> > Django crm is pretty good and open source! > On Sep 1, 2012 4:53 PM, "pajju" <prajwalp...@gmail.com> wrote: > >> HI >> >> I'm looking for

Re: testing a django package

2012-09-11 Thread Thomas Orozco
Is it a view mix in? It's a bit difficult to tell you much without more information. A few you things that you may find useful or not for testing : . Test cases can override settings such as the urlconf . There's a test client to test views . Class based views can sometimes be tested without

Re: Marketplace for Django apps

2012-09-11 Thread Thomas Orozco
You could always use https://www.gittip.com/ to that end, Basically, it allows you to tip developers that are on github For instance, you could tip django devs at: https://www.gittip.com/on/github/django/ You can see that: https://www.gittip.com/aaugustin/ or https://www.gittip.com/alex/, among

Re: not picking up new template

2012-09-12 Thread Thomas Orozco
Can you being up a manage.py shell and load the template from there to identify where's Django is pulling the template from? You should be able to go step by step and identify where you're pulling the old template in! If you don't find anything, it's probably because your template actually isn't

Re: tastypie - some feedback / comments

2012-09-12 Thread Thomas Orozco
After giving it a try for a small personal project / curiosity, I couldn't agree more that it's great for a REST API with querysets, but whenever something doesn't exactly tie into this structure, things get complicated. However, I would say that this can also be a good thing. This forces you to

Re: not picking up new template

2012-09-12 Thread Thomas Orozco
you should be able to troubleshoot your issue. You could always try wich each loader using: from django.conf import settings for loader_name in settings.TEMPLATE_LOADERS: l = loader.find_template_loader(loader_name) l.load_template_source(somewhere/'your_template.html') 2012/9/12 Thomas

Re: testing a django package

2012-09-12 Thread Thomas Orozco
I think you could create an urls.py file for your tests and attach your views there. Then use the test client to direct requests to those test URLs and assert that the response is what you expect. Now, this is probably not going to be practical to test your jQuery components, but you might want

Re: ANN: django-otp and friends: one-time passwords and trusted agents

2012-09-12 Thread Thomas Orozco
This seems to be a *very* promising project! : ) Le mercredi 12 septembre 2012 22:27:26 UTC+2, psagers a écrit : > > I recently released a suite of packages to support two-factor > authentication in Django by way of one-time passwords. > > The core package is django-otp

Re: testing a django package

2012-09-12 Thread Thomas Orozco
Actually, Django TestCases can override the URLConf, which allows you to have a given URL for a given view in your test: from django.test import TestCase class MyTestCase(TestCase): urls = 'mypackage.tests.urls' def test_something(): # Do stuff... >From there, you can

Re: Basic auth struggle

2012-09-13 Thread Thomas Orozco
Could you us the line where you import login? On Sep 13, 2012 2:06 PM, "Timster" wrote: > What does the rest of your views.py file look like? > > Do you happen to have a view named login()? > > -- > You received this message because you are subscribed to the Google Groups

Re: Easy question to the Auth System

2012-09-16 Thread Thomas Orozco
Hi, Use ManyToMany if one event can relate to *several* Users Use ForeignKey if one event relates to a *single* User Cheers, Thomas 2012/9/16 WoHinDu : > Hey, > > sorry for my bad englisch. Englisch is not my nativ language, but i hope you > can understand it and sorry for

Re: Changing table's engine through migration scripts

2012-09-16 Thread Thomas Orozco
I wouldn't recommend that Migrations are tightly tied to your app as you need them to set you app up. In that sense, they should be database agnostic, as your app is (because Django is). Using a migration that only works for MySQL seems very strange to me. Indeed, such a migration wouldn't make

Re: Django testing strategy

2012-10-04 Thread Thomas Orozco
You can use `fixtures` for this purpose! You can have several of them to have exactly the data you need for a test. Have a look there: https://docs.djangoproject.com/en/dev/topics/testing/#django.test.TestCase.fixtures Cheers, Thomas 2012/10/4 Daniele Procida > I have

Re: trouble with pre_delete signal method

2012-12-18 Thread Thomas Orozco
Hi, Could you provide the following information? - What's the relationship between A and B (model code of the field, if there is, would be great) - The code of your pre_delete signal handler / the method it calls. I think you have a ForeignKey field that is required or limited and that

Re: 【HELP】AttributeError: 'AdminSite' object has no attribute 'urls'

2012-12-18 Thread Thomas Orozco
What version of django are you using? admin.site.urls was introducd four years ago ( https://github.com/django/django/commit/1f84630c87f8032b0167e6db41acaf50ab710879), but maybe you're running an older version? Best, Thomas 2012/12/15 向浩 > Environment: > > Request

Re: 【HELP】AttributeError: 'AdminSite' object has no attribute 'urls'

2012-12-18 Thread Thomas Orozco
Haha indeed, silly me! Well I think that's the error cause then : the urls property apparently didn't exist in Django 1.0! Cheers, Thomas On Dec 18, 2012 3:14 PM, "Ramiro Morales" <cra...@gmail.com> wrote: > On Tue, Dec 18, 2012 at 10:12 AM, Thomas Orozco <tho...@oroz

Re: trouble with pre_delete signal method

2012-12-19 Thread Thomas Orozco
mind sharing the bpart.a_partcodes code ? Cheers, Thomas 2012/12/19 Mike Dewhirst <mi...@dewhirst.com.au>: > Thomas > > Thanks for replying > > > On 19/12/2012 12:06am, Thomas Orozco wrote: >> >> Hi, >> >> >> Could you provide the following

Re: trouble with pre_delete signal method

2012-12-19 Thread Thomas Orozco
;mi...@dewhirst.com.au> > On 19/12/2012 12:06am, Thomas Orozco wrote: > >> >> I think you have a ForeignKey field that is required or limited and that >> is causing the ValidationError. >> Indeed, that line 988 is in the code for ModelChoiceField >> > > I have now

Re: trouble with pre_delete signal method

2012-12-20 Thread Thomas Orozco
It's great that you could find where the issue is coming from! Cheers, Thomas 2012/12/20 Mike Dewhirst <mi...@dewhirst.com.au> > On 19/12/2012 11:58pm, Thomas Orozco wrote: > >> Hi, >> >> If you have no relationship, I'm a bit at a loss. I think the easier >

Re: Creating an alternative change_list view for a specific app/model, not extending or overriding

2011-08-24 Thread Thomas Orozco
What about calling your admin view with a GET "alternate=1" parameter ? An if statement in a template override would then allow you to render properly depending on the aforementioned attribute provided you're passing the request in the Context. This event allows you to fine tune which bits you

Re: AssertEquals __unicode__

2011-08-25 Thread Thomas Orozco
Well, call unicode(MyObject) and assert equals u'myRepr' Le 25 août 2011 12:34, "Torsten" a écrit : > Hi > > How do I do that right ? > > I have a class like: > > class Invoice > ... > def __unicode__(self): > return

Re: Integrity Error

2011-08-26 Thread Thomas Orozco
Your invoice items have no invoice attribute, as the error says. By the way, although I'm not sure of what you're trying to achieve, let me point out that there is not really a need for a sum field in your invoice as you can just sum all the invoice items' amount (and respect the DRY principle -

Re: Integrity Error

2011-08-26 Thread Thomas Orozco
That would be blank = True Le 26 août 2011 11:58, "Kejun He" <printer...@gmail.com> a écrit : > Sometime, set null = true would allow a field to be empty > > On Fri, Aug 26, 2011 at 5:41 PM, Thomas Orozco <g.orozco.tho...@gmail.com >wrote: > >> Your

Re: Integrity Error

2011-08-26 Thread Thomas Orozco
no invoice attribute, as the error says. > > Isn't this line which defines the attribute ? > invoice = models.ForeignKey(Invoice) > > Thanks > Torsten > > On 26 Aug., 11:41, Thomas Orozco <g.orozco.tho...@gmail.com> wrote: > > Your invoice items have no invoice attrib

Re: Integrity Error

2011-08-26 Thread Thomas Orozco
While we're at it, here are a few suggestions. So long as you can, you should use unicode inside python code. The main logic would be that input should be converted to unicode as soon as possible, and that output should be encoded (likely to UTF-8) as late as possible. Consequently, you might

Re: Integrity Error

2011-08-26 Thread Thomas Orozco
Glad I could help! Le 26 août 2011 12:53, "Torsten" <torstenzan...@googlemail.com> a écrit : > Thanks Thomas you helped me a lot these are my first step in python > and django. > And I really starting to like it > > Torsten > > On 26 Aug., 12:23, Thomas Oro

Re: Installation

2011-08-26 Thread Thomas Orozco
You needn't have Django in your path but the parent directory so you can import it. Le 26 août 2011 14:07, "prem" a écrit : > Hi, > > Im trying to install Django but Im not succcessfull. > > The python has been installed properly. > > This is my python shell, > > Python 3.2.1

Re: Create socket server in django

2011-09-20 Thread Thomas Orozco
You just have to run your server as a daemon and use Django's setup_environment so you can use the ORM to interact with your Django DB. I can try and find the lines you need to do that if you can't find them. Le 20 sept. 2011 09:08, "Micke" a écrit : -- You received

Re: changes to .py file is not reflected until server is restarted.

2011-09-22 Thread Thomas Orozco
Sightly off topic, but your .py files seem to be exposed by your webserver - you shouldn't do this or anyone could download them! Le 22 sept. 2011 08:02, "kenneth gonsalves" a écrit : > On Wed, 2011-09-21 at 19:37 +0100, Cal Leeming [Simplicity Media Ltd] > wrote: >> Oh

Re: Parellel request from the same user in very short time

2011-09-24 Thread Thomas Orozco
Well, depends on what you're going to do with this data and what it represents, but maybe the simpler solution is to use a small javascript in your page that prevents the user from posting the same data twice. I actually had the same issue running a site of mine, and a double POST is mostly

Re: Problem on user profile

2011-09-28 Thread Thomas Orozco
You might be importing your models.py file multiple time, thus registering the signals multiple times. You should look into the signals documentation - you can avoid duplicate signal handlers and this is covered there. Le 28 sept. 2011 14:44, "Lingfeng Xiong" a écrit :

Re: View decorator for common navigation elements?

2011-10-03 Thread Thomas Orozco
Maybe you can use template inheritance and have the base template access the data through, alternatively, template filters or instance methods? To make those work, you can take advantage of the existing template processors (notably the auth one). If you want to not have the topnav on a

Re: effective adding records in Django site admin

2011-10-04 Thread Thomas Orozco
Regarding your first question, the admin save_as field does exactly this. Le 4 oct. 2011 07:01, "veva...@yandex.ru" a écrit : -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Don't understand still

2011-10-15 Thread Thomas Orozco
Just don't assign anything to objects and leave that line out of your code ; use the default manager. Le 15 oct. 2011 17:54, "Piotr Hosowicz" a écrit : > On 15 Paź, 17:40, Piotr Hosowicz wrote: > > Carlos, of course I have data in the DB. Babatunde, the

Re: lost admin on upgrade to django 1.3

2011-07-30 Thread Thomas Orozco
Django 1.3 shipped with staticfiles for static documents, maybe you could look that way. Le 30 juil. 2011 02:10, "zignorp" a écrit : > Hello, > I just upgraded to 1.3 and thought all was well until I tried to access > LOCALHOST/admin/ > Can anyone tell me why I'm getting

Re: Django can't see my static files

2011-08-01 Thread Thomas Orozco
If your css file is locatedr in your staticfiles dir, you should use something such as {{ STATIC_URL }}main.css, assuming your CSS file is called main and is located in one of the STATIC_DIRS. Using staticfiles_dirs in a template makes no sense. Not only your are passing a parameter that has to

Re: Django can't see my static files

2011-08-02 Thread Thomas Orozco
ave STATIC_URL = '/static/' in my settings.py file, and I have the correct methods listed under STATICFILES_FINDERS. > > But it is still not working. Do I have a syntax error somewhere? Or am I still missing something in another file? > > thanks, > Guillaume > > > On Mo

Re: Django can't see my static files

2011-08-02 Thread Thomas Orozco
omewhere? Or am I > still missing something in another file? > > thanks, > Guillaume > > On Mon, Aug 1, 2011 at 6:45 PM, Thomas Orozco <g.orozco.tho...@gmail.com >wrote: > >> If your css file is locatedr in your staticfiles dir, you should use >> something such

Re: Django can't see my static files

2011-08-02 Thread Thomas Orozco
Last thing, I made a typo, the address you could use should start with http, like: http://127.0.0.1/static/ Le 2 août 2011 12:01, "Thomas Orozco" <g.orozco.tho...@gmail.com> a écrit : > A little detail, but you never know: you should put some ' ' i

Django raises IOerror in csrf.py middleware

2011-08-02 Thread Thomas Orozco
Hello, I received a traceback from Django and I'm unable to figure out where the error comes from. The form is a basic picture upload form, I've read that this kind of errors do happen when the connection is broken before all data was sent, but here, the crash occured in csrf.py, which it was not

Re: HttpRequest.META['SERVER_PORT'] is a string?

2011-08-02 Thread Thomas Orozco
Basically everything (ok, almost) in request.META is strings, so I guess it would be pretty consistent if for some reason server port wasn't. It's usually your job to normalize data that comes into your application anyways. Le 2 août 2011 23:04, "Roy Smith" a écrit : > I'm

Re: if condition in template not working

2011-08-06 Thread Thomas Orozco
In your context you passed your 'lists' object as 'book'. So {% if book %} would work, but your current syntax won't. Le 6 août 2011 19:32, "shakthi" a écrit : > The if condition in my html template is not working, only else is > executing. > > view function is > def

Re: sendmail question

2011-08-08 Thread Thomas Orozco
Open works files that are on your hard drive, not with urls. That is : open('/var/www/myfile') works, but open('http://mysite/myfile') doesn't. You should not use the url of the file but its location on the disk (like /var/mymedia/myfile on Linux). If you really want to open it through the

Re: Passing tuple values to a model choices field

2011-08-08 Thread Thomas Orozco
Check out get_FOO_display, there: https://docs.djangoproject.com/en/dev/ref/models/instances/ Le 8 août 2011 11:06, "Kayode Odeyemi" a écrit : > In the Django [1], the example as described below shows how to build Forms > that are tied to a model. > > from django.db import

Re: Passing tuple values to a model choices field

2011-08-08 Thread Thomas Orozco
s that > the tuple values are not displayed as options in the form select > field(choices). > > Thanks > > On Mon, Aug 8, 2011 at 10:40 AM, Thomas Orozco <g.orozco.tho...@gmail.com >wrote: > >> Check out get_FOO_display, there: >> https://docs.djangoproject.com

Re: Passing tuple values to a model choices field

2011-08-08 Thread Thomas Orozco
Like they do in the admin, right ? You might want to check Django's source for the admin forms and templates to get some inspiration then. Hard coding the choices is never a satisfactory solution but I suggest you retrieve them from your models file so you stay DRY compliant and then it's pretty

Re: Set order from admin

2011-08-10 Thread Thomas Orozco
You can use a single foreign key and store last changed in your B model. You can then use object_a.b_set.order_by('myTimeStamp') Le 10 août 2011 10:23, "Isaac" a écrit : -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: "Great circle" using the django ORM?

2011-08-11 Thread Thomas Orozco
The distance is: Sqrt( Sqr(lat1-lat2) + Sqr(long1-long2) ) Le 11 août 2011 17:09, "Thomas Weholt" a écrit : > I got a model with longitude and latitude and want to be able to find > other objects nearby a selected object. Can this be done using the > django orm? What is

Re: "Great circle" using the django ORM?

2011-08-11 Thread Thomas Orozco
enough). > > On Thu, Aug 11, 2011 at 12:43 PM, Thomas Orozco > <g.orozco.tho...@gmail.com> wrote: >> The distance is: Sqrt( Sqr(lat1-lat2) + Sqr(long1-long2) ) >> >> Le 11 août 2011 17:09, "Thomas Weholt" <thomas.weh...@gmail.com> a écrit : >>&

Re: "Great circle" using the django ORM?

2011-08-11 Thread Thomas Orozco
Thank you both for the details! Le 11 août 2011 23:04, "Gelonida N" <gelon...@gmail.com> a écrit : > On 08/11/2011 06:43 PM, Thomas Orozco wrote: >> The distance is: Sqrt( Sqr(lat1-lat2) + Sqr(long1-long2) ) > > Try the formula close to the poles and you notice th

Re: Defunct Processes on Server

2011-08-12 Thread Thomas Orozco
You could avoid starting the child process in your view. If it's a long running process I would actually advocate doing so. This might be due to limited understanding on my part, but what happens when Apache wants to kill its child process because MaxRequests was reached? If you don't need the

Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Thomas Orozco
Change you regex to: r'^[a-zA-Z0-9]{1,4}' On Sat, Aug 31, 2013 at 5:41 PM, Gerd Koetje wrote: > Hi all, > > How do i valididate for this? > > - numbers and text only , no spaces > - max 4 number > > > > > def clean_profielnaam(self): > data =

Re: Form validation number and text only no space mac 4 numbers

2013-08-31 Thread Thomas Orozco
Oh, yes, we need to search for the end of the string: r'^[a-zA-Z0-9]{1,4}$' On Sat, Aug 31, 2013 at 6:03 PM, Gerd Koetje wrote: > that still allows space,weird chars and more then 4 numbers > > input: > dfdfdf565665&^^^ >

  1   2   >