Hey,
I'm trying to create Admin application for my Django project, here are
some snippets:
+++
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/(.*)', admin.site.root),
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
> I'm just getting started on django and I'm using a Windows Vista
> version. Yesterday I completed about half of the tutorial without too
> much difficulty. Now I'm trying to carry on from where I stopped.
> The first thing I need to do is to restart the test server, so I go
> into the 'mysite'
Hey,
What is the difference between:
query = request.GET.get('q', '')
and
(r'^time/plus/(\d{1,2})/$', hours_ahead)
And when to use each approach?
Thanks guys.
#I'm new to Django, forgive my simple questions :)
--~--~-~--~~~---~--~~
You received this message because
Hey,
My Django project has the following structure:
+++
djcode
# Django files (urls.py ...)
templates (for storing template pages)
books
# books application files (models.py ...)
publisher_list.html
+++
Here is a snippet from settings.py
TEMPLATE_DIRS
On Sun, 2009-01-04 at 01:01 -0800, HB wrote:
> Hey,
> What is the difference between:
> query = request.GET.get('q', '')
> and
> (r'^time/plus/(\d{1,2})/$', hours_ahead)
> And when to use each approach?
> Thanks guys.
> #I'm new to Django, forgive my simple questions :)
GET parameters (the first
On Sun, 2009-01-04 at 01:39 -0800, SG_Muse wrote:
> Anyone?
Clearly not.
I really hesitate to give a response to such an email, since if somebody
had an answer, they would have posted it. Jumping up and down and saying
"me, me, answer my question" is a bit inconsiderate of volunteers time,
parti
Hi everyone,
I have a (technical) problem with middleware, and also I’d be grateful to hear
some suggestions about the general workflow. Doubtless all of you are
familiar with a topic as simple as POST handling, and maybe some of you have
improvements over the usual Django approach.
So, I have
We have a website made by Django. And we have no problems when access
similar url on local working environment:
http://site/tags/c%23/
"c%23" is urlencode of "c#", that works fine locally.
While we deployed on Bluehost(apache+fastcgi), it has been resolved to
a new address like this:
http://site/
On Jan 4, 2009, at 8:14 PM, HB wrote:
>
> Well, sorry but where to add those lines?
In your settings.py file. There might not be a MIDDLEWARE_CLASSES
value at all at the moment (though I can't imagine where it went), so
make sure there's something like this in settings:
MIDDLEWARE_CLASSES
Hi there,
I'm struggling to make caching middleware work with i18n middleware,
with no success though (a user can't change the language - since he
gets the first cached language site...). Those nifty decorators for
vary headers don't help too. Same goes for the middleware itself -
I've tried to
Hi there,
I'm trying to override the edit_inline_stacked template so I can
dynamically add in extra inline data via javascript - similar to
http://www.arnebrodowski.de/blog/507-Add-and-remove-Django-Admin-Inlines-with-JavaScript.html
I can override the change_form admin template, but can't se
Thanks it works now.
I got a page to manager Users, Groups and Sites
My purpose was to test Admin pages for my models.
Any ideas how to do that?
Forgive me again, I'm new to Django and I'm a little lost.
Thanks in advance.
On Jan 4, 4:39 pm, Eric Abrahamsen wrote:
> On Jan 4, 2009, at 8:14 PM, H
Well, sorry but where to add those lines?
On Jan 4, 2:11 pm, Eric Abrahamsen wrote:
> On Jan 4, 2009, at 8:00 PM, HB wrote:
>
>
>
>
>
> > Here is the full traceback:
> > +++
> > Environment:
>
> > Request Method: GET
> > Request URL:http://localhost:8000/admin/
> > Django Version: 1.0.2 final
>
On Jan 4, 2009, at 8:00 PM, HB wrote:
>
> Here is the full traceback:
> +++
> Environment:
>
> Request Method: GET
> Request URL: http://localhost:8000/admin/
> Django Version: 1.0.2 final
> Python Version: 2.5.2
> Installed Applications:
> ['django.contrib.auth',
> 'django.contrib.contenttypes',
I think you can try accessing books/publisher_list.html instead of
just publisher_list.html
This should solve the problem, if I understand it correctly.
Regards, Alex A.
On Jan 4, 11:11 am, HB wrote:
> Hey,
> My Django project has the following structure:
> +++
> djcode
> # Django files
Try something like:
students = Student.objects.all()
absences = Absences.objects.all()
for absence in absences:
students.remove(absence.fk)
Maybe I'm wrong somewhere in the syntax, but the idea should be clear.
Regards, Alex A.
On Jan 2, 6:57 pm, Mathieu Steele wrote:
> Here is an example
I wouldn't say it's frowned upon, per se, but you're making things
hard for yourself. Why not add Django to your Python path?
There are other ways to go, too...
In the shell you're working in:
$ export PYTHONPATH=~/pkg/django-trunk
Then ./manage.py will find it without editing the file.
For my
Did you create any new application and did not include in your
settings.
On Jan 4, 5:06 pm, rvwilliams wrote:
> OK I've given up on trying to run the tutorial on Vista. Instead I've
> used VirtualBox and set up Debian Lenny as a virtual machine. This
> gives me Python 2.5 and Django 1 and so f
I'm working on a project that is doing this and wrote a data migration
script. The gist of it is that it connects to the old MySQL database
using straight MySQLdb, and connects to the new Postgresql database
using Django and the ORM. I iterate over all tables and such and call
my ORM methods to
Hi list,
I have a web app which is a kind of arbitration application. Users bid on some
products or projects and the one who gives the biggest price gets the
project. Every project has some bidding expiration time. What i need is how
can i handle the situation to change the status of the proje
Here is the full traceback:
+++
Environment:
Request Method: GET
Request URL: http://localhost:8000/admin/
Django Version: 1.0.2 final
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'djang
On Jan 4, 2009, at 4:58 PM, HB wrote:
>
> Hey,
> I'm trying to create Admin application for my Django project, here are
> some snippets:
> +++
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
> (r'^admin/(.*)', admin.site.root),
> )
>
> INSTALLED_APPS = (
Rob Hudson wrote:
> I wouldn't say it's frowned upon, per se, but you're making things
> hard for yourself. Why not add Django to your Python path?
>
> There are other ways to go, too...
>
I use buildout, which lets me specifiy which eggs I want to use for each
project,
extra svn checkouts, s
OK I've given up on trying to run the tutorial on Vista. Instead I've
used VirtualBox and set up Debian Lenny as a virtual machine. This
gives me Python 2.5 and Django 1 and so far I haven't encountered any
more problems. Incidentally, Seamless Mode in VirtualBox is really
great as I get window
Anyone?
--~--~-~--~~~---~--~~
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+unsubscr...@
On Jan 4, 2009, at 7:19 PM, HB wrote:
>
> I don't have middleware classes.
> I just created some model classes and tried to create Admin
> application for them.
> Maybe I have to comment some of INSTALLED_APPS that Django uncomment
> them by default.
> Suspects are auth, contenttypes, sessions
>
you probably need to create an admin.py file in your application
directory.
from:
http://docs.djangoproject.com/en/dev/intro/tutorial02/#make-the-poll-app-modifiable-in-the-admin
something like (...project/app/admin.py):
from mysite.polls.models import Poll
from django.contrib import admin
admi
Hi,
thanks for taking time to provide such a detailed answer.
> You can and should split up your code into separate functions however
> you like. Form validation can be done in a separate function that
> returns a dictionary that is used to update the context of the calling
> view, for example. Y
On 03.01-02:10, Szymon wrote:
[ ... ]
> So there is any other working solutions for migrating MySQL ->
> Postgre?
i would suggest that you do this via the database not via django.
simply alter your 'settings.py' to point to your new postgres database
and sync it to create all the relevant tables.
Hi,
I keep my django-trunk installation (and other things like
django_evolution) in my home directory, outside the system-wide
installation To avoid having to set PYTHONPATH in the environment, I
set do this in my project settings.py file:
# sys.path trickery
-
Maybe look at it from the point of view of whether you need these
items to actually expire on time, or whether you need them to have
expired when they're actually accessed from the database.
If the latter you could use a method in your model, + a manager
function perhaps, to flick the 'expir
After learning JQuery in a couple of hours I've done just that!!
I presume it's best to add simple functionality like this rather than
use templates?
Cheers
Niall
On 4 Jan 2009, at 16:33, Daniel Roseman wrote:
>
> On Jan 4, 10:18 am, Niall Mccormack
> wrote:
>> Hi there,
>>
>> I'm trying to
Hi,
I have the following problem:
I have models.py with the following class:
class Section(Feed):
parent = models.ManyToManyField('self', blank=True, null=True)
depth = models.IntegerField(editable=False)
def save(self):
self.depth = 1
if self.parent:
self
I'm still searching for a solution for this problem.
Which other forums should I try?
Thanks,
2B
On Jan 3, 5:33 pm, Berco Beute wrote:
> My page shows a (logged in) user an iFrame but when the iframe
> redirects the browser after it's done, the session is lost. The
> redirecting of the parent (
On Jan 4, 10:18 am, Niall Mccormack
wrote:
> Hi there,
>
> I'm trying to override the edit_inline_stacked template so I can
> dynamically add in extra inline data via javascript - similar
> tohttp://www.arnebrodowski.de/blog/507-Add-and-remove-Django-Admin-Inli...
>
> I can override the change
I already send a response (and an apology of course!) to Malcolm, but
I will also add a more detailed explanation of my problem here.
What I'm trying to achieve is navigating between 2 html pages,
"General" and "Access". Both pages have the same tabbed navigation
menu, which is structured as foll
I don't have middleware classes.
I just created some model classes and tried to create Admin
application for them.
Maybe I have to comment some of INSTALLED_APPS that Django uncomment
them by default.
Suspects are auth, contenttypes, sessions
Right?
On Jan 4, 1:06 pm, Eric Abrahamsen wrote:
> On
On Sun, 2009-01-04 at 12:03 +0200, Roman Odaisky wrote:
> Hi everyone,
>
> I have a (technical) problem with middleware, and also I’d be grateful to
> hear
> some suggestions about the general workflow. Doubtless all of you are
> familiar with a topic as simple as POST handling, and maybe some
Hi.
You could say that Django is an extension of python, so first thing to
do would be to learn the basics in python. A good and free starter
book I 've read myself and found quite good is called, "How to think
like a computer scientist". It teaches a lot of things using only
python and is easy an
I'm using django 1.0.2 and the tagging app to retrieve a tag via a
database "in" query, and something is causing the "in" operator's
native nehaviour to be ignored.
In particular, this line of code from tagging.utils.get_tag_list()
executes:
return Tag.objects.filter(name__in=[fo
I tend to use:
TEMPLATE_DIRS = (
os.getcwd()+'/static/templates'
)
so when using generic views it goes to os.getcwd()+'/static/templates/'
this lets me have my proyect live in different folders and run fine...
in your case it is specting a directory tree like this:
/
I want to have a common html form with only a dropdown and a submit
button on all pages.
It will placed in one corner and user can select say a particular
account from the drop down and press submit. I will save the selection
in session.
All screens then will display the data related to that custo
i do appreciate all your assistance and am growing to understand the
server side a bit more. you're right about the documentation being...
light...
i've taken what you posted and have not seen a difference at either of
the websites mentioned the main page results in the base fedora test
page sayi
Where exactly is the snippet file containing the Apache configuration
which you have added?
How is this being included into the main Apache configuration?
Try adding a syntax error into the snippet file, ie., add:
XXX
Then try and restart Apache. If it doesn't complain with an error in
Apach
Starting httpd: Syntax error on line 1 of /etc/httpd/conf.d/
python.conf:
Invalid command 'xxx', perhaps misspelled or defined by a module not
included in the server configuration
it doesn't appear that anything in the is being read,
but there are no errors popping up related to it. i've change
Hello everybody.
Let's say i have the models Model1 and Model2. Model1 has a
BooleanField called Personalizabe. Model2 has a field named 'model1'
that is a ForeignKey to Model1.
Is there a way, through the admin page, to filter all the Model2
objects according to this Personalizable attribute?
Hi,
I am stuck on the interface between a PIL Image and a
FilesystemStorage 'content' object.
I can: img = Image.open(content)
But how do I pass 'img' back to Django for saving?
My short class is pasted at end. The problem reported stems from the line:
name=super(CustomImageStorage,self).save(n
On Jan 5, 8:54 am, garagefan wrote:
> Starting httpd: Syntax error on line 1 of /etc/httpd/conf.d/
> python.conf:
> Invalid command 'xxx', perhaps misspelled or defined by a module not
> included in the server configuration
>
> it doesn't appear that anything in the is being read,
> but there
I have root access. I've just now attempted both moving the
NameVirtualHost *:80 around, from the python.conf to the httpd.conf,
and changed its location in the httpd.conf.
i've also moved the import for the python.conf as well, from above to
below the NameVirtualHost and there have been no chang
Go through all the Apache configuration files and find all mentions of
NameVirtualHost, Listen and SetHandler directives. Post what they are
here. If SetHandler is inside of a Location/Directory container, post
what that container directive is declared as. In turn, if they are
inside of VirtualHos
It sounds like you're after a custom template tag:
http://docs.djangoproject.com/en/dev/howto/custom-template-tags/
On Jan 4, 2:31 pm, Ashish wrote:
> I want to have a common html form with only a dropdown and a submit
> button on all pages.
> It will placed in one corner and user can select say
will do, going through now... i did find this:
# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client. When set "On", Apache will use the value o
wish i could edit the previous post... but the styles issue was due to
the documentroot being a level below what it should have been... this
is working now using the website name as the NameVirtualHost... go
figure...
the carclubhub.com website is giving me a mod_python error, which is
expected a
Hi all,
I am trying to port my first Django 1.0.2 application to run on OSX/
Leopard with Apache + mod_python 3.3.1 + python 2.6.1 (all running in
64-bit mode) and I am experiencing an occasional error when uploading
a file that was not present when testing with the Django development
server.
Th
I am using mod_wsgi in embedded mode and attempting to make an Apache
configuration that will not require any VirtualHost changes to deploy
new Django sites (similar to the concept of dynamically configured
mass virtual hosting http://httpd.apache.org/docs/2.2/vhosts/mass.html
). All that would be
On Jan 4, 2:35 pm, Berco Beute wrote:
> I'm still searching for a solution for this problem.
> Which other forums should I try?
>
> Thanks,
> 2B
>
This is the right forum, but apparently no-one knows the answer to
your question.
Personally, I can't see how that redirect could be causing a sessio
Ok, I will rephrase that with a concrete example:
I have those to models:
class Modelo(models.Model):
nome = models.CharField(max_length=10)
manageable = models.BooleanField()
class Equipamento(models.Model):
modelo = models.ForeignKey(Modelo)
nome = models.CharField(max_length=2
http://docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries
i would use .filter and .order_by
On Jan 4, 8:30 pm, Patrick wrote:
> Ok, I will rephrase that with a concrete example:
> I have those to models:
>
> class Modelo(models.Model):
> nome = models.CharField(max_length=10
On Jan 5, 2009, at 6:51 AM, Donn wrote:
>
> Hi,
> I am stuck on the interface between a PIL Image and a
> FilesystemStorage 'content' object.
>
> I can: img = Image.open(content)
> But how do I pass 'img' back to Django for saving?
>
> My short class is pasted at end. The problem reported stems
For the discussion below, ALL the code is in .../intomec/tenq
I wrote some code in tests.py like so:
from tenq.models import *
self.expectedValue = Answers((1,2,3,4))
within the to_python() method of AnswersField in models.py:
def to_python(self, _value):
print "_value.__
are you redirecting to the same port? I think redirection to a
different domain OR port would keep the cookie from getting back to
the server, thus killing your session.
On Jan 3, 10:33 am, Berco Beute wrote:
> My page shows a (logged in) user an iFrame but when the iframe
> redirects the brows
You need a process running outside the bounds of the webserver that
reads the database every so often, and then sleeps with a wakeup every
so often, and a list of when things "expire". It updates the
database, the webpage reflects the update.
You could of course do this via a wget driven by cron
Are you trying to get your source code off a server, and instead find
it being executed by the webserver?
If you have shell access, tar the files up and download that, create a
folder where the files aren't executable and download them that
way.
If it is your source, I would assume you have
I'll be answering this over on mod_wsgi list. Discussion thread is:
http://groups.google.com/group/modwsgi/browse_frm/thread/c29dde8fbef68e0b
if others are interested in the answer.
Graham
On Jan 5, 10:30 am, Fotinakis wrote:
> I am using mod_wsgi in embedded mode and attempting to make an
On Jan 5, 10:24 am, ppdo wrote:
> Hi all,
>
> I am trying to port my first Django 1.0.2 application to run on OSX/
> Leopard with Apache + mod_python 3.3.1 + python 2.6.1 (all running in
> 64-bit mode) and I am experiencing an occasional error when uploading
> a file that was not present when t
Well, I think we can all see where you get your nickname.
On Jan 4, 12:03 am, Friendless wrote:
> On Jan 4, 2:42 pm, "Karen Tracey" wrote:
>
> > I'll admit your tone here is starting to make me lose interest in your
> > problem report.
>
> Admit it, you weren't very interested in the first pla
On Jan 5, 2009, at 6:51 AM, Donn wrote:
>
> Hi,
> I am stuck on the interface between a PIL Image and a
> FilesystemStorage 'content' object.
>
> I can: img = Image.open(content)
> But how do I pass 'img' back to Django for saving?
>
> My short class is pasted at end. The problem reported stems
On Jan 4, 9:33 pm, Mark Jones wrote:
> You need a process running outside the bounds of the webserver that
> reads the database every so often, and then sleeps with a wakeup every
> so often, and a list of when things "expire". It updates the
> database, the webpage reflects the update.
>
> You
On Jan 4, 8:30 pm, Patrick wrote:
> Ok, I will rephrase that with a concrete example:
> I have those to models:
>
> class Modelo(models.Model):
> nome = models.CharField(max_length=10)
> manageable = models.BooleanField()
>
> class Equipamento(models.Model):
> modelo = models.ForeignK
On Sun, 2009-01-04 at 20:14 -0800, Daniel Roseman wrote:
[...]
> I don't know why you say filtering Equipamento based on the value in
> Model 'seems to be not possible'. On the contrary, it is perfectly
> possible - that's the whole point of a relational database system. You
> want something like:
On Jan 4, 9:29 pm, Mark Jones wrote:
> For the discussion below, ALL the code is in .../intomec/tenq
>
> I wrote some code in tests.py like so:
>
> from tenq.models import *
> self.expectedValue = Answers((1,2,3,4))
>
> within the to_python() method of AnswersField in models.py:
>
On Jan 4, 11:24 pm, Malcolm Tredinnick
wrote:
> On Sun, 2009-01-04 at 20:14 -0800, Daniel Roseman wrote:
>
> [...]
>
> > I don't know why you say filtering Equipamento based on the value in
> > Model 'seems to be not possible'. On the contrary, it is perfectly
> > possible - that's the whole poin
On Jan 5, 1:29 pm, Mark Jones wrote:
> For the discussion below, ALL the code is in .../intomec/tenq
>
> I wrote some code in tests.py like so:
>
> from tenq.models import *
> self.expectedValue = Answers((1,2,3,4))
>
> within the to_python() method of AnswersField in models.py:
>
On Fri, Jan 2, 2009 at 11:57 PM, Mathieu Steele wrote:
> Here is an example of the data model for the type of filter I would
> like to do:
>
> class Student
> name
>
> class Absence
> foreign key Student
> date
>
> Is there a way to filter Students with no absences?
>
> somethin
Hi,
Thanks for looking into this. I used embedded mode and the error is
the following (different message, but same place in
multipartparser.py):
IOError at /myapp/upload/2009-01-03/1
request data read error
Request Method: POST
Request URL:http://127.0.0.1/myapp/upload/2009-01-03/1
Exception
On Monday, 05 January 2009 05:15:27 Eric Abrahamsen wrote:
> On second thought, you should probably be writing the img back into
> the original "content" variable (which points to a File object), as
> that object might already have relevant attributes set...
I guess that's what I was asking: h
On Mon, 2009-01-05 at 09:48 +0200, Donn wrote:
> On Monday, 05 January 2009 05:15:27 Eric Abrahamsen wrote:
> > On second thought, you should probably be writing the img back into
> > the original "content" variable (which points to a File object), as
> > that object might already have relevan
On 5 jan, 01:38, Daniel Roseman wrote:
> On Jan 4, 11:24 pm, Malcolm Tredinnick
> wrote:
>
>
>
> > On Sun, 2009-01-04 at 20:14 -0800, Daniel Roseman wrote:
>
> > [...]
>
> > > I don't know why you say filtering Equipamento based on the value in
> > > Model 'seems to be not possible'. On the co
78 matches
Mail list logo