Hi,
I'm trying to automate the restarting of Django's dev server with
Powershell. I've noticed that the server starts two processes. I can
retrieve and store the PID for just one of them, and I've found a
workaround that lets me kill the other before restart too, but not
entirely reliably (the P
Hi,
> When I try to set up my first Django project, I receive the following
> message:
>
> cd C:\DjangoProjects
> C:\DjangoProjects>django-admin.py startproject myproject
> Type 'django-admin.py help. For usage.
Have you tried this?
http://docs.python.org/using/windows.html#executing-scripts
This is a Python question. Python doesn't have "arrays", you are using
lists. Lists are indexed only by integers. What you want is a
dictionary, which can be indexed by any value. Change your first line to:
people = {}
and you should be all set.
--Ned.
http://nedbatchelder.com
Ted wr
Hello,
i've been away from django for quite a while. First of all, i'm really
impressed about the current state of django.
After porting most of my code to the current stable, i'm now trying to
understand how the save method of inlines can be overwritten. Here's a
stripped down version of my
> > So is that the list that you are talking about?
>
> I'm assuming those values corropond tot he fields on the model, any reason
> you can't do:
>
> self.model(**cursor.fetchone())
Just tried to do that but it seems to be returning things as a tuple
so I get the error:
ModelBase object argum
Dear all,
As I am still new to django, I have a question about the best practice
for placing templates. Do we put it inside the project folder or under
webserver directory?
Best regards,
--
If you can't believe in God the chances are your God is too small.
Read my blog: http://joshuajava.word
This is a continuation of a thread I started a couple of months ago
but didn't have time to investigate more:
http://groups.google.com/group/django-users/browse_frm/thread/dc2e49515ddcbf73?hl=en&tvc=1
It seems to be some problem with psycopg2 on my Ubuntu production test
machines as I am not get
Dear all,
I've already followed in the docs as instructed here
http://docs.djangoproject.com/en/dev/howto/static-files
And configured as following in my urls.py
if settings.DEBUG:
urlpatterns += patterns('',
(r'^media/(?P.*)$', 'django.views.static.serve',
{'document_root':
Darn,
It turns out that media/ is already used for admin :-( Using
site_media and it's running now.
On Mar 14, 11:55 pm, Joshua Partogi wrote:
> Dear all,
>
> I've already followed in the docs as instructed
> herehttp://docs.djangoproject.com/en/dev/howto/static-files
>
> And configured as fol
You can put them where you want but generally they go inside the application
folder that uses that template.
You may find this an interesting/helpful read;
http://www.djangobook.com/en/2.0/chapter04/
Dougal
---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/
2009/3/14 Joshua Partogi
On Sat, Mar 14, 2009 at 5:53 AM, Guillermo
wrote:
> Should I be seeing only one process instead of two when I start the
> dev server?
Nope -- two is normal behavior. One's the server itself, and the other
is the process that monitors your code on disk and reloads the server
when you make code ch
Well I fixed this by updating to the latest django trunk.
--~--~-~--~~~---~--~~
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 th
I usually create a template directory in the application directory,
and then sub directories underneath that. Helps when you need to start
translating I have found.
Or you could check out Bradley's GitHub project here:
http://github.com/bradleywright/django-layout/tree/master
--~--~-~--
Checkout the forms documentation for information on how to change what
the ModelForms generates:
http://docs.djangoproject.com/en/dev/topics/forms/#topics-forms-index
You should be able to change the types of fields and fields names/ids/
class names to then hook into your javascript.
--~--~-
wow, that's interesting. I was not aware if this.
So, coming to the real question, here is my use case which raised this
questions:
I've a class in the model with two CharFields. When validating data
inputs, I need to check that, if the user filled field A, then also
field B should contains some
Thanks Stephen. That helps a lot.
On Mar 13, 4:29 pm, Stephen DeGrace wrote:
> It's not putting anything into the session. The session is basically a
> jazzed-up dictionary, and the get method works pretty much just like it does
> with the dictionary, it will try and get the objected pointed to
On Sat, Mar 14, 2009 at 6:47 AM, timc3 wrote:
>
> > > So is that the list that you are talking about?
> >
> > I'm assuming those values corropond tot he fields on the model, any
> reason
> > you can't do:
> >
> > self.model(**cursor.fetchone())
>
>
> Just tried to do that but it seems to be retu
Thank you so very much for the insight and help...figured I was missing
something very obvious, and I was :)
As to the __unicode__ matter: I do have in the Market class that function
defined, but needed to pass additional information when returning the
string, but on the Admin of Aliases, it makes
thanks for the info. I'll track the ticket. for now, I just convert
the values to a dict and pass it over to my template.
On Mar 14, 12:27 am, Malcolm Tredinnick
wrote:
> On Fri, 2009-03-13 at 21:08 -0700, ihome wrote:
> > Hi,
>
> > I am using the latest django development version and have some
is there an easy way to control the precision for float values? for
example, i have this in my template:
where float p = 0.1234123413 but i only want to show p with 3 digits
after dot like 0.123. is there a predefined way to control the
precision in the rendering of template instead of having t
On Sat, Mar 14, 2009 at 11:02 AM, ihome wrote:
>
> is there an easy way to control the precision for float values? for
> example, i have this in my template:
>
>
>
> where float p = 0.1234123413 but i only want to show p with 3 digits
> after dot like 0.123. is there a predefined way to control
Hi django-heads, I found Martin Fowler's "Captcha for Django" here:
http://django.agami.at/media/captcha/. This is by far the easiest to
use captcha system for django that I've found on the 'net, but I
found it was outdated (not working w/ 1.0 or 1.1).
If anyone is interested, I've created a
EDIT: Oops! where did I get "Martin Fowler" from? It was "Martin
Winkler"!! (sorry Martin W)
On Mar 14, 11:21 am, bendavis78 wrote:
> Hi django-heads, I found Martin Fowler's "Captcha for Django"
> here:http://django.agami.at/media/captcha/. This is by far the easiest to
> use captcha
On Sat, Mar 14, 2009 at 11:23 AM, bendavis78 wrote:
>
> EDIT: Oops! where did I get "Martin Fowler" from? It was "Martin
> Winkler"!! (sorry Martin W)
>
> On Mar 14, 11:21 am, bendavis78 wrote:
> > Hi django-heads, I found Martin Fowler's "Captcha for Django" here:
> http://django.agami.a
> Nope -- two is normal behavior. One's the server itself, and the other
> is the process that monitors your code on disk and reloads the server
> when you make code changes.
I see. There must be some case where the automatic reload doesn't
work, then. I created the Powershell script because I ha
I'm running Python 2.4, Django 1.0.2 and Apache2 on my Debian Etch
box.
I have Apache configured to run multiple websites using the
VirtualHost paradigm. I've had an "Under Construction" message in
index.html at /var/www/mysitehome/htdocs. Apache served this without
problems whenever mysite.com
On Mar 14, 8:04 am, Sergio wrote:
> wow, that's interesting. I was not aware if this.
>
> So, coming to the real question, here is my use case which raised this
> questions:
>
> I've a class in the model with two CharFields. When validating data
> inputs, I need to check that, if the user filled
Am Samstag 14 März 2009 12:44:11 schrieb Dirk Eschler:
> myproject.news.models:
> ==
> class Post(models.Model):
> date = models.DateTimeField(default=datetime.now())
> release = models.ForeignKey(Release, null=True, blank=True)
>
> myproject.downloads.models:
> ===
thanks! this is exactly what i need.
On Mar 14, 12:04 pm, Alex Gaynor wrote:
> On Sat, Mar 14, 2009 at 11:02 AM, ihome wrote:
>
> > is there an easy way to control the precision for float values? for
> > example, i have this in my template:
>
> >
>
> > where float p = 0.1234123413 but i only w
On Fri, Mar 13, 2009 at 6:03 PM, Shantp wrote:
>
> I'm getting this error:
>
> AttributeError: 'NoneType' object has no attribute 'append'
>
> It's coming from this line in my template:
>
> {% scores_for_objects share_list as score_dict %}
>
> If I remove this line everything is fine. I wasn't ge
Hi,
I want to upload photos to directories structured by the album primary
key. I have the following model:
class Photo(models.Model):
album = models.ForeignKey(Album)
img = models.FileField(upload_to='albums/images/' + str(album.pk)
+ '/', blank=True)
The str(album.pk) part is not work
Hello:
I'm Trying to serialize a dict which have a list of Model's instance.
The format that i need is json. Something like that:
people = Person.objects.all()
res = {'res':0, 'msg':'Ok','data': people}
but, i need that result:
{'res':0, 'msg':'Ok','data': [{'id':1
On Sat, Mar 14, 2009 at 4:13 PM, Christoph Wegscheider <
christoph.wegschei...@gmail.com> wrote:
>
> Hi,
> I want to upload photos to directories structured by the album primary
> key. I have the following model:
>
> class Photo(models.Model):
>album = models.ForeignKey(Album)
>img = model
Am Samstag 14 März 2009 22:13:39 schrieb Christoph Wegscheider:
> Hi,
> I want to upload photos to directories structured by the album primary
> key. I have the following model:
>
> class Photo(models.Model):
> album = models.ForeignKey(Album)
> img = models.FileField(upload_to='albums/ima
I'd like to use a revision control system to keep up to 3 versions of
my Django project:
- A production version, which will be running on a remote Linux server
- A test version, which will be running on the same remote server for
my colleagues to test out before I make it public
- (Possibly) a lo
Am Samstag 14 März 2009 22:29:16 schrieb Dirk Eschler:
> def get_img_storage_path(instance, filename):
> return '%salbums/images/%s/' % (settings.MEDIA_ROOT, instance.album.pk)
Forgot the filename in my example...
def get_img_storage_path(instance, filename):
return '%salbums/images/%s/%
Hi,
I defined a form to load data from HttpRequest in views.py. For the
same function, sometimes, I need to pass a POST request while some
times I need to pass in a GET request.
For POST, I used
MyForm(request.POST)
to load the data and it works well.
For GET method, MyForm(request.POST) does
On 14 Mrz., 22:42, Dirk Eschler wrote:
> Am Samstag 14 März 2009 22:29:16 schrieb Dirk Eschler:
>
> > def get_img_storage_path(instance, filename):
> > return '%salbums/images/%s/' % (settings.MEDIA_ROOT, instance.album.pk)
>
> Forgot the filename in my example...
>
> def get_img_storage_pa
On Sat, Mar 14, 2009 at 4:54 PM, ihome wrote:
>
> Hi,
>
> I defined a form to load data from HttpRequest in views.py. For the
> same function, sometimes, I need to pass a POST request while some
> times I need to pass in a GET request.
>
> For POST, I used
>
> MyForm(request.POST)
>
> to load the
Karen,
Apologize for the late reply. Thanks for the excellent catch, it was
indeed an IPv6 issue. I just had to update my hosts file on windows
vista to include an entry for 127.0.0.1 and it worked!
Thanks again
CG
On Mar 10, 10:02 pm, Karen Tracey wrote:
> On Tue, Mar 10, 2009 at 7:12 PM, CG
On 14 Mar, 21:42, Rex wrote:
> I'd like to use a revision control system to keep up to 3 versions of
> my Django project:
...
> So far I have been planning to use Bazaar for version control.
Good choice.
> - How can I simultaneously run two versions of the same project on the
> same machine? I
> everything works great with the test server.
This tells you that the problem is most likely not with your urls.py
or any of your Django code, so you've cracked that part.
> I again cycled Apache off and on. My "Under Construction" message is
> gone but only the only thing returned to a mysit
On 14 Mar, 04:30, Malcolm Tredinnick wrote:
> On Fri, 2009-03-13 at 21:27 -0700, Flank wrote:
> > in order to use django/conf/urls/defaults.py, handler404, i did 2
> > things:
> > 1:change DEBUG = False in settings.py
> > 2:create a 404.html template in the root of the template directory
>
> >
I am trying to set up my Django app behind Apache with mod_python, and
you may have seen this error many times before, but the underlying
EACCES really puzzles me.
CentOS 5.2, Apache 2.2.3, mod_python 2.4.3. /etc/httpd/conf/
httpd.conf says, in part:
SetHandler python-program
P
On Sat, Mar 14, 2009 at 9:16 PM, Jim Hickstein wrote:
>
> I am trying to set up my Django app behind Apache with mod_python, and
> you may have seen this error many times before, but the underlying
> EACCES really puzzles me.
>
> CentOS 5.2, Apache 2.2.3, mod_python 2.4.3. /etc/httpd/conf/
> htt
Ferg,
Thanks for such a thoughtful reply!
Your point about placing my directive inside a
directive was well taken. In fact, I did finally find a
thread within the group that also spoke well to my problem:
http://groups.google.com/group/django-users/browse_thread/thread/8dab49bd8565a53a/57bd8
Alex Gaynor wrote:
> This isn't stricly related, probably, but you generally shouldn't be putting
> your django projects in your docs root:
DocumentRoot is /var/www/html in fact. So it's not. But thanks for the
reference.
> http://www.djangobook.com/en/2.0/chapter02/#cn76 explains why not. P
On Mar 4, 12:47 pm, John Maines wrote:
> Hello:
>
> I've installed Django 1.0 on Ubuntu and am trying to get it to run on
> Apache. Apache is installed, working fine, with mod-python also in
> place. I'm new at everything Linux.
>
> But when I try to run my app (a test blog), Apache gives an
> Im
On Sat, 2009-03-14 at 19:52 -0700, Rex wrote:
[...]
>
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE mysite.settings
> PythonOption django.root /home/rex/django/mturk
*sigh* Will people please stop *guess
I have the ModelForm below to let the user edit some of their basic
User fields like username, first/last name and email. During testing,
I discovered that I could edit and save a username that included non-
alpha characters. When I log into the admin system, the username is
set to the new value
On 14 mar, 22:14, MartinBorthiry wrote:
> Hello:
>
> I'm Trying to serialize a dict which have a list of Model's instance.
> The format that i need is json. Something like that:
>
> people = Person.objects.all()
> res = {'res':0, 'msg':'Ok','data': people}
>
> but, i need that
Hello,
what follows is NOT a solution to your needs, but I wanted to chime
in with a workflow that has proved effective to my three-developers
team. We have two "environments": developer and production. Each
developer has, in their respective home directory (be that Windows or
Linux,) a file cal
default (see active field) does not seem to propagate - see below
(Postgres 8.3.6 - current Django as of yesterday)
Any ideas?
TIA
Kai
class Client(models.Model):
login = models.CharField(max_length = 20, unique=True)
password = models.CharField(max_length = 10)
created=
default (active field) does not seem to propagate - see below
(Postgres 8.3.6 - current Django as of yesterday)
Any ideas?
TIA
Kai
class Client(models.Model):
login = models.CharField(max_length = 20, unique=True)
password = models.CharField(max_length = 10)
created= models.
On Sat, 2009-03-14 at 21:51 -0700, kpeters wrote:
> default (see active field) does not seem to propagate - see below
> (Postgres 8.3.6 - current Django as of yesterday)
>
> Any ideas?
That's normal behaviour; Django has never set up the default value on
the database column. There are at least a
I'm building an app to serve the main pages for each category of a
news site. For this, I need to have several different ways to display
article teasers. For example, in one part of a page I might want to
display the teasers for five specific articles; in another part of the
page, I'd want to show
On Sat, 2009-03-14 at 22:17 -0700, Michael Strickland wrote:
> I'm building an app to serve the main pages for each category of a
> news site. For this, I need to have several different ways to display
> article teasers. For example, in one part of a page I might want to
> display the teasers for
57 matches
Mail list logo