Will mange.py use a current running Django instance if available?

2011-03-17 Thread Matt Robenolt
If I have Django running with a wsgi adapter, and I execute a manage.py command, will it spawn a new instance of Django just to execute the command, or will it use an existing running instance? I need to make a decision on writing a command that will be hit pretty frequently by a node.js applicati

Re: Will mange.py use a current running Django instance if available?

2011-03-17 Thread Matt Robenolt
40 pm, Matt Robenolt wrote: > If I have Django running with a wsgi adapter, and I execute a > manage.py command, will it spawn a new instance of Django just to > execute the command, or will it use an existing running instance? > > I need to make a decision on writing a command tha

Re: Help with Apache/Nginx combo

2011-03-17 Thread Matt Robenolt
You set up a 'media.aplikacje' alias in your nginx config, but your media is still attempting to be pulled from 'aplikacje/media/', so at this point, your MEDIA_URL is wrong. MEDIA_URL needs to be 'http:// media.aplikacje/' Or, you can change the server{} config for nginx to have the alias / media

Re: Cannot import models.py in views.py

2011-03-17 Thread Matt Robenolt
You shouldn't be running manage.py from within any other directory but the top level project directory. That will screw up your PYTHON_PATH and potentially cause conflicts. Without seeing anything, if you go up a directory into just ~/webservices and ran `python manage.py shell`, you should be

Re: Error downloading dia2django

2011-03-17 Thread Matt Robenolt
Looks like the server is having an issue. Connections on https are timing out. And upon looking at the last modified date on the wiki page for it... it hasn't been updated in 3 years, so I'd safely say it no longer exists and definitely wouldn't work with any modern version of Django. -- You

Re: Defining global names

2011-03-18 Thread Matt Robenolt
You can't import a specific variable, you import the settings "package" and access the variable from it: from django.conf import settings print settings.APP_NAME1 But as Calvin says, this should not change throughout the project. It's essentially a constant. -- You received this message becau

Re: Help with Apache/Nginx combo

2011-03-18 Thread Matt Robenolt
That is correct. The point of the separate subdomain is to help deployments for the web. It's nicer and simpler sometimes to separate a domain or even an entire server dedicated for media or S3. On an intranet, you have a bit more flexibility. :) -- You received this message because you are su

Re: Django in low memory environments

2011-03-19 Thread Matt Robenolt
Try nginx and uWSGI instead of fcgi. http://projects.unbit.it/uwsgi/ -- 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+

Re: how to get csrf cookie in ajax app

2011-03-19 Thread Matt Robenolt
This is actually something new coming in Django 1.3, and by default is requiring all AJAX request to define an X-CSRFToken header. Fortunately, they've written about how to do it here and provided a jQuery implementation: http://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax -- You recei

Re: how to get csrf cookie in ajax app

2011-03-21 Thread Matt Robenolt
To get the token? It's stored in a cookie. You can read that in Javascript with document.cookie, then parse the cookie string to retrieve the relevant part. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

Re: how to get csrf cookie in ajax app

2011-03-21 Thread Matt Robenolt
use django isn't > serving the forms (which is when it usually sends the csrf cookie). > > > On Mon, Mar 21, 2011 at 9:49 AM, Matt Robenolt > wrote: >> To get the token? It's stored in a cookie. You can read that in Javascript >> with document.cookie, then par

Re: how to get csrf cookie in ajax app

2011-03-21 Thread Matt Robenolt
Hmm, is Django and this static file on two separate servers? It's looking like you might just want to do a @csrf_exempt. On Mar 21, 2011, at 6:35 PM, Brian Craft wrote: > No, it's not. It's a static file. > > On Mon, Mar 21, 2011 at 10:23 AM, Matt Robenolt > wrote: