> Hmmm, I understand
> Put the {% load current_time%} in the template, but I do not know
> why, is looking in the wrong place.
> "django.templatetags.current_time,"
>
> The right would be:
> "myproject.myapp.templatetags.current_time"
>
> showing that error here:
> TemplateSyntaxError at /myapp/
> Okay, so whenever I request anything through my apache server I get a
> 404 error. Here are my configuration files.
>
> Apache:
>
> DocumentRoot /home/chainsofheaven.net/html
> ServerName chainsofheaven.net
> ServerAlias *.chainsofheaven.net
>
> allow from all
> Options +Indexes
>
>
> SetHan
> I tried doing what you suggested, but now it gives me the error
> 'RegexURLResolver' object has no attribute 'rindex' when I try to go
> to the admin page (or any page that exists, for that matter. Pages
> that don't exist get an unhandled exception).
Can you show us your url setup as you have
> I'm trying to set up my site on a university webspace, so the root is
> a subdirectory, ie www.university.edu/~mysite/. Because of this, I'm
> having trouble logging into the admin pages. I go to
> www.university.edu/~mysite/admin/
> and get the login page, but when I try to login, it goes to
>
> I have a problem with the development server. I don't know if this
> behavior is right or if there is a problem.
> I have a view which is triggered throught an url. In this view I use
> urllib2. If I start the view with the development server the process
> is never ends. But if I start the view
>> And a slightly problematic part is sqlite, which doesn't allow you
>> to ALTER tables (or at least not adding a column to a table); I
>> use sqlite mainly for testing & developing, recreating it every
>> time one of my model changes (the thing there that I found the
>> most hassle is
or it, or wait until the server's back up.
> On Apr 1, 10:53 am, Evert Rol <[EMAIL PROTECTED]> wrote:
>>> I am a newbie learning Django and so far loving the process. I'm
>>> going
>>> through the djangobook.com and came across a problem.
>&
> I am a newbie learning Django and so far loving the process. I'm going
> through the djangobook.com and came across a problem.
>
> In chapter 5 you create your first database (how exciting!) problem is
> it seem like everyone that went thought this chapter(including me) got
> this error:
>
> "~/
> I thought that I could add in some additional information to a form
> before it gets saved as a new object in the database but the following
> isn't working:
>
> def groupadd(request):
>
>if request.method == 'POST':
>form = GroupForm(request.POST)
>if form.is_valid():
>
> I just found a post where they do this ..
> testform = BookingFormOne(initial={
> 'u_1stline': user.get_profile().currentAddress.street1,
> }
>)
> as in call initial when the form class is called. and it seems to
> work!?!
>
> can any one explain why thou? as i still dont get why
> I am a newbie with Django and was trying to get it work on windows
> vista following the tutorial at
> http://www.djangoproject.com/documentation/0.96/tutorial02/
> .
>
> After "activating the admin site" as suggested in the tutorial, I got
> the following error
>
>
>
> Using the URLconf define
> I was wondering why you can only call "python manage.py syncdb" to
> create your databases but after that if you change your models file
> it work create the changes and you have to do them manually using SQL?
I think there are several threads in this discussion group that have
some menti
> I read there:
> from django.shortcuts import render_to_response
> from mysite.polls.model import Poll
> def index(request):
>latest_poll_list = Poll.objects.all()
> &c.
>
> What is 'latest_poll_list'? I assume it is a list, but a list of what?
> Records? Can I cycle through that list (for
> Probably another stupid question (sigh), but looking at views.py and
> having read just about all the documentation I could find (including
> the Django book), I still do not see how I can get data from a
> database into a web page. The Django book explains how it is done
> using the live interp
Perhaps this is useful: http://www.djangosnippets.org/snippets/546/
It even has a ticket: http://code.djangoproject.com/ticket/6398 with,
of course, ensuing discussion.
>
> I was looking at jinja[1] and there was one feature which I really
> liked
> "for loops have an optional else block exe
> the transparency is inside class tableSlot, when i'm looping
> tableSlot, it works fine... but when i add the columnsetup or
> querysetup, i got the error.. maybe my query is wrong? :(
Sorry, no idea so far, but there's probably still information lacking:
> > >ds = DigitalSignage.obje
> I have a model:
>
> from django.db import models
> from django import newforms as forms
> from django.contrib.localflavor.us import forms as us_forms
>
> class Address(models.Model):
> member = models.ForeignKey(Member, unique=True)
> street = models
> I just installed Django 96.1 on my Mac. When I follow the tutorial
> and get to the Admin page, the calendar pop ups don't show up. Is
> there a problem with the install. I'm using Leopard.
Could be your browser (javascript problem). What browser & version are
you using; have you tried ano
> render_to_response('template', *args, **kwargs):
> kwargs looks like a dictionary but if I refer to a dictionary, it is
> ignored:
>
> In
>names = {}
>names['my_name'] = "somename"
>render_to_response('template.html', names)
>
> names is equivalent to {'my_name': 'somename'}, so I wo
Have you tried installing iPython? I can remembers your history across
sessions, and has lots of other niceties (eg, you can define a default
set of import statements on startup).
If installed, python manage.py shell will automatically pick it up.
> Thanks Christian, that's a great tip!
>
>
> Path in Windows XP Home is:
> D:\Phyton25\;D:\Python25Scripts;%SystemRoot%\system32;%SystemRoot%;
> %SystemRoot%\System32\Wbem
>
> When I use the interpreter in PyScripter, I see:
print sys.path
>
> ['C:\\Windows\\system32\\python25.zip', 'D:\\Python25\\Lib', 'D:\
> \Python25\\DLLs', 'D:\\P
super(querySetup, self).save() # Call the "real"
> save() method.
> for tl in self.tableList.all():
> tl.setting.lastUpdate = datetime.now()
> tl.setting.save()
>
> class Meta:
> verbose_name = ('Query Setup')
&
> ds = DigitalSignage.objects.get(pk=ds_id)
> #Digital Signage config & setting
> setting = ds.setting
> textslots = ds.textslot_set.all()
> slots = ds.slot_set.all()
> tableslots = tableSlot.objects.filter(DS_List=ds)
> columnsetups = columnSetup.objects.f
> directory. Also, when I run locate base_site.html from within the
> shell, it only returns the default base_site.html located in the
> django/contrib/admin/templates/admin/ directory. When I cd into
locate uses a database which doesn't always get promptly updated.
Waiting a few hours (or perh
> You've understood me perfectly. I was just being picky. I would
> *like* to preserve the option of cased usernames, but if wikimedia
> doesn't fuss with it, why should I? I'll just add a clean_username
> method to the registration form that .lower() 's the name entered as
> suggested.
> Thank
>>> 2) Validate new usernames for case-insensitive uniqueness and filter
>>> with case-insensitive queries whenever the username is URL param.
>
>> def view(request, username, child=None, ...):
>> username = username.lower()
>
> The problem here is that that even if 'Charlie' and 'charlie' canno
Looks like you have a cookie in the webbrowser on your desktop, for
the localhost domain (have you been trying to run a wiki-page there?).
Try clearing that cookie, then reload/restart the dev-server.
> I've already run Django on my Laptop (OpenSuse 10.3) and it was so
> easy thanks to it's
> I am writing an application that involves a number of nested parent-
> child relationships, where users create objects that each in turn have
> sub-objects. So far the URL structure looks like this:
>
> example.com/username/
> example.com/username/child1/, example.com/username/child2/
> example
> thanks for reply, but i don't quite understand :( sorry i'm newbie
> here
> First my models.py is like this
> class DigitalSignage(models.Model):
> DS_ID = integerField()
>
> class tableSlot(models.Model):
> ds_id =models.ManyToManyField(DigitalSignage)
>
> class columnSetup(models
> hi all, needs help here. i declare this in views.py
>
>ds = DigitalSignage.objects.get(pk=ds_id)
>setting = ds.setting
>textslots = ds.textslot_set.all()
>slots = ds.slot_set.all()
>tableslots = ds.tableslot_set.all()
>columnsetups = tableslo
> If your python interpreter can't import django, you installed it
> wrong.
> C'est tres facil.
One of the previous post in this thread mentions the development
server works fine, so django can be imported from the shell
apparently. But testing that will never hurt; there may happen to be a
>> Thanks, Evert! I could check now that the table is correct - and,
>> with
>> some experimenting, I found the mistake I had made too: I had, in
>> models.py, in class Admin, entered "ordering = ('nummer')" instead of
>> "ordering = ['nummer']".
>>
>> Perhaps somebody can explain why list_displ
> Thanks, Evert! I could check now that the table is correct - and, with
> some experimenting, I found the mistake I had made too: I had, in
> models.py, in class Admin, entered "ordering = ('nummer')" instead of
> "ordering = ['nummer']".
>
> Perhaps somebody can explain why list_display and list
> I don't mean to be overly critical, its not a bad application, but
> if its marketed to 'perfectionists' then I guess you have to expect
> people to be demanding =)
Yup. But in their defence: the software comes completely free, and
does work mostly out of the box.
Anyway, perhaps this is
> I deleted the database again - run syncdb again - clicked 'Change' and
> bingo: same error message! No date entered, this time. Only this one
> table in the database... Is this typical for sqlite?
I've never experienced anything like this with sqlite.
What does your model look like; there may
> I guess by "bug" I meant that
>
> synchronizing, by its nature involves making two disparate things
> congruent.
>
> syncdb does not do that.
Well, it does, up to the part that 'it' (the writers) feels confident
about: it synchronizes the database globally with newly added models;
indeed
> I got this error when I added a field to my models, ran sycndb.
>
> I believe I got this error because syncdb failed to actually add the
> correct column to the database to reflect the changes I had made to
> my models.
>
> I believe this is a bug in syncdb, but maybe someone more
> experi
> EDIT: After writing all of the stuff below, I got it working, at least
> somewhat. I usually used sudo to run the dev server because I wanted
> to run it on port 80 (nevermind why, long explanation). Doing that
> still produces the same error, but if I run it without the sudo, it
> works. I have
> I recently upgraded from OS X Tiger to 10.5 Leopard. I've been trying
> for the last two days to get my Django development setup working
> again. There seems to be a row of pitfalls involved in this but I
> think I've gotten at least a part of the way.
Apple did change several settings re: Pyth
> I'm just going through the mysite tutorial and can't seem to get the
> __str__() method to work when adding it to the two classes, I still
> get [].
>
> polls/models.py:
>
> from django.db import models
> import datetime
>
> class Poll(models.Model):
>question = models.CharField(maxlength=20
> I am just starting out with django (and python). I have already worked
> through the tutorial successfully; now I am going through it again
> adapting the examples to suit the web app I want to build (a local
> book sharing scheme). What I have done so far is to define the models,
> create the d
> I am having a bit of trouble posting checked items from a form to my
> view so I can save it to a database table.
> The data in the form are information that has been stripped from a
> file so there is no database link/referencing there.
>
> What I have done half works as it does post my selecte
You might be better off asking here:
https://sourceforge.net/forum/forum.php?forum_id=70461
> I'm trying to build MySQL-python-1.2.2 and I don't understand how to
> fix these errors:
>
> running build
> running build_py
> copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.5/MySQLdb
> run
On 24 Mar 2008, at 19:29 , Tim Sawyer wrote:
>> The second thing to do is to read the template documentation to see
>> what is available, because doing so will turn up things like this:
>>
>> http://www.djangoproject.com/documentation/templates/#divisibleby
>
> I saw that, but I couldn't work out
> This is more a Python issue than a Django one, but I thought the
> Python-aware people that you are might be able to help me :)
>
> I would like to do something like:
>
> def called(arg)
>if arg==True:
>!!magic!!caller.return 1
>
> def caller(arg)
>called(arg)
>return 2
>
> H
> File
> "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
> site-packages/django/db/backends/mysql/introspection.py",
> line 1, in
>from django.db.backends.mysql_old.base import DatabaseOperations
> ImportError: No module named mysql_old.base
>
>
> I'm using Python 2.5.1 and
> thanks that did work!
>
> I did have max_length but it didn't like it
>
> must update django??
No, probably not yet then. I'm just using 0.97pre, where the warning
showed up. Probably doesn't in 0.96, but keep it in mind in case you
do update. (Unless of course you're still at 0.95.)
--
> Hi there
> I am having a problem with ForeignKey(Class) in my models.py
> if the Class it comes before the class then it says I should put it in
> quotes.
>
> ForeignKey('Class')
>
> put when i run python manage.py validate to check its ok it doesn't
> like it
You didn't give the error from m
> I am going Django (liking it so far), and I seem to hit a wall with
> one of the exercises. It likely because of my unfamiliarity with
> Python, so bear with me, please.
>
> At the end of Hour 6, I got two exercises to do:
>
> 1. Create an additional view for the People object that displays
>> So far many editors/IDEs have been put on the table here, let me
>> remind you:
>
> Free as in freedom:
> * OpenKomodo
> * UliPad
> * PIDA
> * Eric
> * Boa Constructor
> * Eclipse + Pydev
> * Kate
> * Geany
> * SPE
> * Vim
> * PyPE
>
> Non-free:
> * Komodo
> * Textmate (mac only)
> * Coda (ma
> I am new to django, and I am trying to create a custom login
> application, from where the users might get access to other
> applications in the system. I can not get it to work, please, I need
> help.
Well, what exactly isn't working? That may give people a better start
on where to look than
> I need to optimize some code related to django db api.
> Imagine a model like this:
>>
> class Languages( models.Model ):
> name = models.CharField( max_length=255 )
> ...
>>
> class Object ( models.Model ):
> name = models.CharField( max_length=255 )
> langua
>>> I need to optimize some code related to django db api.
>>> Imagine a model like this:
>>
>>> class Languages( models.Model ):
>>> name = models.CharField( max_length=255 )
>>> ...
>>
>>> class Object ( models.Model ):
>>> name = models.CharField( max_length=255 )
>>> languages = models
> I can't figure out where to put css files or background images
> referred to by
> css. I have:
>
>
> and
> MEDIA_ROOT = '/home/phil/philproj/media/'
Don't you need a '/media/' or something before that 'dirview.css'?
What is your MEDIA_URL?
Since Django normally has the media files (css, i
e, which explains the error. My question is how do I add this
>> path in the cron, especially since the script runs from the command
>> line?
>>
>> On Mar 4, 9:02 am, Evert Rol <[EMAIL PROTECTED]> wrote:
>>
>>>> Well part of the problem is that the
> I was wondering if it's possible to add a ManyToManyField onto a
> prebuilt Django model such as User... I know that it would look like
> this if I were to have created the model myself:
> class User(models.Model):
> watch = models.ManyToManyField('self', null=True, blank=True)
>
> I'm unsu
> OK, I did what you instructed and checked the log file, which did
> contain the system path and the traceback about the "can't import
> module...".
Your script did run (you thought it completely failed), but -only- up
the 'import feedparser' part. Anything before that ('print sys.path')
act
> Well part of the problem is that the script itself works fine. I can
> run from the command line without a hitch. But when I try to run it
> via the cron, I get the traceback about the feedparser module.
I believe that, because your PYTHONPATH will be set correctly from the
command line; but
> I'm not sure where to print the path. Do I add that to the
> update_feeds.py? Or does this go in the cron itself?
>
> If I add it to the script, and then run the script from the command
> line, it prints what's on my python path and then runs the script as
> normal.
>
> But that's never been the
> Unfortunately, I get the same traceback:
>
> Traceback (most recent call last):
> File "update_feeds.py", line 10, in ?
> import feedparser
> ImportError: No module named feedparser
Again: did you print the sys.path?
The 'cd' is not going to work, unless your modules are relative to
the /p
> No, I haven't tried that. How would I go about citing that?
Top of script (possibly just below the she-bang):
import sys
print sys.path
>>> Traceback (most recent call last):
>>> File "/path/to/script/update_feeds.py", line 10, in ?
>>> import feedparser
>>> ImportError: No module named fe
>
> Traceback (most recent call last):
> File "/path/to/script/update_feeds.py", line 10, in ?
> import feedparser
> ImportError: No module named feedparser
>
> And here is the cron:
>
> export PYTHONPATH=/path/to/python2.3/site-packages:/path/to/django/app
> export DJANGO_SETTINGS_MODULE=myproj
> I need to optimize some code related to django db api.
> Imagine a model like this:
>
> class Languages( models.Model ):
>name = models.CharField( max_length=255 )
>...
>
> class Object ( models.Model ):
>name = models.CharField( max_length=255 )
>languages = models.ManyToManyFie
>
>
> # urls.py
>
> urlpatterns = patterns('',
>(r'^addorder/', add_order),
>(r'^addorder/results/', results),
> )
Not 100% sure, but try adding a $ at the end of your regexes, to
indicate there's nothing after the url. Django now finds the
r'^addorder/' also for the url 'orders/resul
> Daniel,
> Now i'm getting the error:
>
> Could not parse the remainder: ' "jS o\f F"' from 'a.date|date "jS o\f
> F"'
>> It's a variable, not a tag, so use {{ a.date|date "jS o\f F" }} - ie
>> {{ }}, rather than {% %}.
>
Shouldn't there be a colon between the filter and its arguments:
{{ a.dat
> I put this in my urls file:
>
> (r'^site_media/(?P.*)$', 'django.views.static.serve',
> {'document_root': 'C:\django\Django-0.96.1\django\contrib\admin
> \media'}),
>
> but the program still can't find the dashboard:
>
>
Check your ADMIN_MEDIA_PREFIX in your settings.py file, and make su
> There is a threaded comments app http://code.google.com/p/django-
> threadedcomments/
> , Now that I think about it, they surely would be doing this
> conversion from relational to hierarchical format. I will read the
> code and let you know if I can find something useful.
While I had been sea
> That would be true if I defined both models in the same models.py, and
> Profile was trying to use Bookmark before it was loaded in the file.
> Because this is an import the quotes won't work. That being said this
> in one model works when I don't need to put a import statement in it.
> So:
>
>
> I have a model like
>
> class Task(models.Model):
> name = Models.CharField(max_length = 100)
> parent = models.ForeignKey('Task', null = True)
>
> Using this model say I have got a table like,
>
> Task
> ---
> ID Name Parent_id
> 1 Foo null
> 2 Bar 1
> 3 Baz1
> 4 B
On 21 Feb 2008, at 16:44 , Michael Newman wrote:
>
> I am a bit confused as to why it is that this gives me an error. I
> hope someone could explain it to me.
>
> Let's say I have users with Profiles that can be connected to the one
> Web page that they can author. The other Users can bookmark t
70 matches
Mail list logo