Re: Django mysite problem

2011-09-14 Thread Yves S. Garret
Is Python in your path? On Wed, Sep 14, 2011 at 10:01 PM, PremAnand Lakshmanan wrote: > I have a problem executing this command, > > C:\Python27\Lib\site-packages\django\bin\django-admin.py startproject > mysite2 > > SyntaxError: invalid syntax > > I get the above error.. >

Re: Django mysite problem

2011-09-14 Thread Kejun He
Maybe reinstall django would resolve this problem On Thu, Sep 15, 2011 at 10:01 AM, PremAnand Lakshmanan wrote: > I have a problem executing this command, > > C:\Python27\Lib\site-packages\django\bin\django-admin.py startproject > mysite2 > > SyntaxError: invalid syntax > >

Django mysite problem

2011-09-14 Thread PremAnand Lakshmanan
I have a problem executing this command, C:\Python27\Lib\site-packages\django\bin\django-admin.py startproject mysite2 SyntaxError: invalid syntax I get the above error.. -- Prem -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Https with runserver

2011-09-14 Thread Gelonida N
On 09/15/2011 01:44 AM, Russell Keith-Magee wrote: > 2011/9/14 Simon Bächler : >> Any news considering HTTPS and runserver? > > What "News" are you expecting? > > The Django project has made no secret of the fact that we don't > consider runserver to be a "real" webserver. It

Re: Https with runserver

2011-09-14 Thread Aljoša Mohorović
if you need to simulate https for development, like for facebook apps, you can setup apache proxy. something like: ProxyPass / http://localhost:8000/ retry=1 ProxyPassReverse / http://localhost:8000/ ProxyPreserveHost On ErrorLog ${APACHE_LOG_DIR}/error.log

Re: Https with runserver

2011-09-14 Thread Russell Keith-Magee
2011/9/14 Simon Bächler : > Any news considering HTTPS and runserver? What "News" are you expecting? The Django project has made no secret of the fact that we don't consider runserver to be a "real" webserver. It isn't intended for production use. We haven't spent any time or

nested forms from model with manytomany

2011-09-14 Thread Visgean
Hello I have these two models: class SubOrder(models.Model): """ This is model for single order it should be used later in complex order """ product = models.ForeignKey(Product) quantity = models.SmallIntegerField() class Order(models.Model): "Model for complex

Re: Admin - delete with removing FK objects

2011-09-14 Thread galgal
I made what I wanted using signals:) All works now. I use post delete to be sure that object is deleted, than I remove images. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: PostGIS version error

2011-09-14 Thread Lucian Nicolescu
Make sure you run step 2.5 here on the current database before running syncdb: http://postgis.refractions.net/docs/ch02.html#id2619431 Did you do that? Lucian On Wed, Sep 14, 2011 at 11:39 PM, Dan H wrote: > I am getting the following error: > >

PostGIS version error

2011-09-14 Thread Dan H
I am getting the following error: django.core.exceptions.ImproperlyConfigured: Cannot determine PostGIS version for database "dbname". GeoDjango requires at least PostGIS version 1.3. Was the database created from a spatial database template? when i try to run: python manage.py syncdb and when

Re: newbie question on activating the automatic admin

2011-09-14 Thread nara
Finally! The admin interface worked, when I used the dev version in a virtualenv. I cleaned every trace of Django in my system, and I had to compile (requires python-dev package in Ubuntu) and install MySQLdb into the virtualenv. Not sure what exactly was wrong before, but Babatunde's suggestion

Image upload / embedding

2011-09-14 Thread Petey
I have an application which is designed for publishing blog posts etc. I upload images but normally they are at the end of the text because they are uploaded after I save the entry, that means I cant embedd them directly inside the text. Is there any way I can add new images directly inside

Re: Caching/Reload problem - cannot refresh model data

2011-09-14 Thread Ilian Iliev
Hi Tom, I checked the link you send and probably you are right but can you explain why this is a bad solution? Yes using autocommit() or disabling transactions seems more right are there any downsides of the update() that you are seeing? Image a case when you want to update the result set without

Re: Class-based views or "Traditional" Views for Django 1.3?

2011-09-14 Thread PFL
Reinout van Rees has posted several articles on using Django class based views that you might find useful (posted Aug 23/24 2011 ): http://reinout.vanrees.org/weblog/2011/08/24/class-based-views-walkthrough.html -- You received this message because you are subscribed to the Google Groups

Re: SCGI error

2011-09-14 Thread Andre Terra
On Wed, Sep 14, 2011 at 6:10 AM, Tom Evans wrote: I'm not entirely experienced with scgi or uWSGI, but I'm almost > certain that neither of them talk HTTP, which is what Firefox uses to > talk to servers. You need to connect your WSGI/SCGI server to a HTTP > server like

Re: Class-based views or "Traditional" Views for Django 1.3?

2011-09-14 Thread Kurtis Mullins
Thanks for the input from both of you! And Donald, I think I'll take you up on that offer. I'd really like to learn them. Hopefully down the line, when this initial project is out the door and I have solid understanding of the CBV's, I'll be able to contribute a little to the documentation as

Re: Class-based views or "Traditional" Views for Django 1.3?

2011-09-14 Thread Donald Stufft
Agreed, and fwiw both you Kurtis, and anyone else can feel free to ping me directly in #django if they need help getting the hang of CBV's, if i'm around (which I am most the day typically) I'll be more then happy to help. On Wednesday, September 14, 2011 at 9:54 AM, Andre Terra wrote: >

Re: Class-based views or "Traditional" Views for Django 1.3?

2011-09-14 Thread Andre Terra
OTOH, getting the hang of it can be hard with the current state of the docs and given that they require a completely different mindset when coding views. Cheers, AT On Wed, Sep 14, 2011 at 10:35 AM, Donald Stufft wrote: > Class Based Views let you override and

Re: Class-based views or "Traditional" Views for Django 1.3?

2011-09-14 Thread Donald Stufft
Class Based Views let you override and subclass views to modify their behavior, I find them to be very quick once you get the hang of them. On Wednesday, September 14, 2011 at 9:33 AM, Kurtis wrote: > Hey Guys, > > I'm relatively new to Django 1.3. As others have noticed, there is > less

Class-based views or "Traditional" Views for Django 1.3?

2011-09-14 Thread Kurtis
Hey Guys, I'm relatively new to Django 1.3. As others have noticed, there is less documentation around the Class-Based views than typical for Django. No needs for apologies as I have seen in other threads. I don't blame others for my lack of knowledge :) If I am working on a large project from

Re: order by + group by

2011-09-14 Thread Jani Tiainen
14.9.2011 12:46, Jonas H. kirjoitti: On 09/14/2011 11:37 AM, Иван Иванов wrote: The problem here is, like Peter said, that you cannot order before grouping. And that's very annoying. Of course you can, using a subselect just like I showed. SQLite example: > .schema CREATE TABLE a (name

Re: refreshing a page loaded via POST

2011-09-14 Thread Jacob Kaplan-Moss
On Wed, Sep 14, 2011 at 2:12 AM, mohammed safeer.mtp wrote: > if a user hits “Refresh” on a page that was loaded via POST, that request is > be repeated. > is there any remedy for this problem?? No, you can't prevent a web browser from re-POSTing forms. What you can do is

Https with runserver

2011-09-14 Thread Simon Bächler
Any news considering HTTPS and runserver? I tried the stunnel method but I get the message: Line 5: End of section https: SSL server needs a certificate. Stunnel also complains about the openssl version. I have 0.9.8r installed. The build of 1.0 fails on OSX. When I then try to access the page I

Re: setting the database when using a rawqueryset

2011-09-14 Thread Andre Terra
And I apologize for not even saying yours, Robert! Yours, André On Wed, Sep 14, 2011 at 9:32 AM, Andre Terra wrote: > Take a look at the aggregation docs at http://django.me/aggregation for > sum, group by, etc. > > > Cheers, > AT > > > On Tue, Sep 13, 2011 at 7:44 PM,

Re: Use of threading.local() ... what is the risk?

2011-09-14 Thread Russell Keith-Magee
On Sun, Sep 11, 2011 at 7:40 AM, Micah Carrick wrote: > I have > read https://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser and > numerous other discussions about the use of threading.local() yet I still > see it being employed in various projects. > I have recently

Re: setting the database when using a rawqueryset

2011-09-14 Thread Andre Terra
Take a look at the aggregation docs at http://django.me/aggregation for sum, group by, etc. Cheers, AT On Tue, Sep 13, 2011 at 7:44 PM, Robert wrote: > > I apologize for using AT rather than your name, Andre. > > On Sep 13, 6:42 pm, Robert wrote: >

Re: refreshing a page loaded via POST

2011-09-14 Thread Micah Carrick
After you successfully process a POST request, you can use a redirect to send the user back to the orginal page. On Wed, Sep 14, 2011 at 4:24 AM, Tom Evans wrote: > On Wed, Sep 14, 2011 at 8:12 AM, mohammed safeer.mtp > wrote: > > if a user hits

Re: Caching/Reload problem - cannot refresh model data

2011-09-14 Thread Tom Evans
On Wed, Sep 14, 2011 at 8:12 AM, Ilian Iliev wrote: > How are you pulling the data from the database in the desktop app - using > pure SQL or using the ORM? > > If using the ORM it is possible it to cache the results of the database so > you can run: > > mymodel.objects.update()

Re: refreshing a page loaded via POST

2011-09-14 Thread Tom Evans
On Wed, Sep 14, 2011 at 8:12 AM, mohammed safeer.mtp wrote: > if a user hits “Refresh” on a page that was loaded via POST, that request is > be repeated. > is there any remedy for this problem?? > Yes, don't load the page via POST. POST requests are meant to be used for

refreshing a page loaded via POST

2011-09-14 Thread mohammed safeer.mtp
if a user hits “Refresh” on a page that was loaded via POST, that request is be repeated. is there any remedy for this problem?? -- 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.

Re: order by + group by

2011-09-14 Thread Jonas H.
On 09/14/2011 11:37 AM, Иван Иванов wrote: The problem here is, like Peter said, that you cannot order before grouping. And that's very annoying. Of course you can, using a subselect just like I showed. SQLite example: > .schema CREATE TABLE a (name varchar, mod int); e> select * from a;

Re: Generic relation content_type does not exist

2011-09-14 Thread Bastian Ballmann
Hi again, maybe I get an answer if I ask the other way round. I've got an inline admin model with a generic foreignkey and I want to validate a set of it's properties in the models clean() method. If I add a new model neither content_type nor object_id is set in the clean() method, but if I

Re: order by + group by

2011-09-14 Thread Иван Иванов
На Wed, 14 Sep 2011 10:59:01 +0200 "Jonas H." написа: > On 09/14/2011 04:35 AM, Peter of the Norse wrote: > > What are you trying to do? The outer GROUP BY destroys the inner > > ORDER BY. Try putting them on the same level and see what happens. > > Say I've got an Event table

Re: SCGI error

2011-09-14 Thread David Markey
Correct, You need a webserver in front of manage.py runfcgi, which understands the protocol. To talk to django directly with your browser use manage.py runserver On 14 September 2011 10:10, Tom Evans wrote: > On Sat, Sep 10, 2011 at 9:05 PM, Brian Myers

Re: SCGI error

2011-09-14 Thread Tom Evans
On Sat, Sep 10, 2011 at 9:05 PM, Brian Myers wrote: > It seems I am getting an error from the WSGI server after all. As a reminder, > my uwsgi process is started from upstart like this: > > exec python /var/www/NurseTriage/triagedb/manage.py runfcgi protocol=scgi >

Re: Is there a way to provide a delete-hook on a custom field?

2011-09-14 Thread Иван Иванов
It's a bit offtopic, but: There is a project for non relational Django, and they have released backend for django and mongoDB. It might be interesting for you, if you don't know about the project: http://www.allbuttonspressed.com/blog/django/2010/05/MongoDB-backend-for-Django-nonrel-released На

Re: order by + group by

2011-09-14 Thread Jonas H.
On 09/14/2011 04:35 AM, Peter of the Norse wrote: What are you trying to do? The outer GROUP BY destroys the inner ORDER BY. Try putting them on the same level and see what happens. Say I've got an Event table and some records like this name: foo, timestamp: 9 pm name: foo, timestamp:

Re: Caching/Reload problem - cannot refresh model data

2011-09-14 Thread puppriss
Brilliant - that does the trick! Many thanks Ilian. A very simple solution yet I trawled the documentation and never came across it. Must've been looking in the wrong place. Yes, I'm using the ORM... and occasionally raw SQL for the app. Cheers Phil -- You received this message because you

Re: Caching/Reload problem - cannot refresh model data

2011-09-14 Thread Ilian Iliev
How are you pulling the data from the database in the desktop app - using pure SQL or using the ORM? If using the ORM it is possible it to cache the results of the database so you can run: mymodel.objects.update() This should clear the cache. -- eng. Ilian Iliev Web Software Developer