How to attach file with send mail

2008-09-17 Thread laspal
Hi, I wanted to know how I can attach a file while sending mail to the user. Sending mail is working fine but now I have to send a file with a mail. What are the things I have to use?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: 500 error - can't tie down the exception

2008-09-17 Thread Donn
I have found that using Firebug (in Firefox) is a real boon. You can open the response header and see the Django error page (open it in a new tab). \d --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: User subclass vs. User-Profile

2008-09-17 Thread Daniel Hepper
> But if you use the user-profile approach, how do you create a single > form for entering user data and profile data, and how do you process > this form data in a view, including user creation, without handling > each field separately, which is not in the Django (DRY) spirit? You can display two

Re: Announcing django-todo

2008-09-17 Thread Mirto Silvio Busico
Well, I'm also a django newbie. I tried to install todo in a django site. For the development environment (python manage.py runserver) all is working. For the production environment I got this strange error stating that there is no "todo.models" module: __

Making a blank nullable field in admin actually take a NULL value when blank

2008-09-17 Thread Crispin Wellington
Hello, This is a quick one I cant seem to find in the docs. If I have a model with: text_value = models.CharField(max_length=16, null=True, blank=True) and in the admin interface the user doesn't fill in a value, how do I make the value actually be NULL rather than unicode u'' ? If I turn off

Re: Making a blank nullable field in admin actually take a NULL value when blank

2008-09-17 Thread Crispin Wellington
Don't worry about this. Deeper reading has led me to the correct approach :) Thanks everyone Regards Crispin On Wed, 2008-09-17 at 09:13 +, Crispin Wellington wrote: > Hello, > > This is a quick one I cant seem to find in the docs. If I have a model > with: > > text_value = models.CharFi

Re: Django Training

2008-09-17 Thread Rizwan
I am from Ahmedabad but i can go any major city of India..Preferably MUMBAI.. Thanks for reply On Sep 15, 3:22 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On Monday 15 Sep 2008 7:41:39 pm Rizwan wrote: > > > I am looking for Django training in India. Could anyone please point > > to right

Re: Odd error when executing "runserver"

2008-09-17 Thread Huuuze
I got it working by using Psycopg 2 Beta 7, rather than Beta 8. You can DL it here: http://www.initd.org/svn/psycopg/psycopg2/tags/2_0_BETA_7/ On Sep 17, 1:02 am, "Whyneedsgoogle2know?" <[EMAIL PROTECTED]> wrote: > Graham Dumpleton wrote: > > On Aug 29, 6:43 am, Huuuze <[EMAIL PROTECTED]> wrote

Re: How to attach file with send mail

2008-09-17 Thread Erik Allik
A few months ago I had a similar need and I believe the documentation helped me out. Erik On 17.09.2008, at 11:23, laspal wrote: > > Hi, > I wanted to know how I can attach a file while sending mail to the > user. > Sending mail is working fine but now I have to send a file with a > mail. > W

Re: Django new comments framework error

2008-09-17 Thread Jonathan Nelson
If it's any consolation, I've had the the same bugs. I kept getting the same reverse lookup function error whenever I tried to render the comments form. I looked through all my comments directories, and deleted all .pyc files. I finally got rid of all my reverse() problems after I searched my e

Re: Django new comments framework error

2008-09-17 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-09-16, o godz. 19:31, przez Mark: > I tried everything: > - Deleted django/contrib/comments*.pyc files (a number of times) > - updated to svn latest (a number of times :) ) That's not "everything" ;). Doing rm -rf django/contrib/comments was the thing I did. And

Re: How to syncdb programatically (django standalone script) ?

2008-09-17 Thread Ronaldo Zacarias Afonso
Hi, I think you can use "Django signal feature". Threre is documentation about that in the Django documentation web site. I hope it was helpfull []s Ronaldo. On Tue, Sep 16, 2008 at 7:53 PM, Mathieu Leplatre <[EMAIL PROTECTED]> wrote: > > Should I post a new thread ? > I cannot find anythin

keeping counts of verbs (downloads, comments, ...)

2008-09-17 Thread Bram de Jong
hello all, I have objects in the db which are being commented/favorited/downloaded many, many times. I'd like to keep counts of those verbs, in various time spans (#downloads today, this month, all time). Having done this for another site, I have found that this isn't the easiest thing in the wo

using save() on FormWizard

2008-09-17 Thread Martin
Greetings, i'm playing with FormWizard and i'm having some problem saving each step into the database. I think this should be pretty straightforward, but i guess i'm doing something wrong. I have two models and corresponding forms: class S

Dynamic images

2008-09-17 Thread TKa
Can anybody help me how to create dynamic images within Django? Drawing the image with Python is not a problem but how to link the created image to the httpResponse? Because I need input from the Django models for the image I want to call the drawing function from the view. I guess I could save t

Re: using save() on FormWizard

2008-09-17 Thread Andrew Ingram
In the done() method you are provided with a list of the validated forms so you can just do: for form in form_list: form.save() before returning your response 2008/9/17 Martin <[EMAIL PROTECTED]>: > > Greetings, > > i'm playing with FormWizard and i'm having some problem saving each > step

Re: Dynamic images

2008-09-17 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-09-17, o godz. 13:31, przez TKa: > Can anybody help me how to create dynamic images within Django? > Drawing the image with Python is not a problem but how to link the > created image to the httpResponse? > > Because I need input from the Django models for the image

Re: How to syncdb programatically (django standalone script) ?

2008-09-17 Thread Mathieu Leplatre
Ronaldo, from what I read about signals, I don't think they would help me writing a standalone script... On Sep 17, 8:15 am, "Ronaldo Zacarias Afonso" <[EMAIL PROTECTED]> wrote: > Hi, I think you can use "Django signal feature". Threre is > documentation about that in the Django documentation web

GeoDjango: ImportError: cannot import name DataSource

2008-09-17 Thread Alfonso
Finally got round to setting up geodjango properly - postgresql db etc. and been inspecting some shapefiles for import. I get this error: >>> from django.contrib.gis.utils import ogrinfo, ogrinspect Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.fram

Re: Dynamic images

2008-09-17 Thread Fredrik Lundh
Jarek Zgoda wrote: > You can just return the content (bytes) in HttpResponse with > appropriate content-type header. First argument to HttpResponse > constructor is the content. if you're using PIL to create the image, you can (usually) save the image to the response object, e.g. resp

Re: Dynamic images

2008-09-17 Thread Daniel Roseman
On Sep 17, 12:31 pm, TKa <[EMAIL PROTECTED]> wrote: > Can anybody help me how to create dynamic images within Django? > Drawing the image with Python is not a problem but how to link the > created image to the httpResponse? > > Because I need input from the Django models for the image I want to >

Django install issues on Windows in Cygwin.

2008-09-17 Thread draft
All, I'm having issues running the django-admin.py script from Cygwin after installing Django. When I run it, I get the following error: $ django-admin.py c:\Python25\python.exe: can't open file '/cygdrive/c/Python25/Lib/site- packages/django/bin/django-admin.py': [Errno 2] No such file or dire

Re: Dynamic images

2008-09-17 Thread TKa
Thank you for both of you for the fast reply. I'm still a Django newbie and I didn't know that the HttpResponse has these features. I suppose I need to study the HttpResponse documentation more carefully now. I will just need the basic web-formats so I think I will get things work with these advic

Re: How to attach file with send mail

2008-09-17 Thread laspal
Which documentation are you talking about?? On Sep 17, 3:49 pm, Erik Allik <[EMAIL PROTECTED]> wrote: > A few months ago I had a similar need and I believe the documentation > helped me out. > > Erik > > On 17.09.2008, at 11:23, laspal wrote: > > > > > Hi, > > I wanted to know how I can attach a

delete foreign cookie - version 0.95

2008-09-17 Thread [EMAIL PROTECTED]
hi all please, i would like to ask for a little help. I am getting cookie from another domain for instance called XXX. Them i am parsing it through some tests and create new cookie also caled XXX. This creates the cookie from my domain(so i have two cookies with same name but from different d

Re: delete foreign cookie - version 0.95

2008-09-17 Thread Tim Kersten
I didn't think it was possible to delete/modify/create cookies for other domains obvious security issues and all than, no? Tim ^,^ On Wed, Sep 17, 2008 at 1:59 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > hi all > > please, i would like to ask for a little help. I am getting cooki

Re: delete foreign cookie - version 0.95

2008-09-17 Thread Tim Kersten
Perhaps you could call a script on the other domain to update/delete/whatever the cookie in question? Tim ^,^ On Wed, Sep 17, 2008 at 2:05 PM, Tim Kersten <[EMAIL PROTECTED]> wrote: > I didn't think it was possible to delete/modify/create cookies for > other domains obvious security issue

Application Best Practices - Please advise!!

2008-09-17 Thread WillF
Hi I am new to django and python, and I have a question about best practices with regards to applications. From what I understand applications should be pluggable and portable to other "projects". So When do you know to start a new application? For instance if I am working on a social networking

Re: mod_python errors in production deployment. apache vs django

2008-09-17 Thread NoviceSortOf
On Sep 16, 10:33 pm, "R. Gorman" <[EMAIL PROTECTED]> wrote: > What is in your urls.py file? That's where your urlpatterns should be > stored. > R. my url.py is simply from django.conf.urls.defaults import *

Re: How to get the list of logged in users?

2008-09-17 Thread tamonash
I believe this plugin is to track how many visitors are there in the site, or in the same page. I needed some way to show the usernames of the people who are currently logged in. What can be the smartest way to do that? --~--~-~--~~~---~--~~ You received this messag

Re: Dynamic images

2008-09-17 Thread Kenneth Gonsalves
On Wednesday 17 Sep 2008 5:01:45 pm TKa wrote: > Because I need input from the Django models for the image I want to > call the drawing function from the view. I guess I could save the > image file to temporary folder and then link the image tag to that > file in Response but is there any better w

Re: Django install issues on Windows in Cygwin.

2008-09-17 Thread Nathan Dabney
I've found that mixing Windows/Cygwin binaries for Python/Django creates confusing problems. It's best to treat each environment like the other doesn't exist with respect to dependencies. It looks like you are using the Windows binary instead of the one compiled for cygwin. -Nathan On Wed, Sep

Render to Response or Another Ways to Getting Data

2008-09-17 Thread Anakin
hey. can i use double render_to_response in a one page, or anyway ? actually i want to loading default datas, like categories list or my latest 10 post. am i have to add datas everytime (every view) with render_to_response ? thanx. --~--~-~--~~~---~--~~ You re

Re: DjangoCon keynote transcript/summary

2008-09-17 Thread Delta20
Thanks Malcolm for giving the background for some of this comments. Taken out of context, that talk was indeed a little bit misleading. Even without knowing the context, I felt that most of his points are not showstoppers for most projects. The good very comfortably outweighs the bad, so much so t

Re: mod_python errors in production deployment. apache vs django

2008-09-17 Thread NoviceSortOf
Ok finally got this resolved there were several problems. Following the book the Definative Guide to Django and online documentation somehow did not eliminate several snags, I'd like to post my findings here. 1. postgresql psycopg2 had best be installed on server and tested before moving onto

django + apache + ssl

2008-09-17 Thread lingrlongr
I can't view my site over ssl. If I go to http://www.mysite.com, the site works. If I go to https://www.mysite.com, I get a secure connection, but my django app isn't get served, but rather /var/www/ index.html is. Here's my apache config for mysite: ServerName mysite.com ServerAlias

Re: Introducing myself and first question

2008-09-17 Thread R. Gorman
Wow, sorry I didn't pick up on all the settings and their effects you provided - haven't dug into 1.0 myself and the PythonOption django.root is a new one for 1.0. I looked more thoroughly at your settings and they all appear correct, you have the root defined in apache so you should not need it

Re: FileInput question

2008-09-17 Thread saeb
Can some please help me with this issue? I have been trying all sorts of stuff for past few hours and django documentation seems insufficient. I can see that the file is loaded in memory, but doesn't get attached. I couldn't find any examples dealing with this sort of case. thanks again. On Sep

Re: mod_python errors in production deployment. apache vs django

2008-09-17 Thread R. Gorman
Glad to hear you have some of your setup up and running. Your comment on defining fields in the models surprised me though. All the fields for your models in Django should start with model, followed by the field-type, as the documentation states. Are you sure you have models module being importe

Re: Render to Response or Another Ways to Getting Data

2008-09-17 Thread R. Gorman
If there is data you would like available to every template you want to look into context processors. There's a good tutorial for it here: http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/ R. --~--~-~--~~~---~--~~ You received this

Re: Odd error when executing "runserver"

2008-09-17 Thread Whyneedsgoogle2know?
> > Traceback (most recent call last): > > � File "", line 1, in > > � File "/usr/lib/python2.5/site-packages/psycopg2/__init__.py", line > > 60, in > > � � from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID > > ImportError: dlopen(/usr/lib/python2.5/site-packages/psycopg2/ > > _psycop

Re: Introducing myself and first question

2008-09-17 Thread Mirto Silvio Busico
R. Gorman ha scritto: > Wow, sorry I didn't pick up on all the settings and their effects you > provided - haven't dug into 1.0 myself and the PythonOption > django.root is a new one for 1.0. I looked more thoroughly at your > settings and they all appear correct, you have the root defined in > a

Multiple templates for different admin sites

2008-09-17 Thread jabbercat
Hello, I'm using Django 1.0 and I specified two different admin sites. Now I want to use different templates for these admin sites, but when I place these templates in the template directory the template in templates/admin/ is used for both admin sites. What I have to do that both admin sites us

Re: DjangoCon keynote transcript/summary

2008-09-17 Thread Jan Oberst
On Sep 17, 4:29 pm, Delta20 <[EMAIL PROTECTED]> wrote: > PS: Does anyone know what Cal was using to show the queries in > Pownce(I think that's what it was)? That looked pretty handy. Didn't he only briefly show the Pownce debugging toolbar on the very top of the page? The next slide is from Flic

Error: No module named X (django standalone script)

2008-09-17 Thread Mathieu Leplatre
Hi all, I am starting a new thread, the first one became off-topic (http:// groups.google.com/group/django-users/browse_thread/thread/ 34b501d2d1f88496/f8a5d5ef5aeab62a) I want to do a simple external script that just relies on django's ORM. So I did a single file testdjango.py : -- import

Problem with named paths

2008-09-17 Thread Brandon Taylor
Hello everyone, I'm using named paths as such: url(r'^[-\w]+/(?P[-\w]+)/$', 'render_page', name='nested_page_link'), url(r'^(?P[-\w]+)/$', 'render_page', name='page_link'), The only difference between these two urls is that some pages in this site can be nested under another page. So, I would l

Ordering across many related tables

2008-09-17 Thread dcoy
I'm trying out chartdirector and storing chart definitions in a database. For you who are not familiar with chartdirector it generates charts by defining content in layers. The order of the layers determine the order it is drawn so it is important to get the order right. Now there are different l

Re: date time input in a modelform

2008-09-17 Thread David Durham, Jr.
On Tue, Sep 16, 2008 at 3:13 PM, David Durham, Jr. <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm working through a simple wizard using the formtools wizard stuff. > My issue is that my forms don't display with niceties such as date > time popup and foreign key 'add' options. Is there something ext

Re: DjangoCon keynote transcript/summary

2008-09-17 Thread Rob Hudson
On Sep 17, 7:29 am, Delta20 <[EMAIL PROTECTED]> wrote: > PS: Does anyone know what Cal was using to show the queries in > Pownce(I think that's what it was)? That looked pretty handy. I don't know what tool it was or if it is available but I started a project with a similar purpose that is gainin

Re: Application Best Practices - Please advise!!

2008-09-17 Thread Erik Allik
A video from DjangoCon 2008 by James Bennett about exactly the same thing: http://www.youtube.com/watch?v=A-S0tqpPga4 Erik On 17.09.2008, at 16:13, WillF wrote: > > > Hi I am new to django and python, and I have a question about best > practices > with regards to applications. From what I

Re: Django new comments framework error

2008-09-17 Thread Mark
On Sep 17, 7:01 am, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Wiadomość napisana w dniu 2008-09-16, o godz. 19:31, przez Mark: > > > I tried everything: > > - Deleted django/contrib/comments*.pyc files (a number of times) > > - updated to svn latest (a number of times :) ) > > That's not "everyth

How do I get the domain the application is running on?

2008-09-17 Thread WillF
How does one get the domain the application is running on? I have an email template where I pass in a url , obviously the url needs to be fully qualified. How do i make it so that I do not have to hardcode the domain, so the application can run on different environments without changing anything

Re: mod_python errors in production deployment. apache vs django

2008-09-17 Thread NoviceSortOf
On Sep 17, 4:54 pm, "R. Gorman" <[EMAIL PROTECTED]> wrote: > Glad to hear you have some of your setup up and running. > > Your comment on defining fields in the models surprised me though. > All the fields for your models in Django should start with model, > followed by the field-type, as the docu

Re: How do I get the domain the application is running on?

2008-09-17 Thread Keith Eberle
You can use the django.contrib.sites application, which is listed in INSTALLED_APPS by default, for this. Here's something to show how to use it. from django.contrib.sites.models import Site def get_domain(): return Site.objects.get_current().domain You just need to update the domain name in

Re: GeoDjango: ImportError: cannot import name DataSource

2008-09-17 Thread Ludwig
If you run something like >>> import django.contrib.gis.gdal >>> print django.contrib.gis.gdal.libgdal.gdal_full_version() GDAL 1.5.0, released 2007/12/18 >>> you should get the version number of the GDAL library -- and with an added bonus the import statement will have loaded the GDAL libraries,

Re: django + apache + ssl

2008-09-17 Thread lingrlongr
Hmmm I played around a bit more. I don't think this is a Django problem. I reduced the virtual host entry to: ServerName mysite.com ServerAliaswww.mysite.com DocumentRoot "/home/django/test" That fails too. If I change that port to 80, it works. Must be something my host

Re: FileInput question

2008-09-17 Thread saeb
I figured it out. If someone wants to know how to do it, here is the snippet: http://www.djangosnippets.org/snippets/1063/ On Sep 17, 9:54 am, saeb <[EMAIL PROTECTED]> wrote: > Can some please help me with this issue? I have been trying all sorts > of stuff for past few hours and django docu

Re: mod_python errors in production deployment. apache vs django

2008-09-17 Thread R. Gorman
Ah, I see. It is possible there is the odd typo, and useful information omission, in the Definitive Guide. I've found the documentation on the Django website to be *mostly* error free. The CharField for example is accurately documented (http:// docs.djangoproject.com/en/dev/ref/models/fields/ #

Reusable views from a template - How?

2008-09-17 Thread WillF
I have written a login view as I have followed the tutorial but how do I reuse this view in multiple pages of the site? Is there a way to render this particular view as part of a template, so I could have the login form (or anything for that matter) be displayed on every single page? -- View th

change file upload destination "on the fly" for tests

2008-09-17 Thread Faheem Mitha
Hi, I wrote some unit tests for file upload. since I didn't want the files in the unit tests to be uploaded to the "official locaion", I changed the upload location by reassiging MEDIA_ROOT to something else, '/tmp' in this case. With an upgrade to Django 1.0, this method no longer works. Th

Re: Reusable views from a template - How?

2008-09-17 Thread David Durham, Jr.
On Wed, Sep 17, 2008 at 1:35 PM, WillF <[EMAIL PROTECTED]> wrote: > I have written a login view as I have followed the tutorial but how do I > reuse this view in multiple pages of the site? > > Is there a way to render this particular view as part of a template, so I > could have the login form (o

Re: Custom middleware: using process_view to modify the view_func

2008-09-17 Thread intrepidweb
FYI, I answered my own question. It's pretty simple, actually. If you want process_view() to override the view_func() that was passed in, simply return new_view_func(). Similarly, if you want to override the view_args, just return view_func(view_args). Duh. On Sep 16, 1:37 pm, intrepidweb <[EMA

Re: Problem with named paths

2008-09-17 Thread Norman Harman
Brandon Taylor wrote: > Hello everyone, > > I'm using named paths as such: > > url(r'^[-\w]+/(?P[-\w]+)/$', 'render_page', > name='nested_page_link'), > url(r'^(?P[-\w]+)/$', 'render_page', name='page_link'), > > The only difference between these two urls is that some pages in this > site can b

Ordering in with Many-to-Many Relationships

2008-09-17 Thread sethpomerantz
Hi, I am building a simple web app that allows me to create a custom web page of different quicktimes for presentation to clients and the like. I have it working fine , however i'd like to add control over the ordering of the quicktimes on the display pages. I am having a tough time understanding

Chaining custom filter methods

2008-09-17 Thread intrepidweb
Hi there, I would like to chain a few different custom filter methods like so: Model.custom_manager.custom_filter1().custom_filter2() The docs tell us how to override a Manager's base QuerySet by overriding the Manager.get_query_set() method: http://docs.djangoproject.com/en/dev/topics/db/mana

Chaining custom filter methods

2008-09-17 Thread intrepidweb
Hi there, I would like to chain a few custom filter methods like so: >>> Model.custom_manager.custom_filter1().custom_filter2() The docs tell us how to override a Manager's base QuerySet by overriding the Manager.get_query_set() method: * http://docs.djangoproject.com/en/dev/topics/db/manager

Localizing url patterns

2008-09-17 Thread Jóhann Þ
I was wondering if someone had thought up a nice solution for translating the url patterns from 3rd party standalone applications. I've looked through the documentation on internationalization but it seems that there is no built in localization of the url patterns. I personally think it's rather a

Re: Reusable views from a template - How?

2008-09-17 Thread WillF
David Durham, Jr. wrote: > > > On Wed, Sep 17, 2008 at 1:35 PM, WillF <[EMAIL PROTECTED]> wrote: >> I have written a login view as I have followed the tutorial but how do I >> reuse this view in multiple pages of the site? >> >> Is there a way to render this particular view as part of a templ

Re: Ordering in with Many-to-Many Relationships

2008-09-17 Thread TiNo
If I understand you correctly, you (for example) have a quicktime1, in reel1 and reel2. In reel1 it is the first of, says 5 quicktimes, and in reel2 it is the third of 4? The best solution that appears to me is an extra column in the intermediary table. See: http://docs.djangoproject.com/en/dev/top

Re: Reusable views from a template - How?

2008-09-17 Thread David Durham, Jr.
>> Have you read up on template inheritance? >> http://docs.djangoproject.com/en/dev/topics/templates/#id1 > > I've read that part, I can see how that would work if I statically define > the form. But right now I have > a view defined that pushes out the LoginForm to my template. So say I have > a

Re: Problem with named paths

2008-09-17 Thread Brandon Taylor
Hi Norman, Thanks for the reply. I ended up just having two view functions and a common call to render_to_response. It's not quite as pretty as I was hoping for, but it will work just fine for this app. Kind regards, Brandon On Sep 17, 1:53 pm, "Norman Harman" <[EMAIL PROTECTED]> wrote: > Brand

Problem with Django 1.0 admin on Russian language

2008-09-17 Thread Fedya
Hi everybody, I'm trying to port my site to Django 1.0... And it works fine if LANGUAGE_CODE is set to en-us, but if I set it to ru the following problem appears while I'm trying add new object using admin interface: Warning at /admin/storage/file/add/ Data truncated for column 'message' at row

Two Django visions running at once.

2008-09-17 Thread KillaBee
Is it possible to have two versions of django running at the same time on an Ubuntu server(9.0 and 1.0)? It is taking to long to recode, and until I do I wanted It up and running with the old version. I got the tar.gz from the web site, but do I have to get rid of the new version? --~--~-

Can not under stand the error obtained when validating a model.py

2008-09-17 Thread Karthik Krishnan
The stack trace is given below Traceback (most recent call last): File "manage.py", line 11, in execute_manager(settings) File "c:\tools\Python25\Lib\site-packages\django\core\management \__init__.py", line 340, in execute_manager utility.execute() File "c:\tools\Python25\Lib\site

Re: Reusable views from a template - How?

2008-09-17 Thread Norman Harman
WillF wrote: > > > > David Durham, Jr. wrote: >> >> On Wed, Sep 17, 2008 at 1:35 PM, WillF <[EMAIL PROTECTED]> wrote: >>> I have written a login view as I have followed the tutorial but how do I >>> reuse this view in multiple pages of the site? >>> >>> Is there a way to render this particular

Re: Can not under stand the error obtained when validating a model.py

2008-09-17 Thread Norman Harman
Karthik Krishnan wrote: > The stack trace is given below > > Traceback (most recent call last): > File "manage.py", line 11, in > execute_manager(settings) > File "c:\tools\Python25\Lib\site-packages\django\core\management > \__init__.py", > line 340, in execute_manager > utility.ex

Re: Two Django visions running at once.

2008-09-17 Thread Norman Harman
KillaBee wrote: > Is it possible to have two versions of django running at the same time > on an Ubuntu server(9.0 and 1.0)? Yes, depending on your definition of "running". Far too much depends on how you've set things up and what exactly you want to accomplish to give advice. Esp based on the

Re: Two Django visions running at once.

2008-09-17 Thread Tim Chase
> Is it possible to have two versions of django running at the same time > on an Ubuntu server(9.0 and 1.0)? > It is taking to long to recode, and until I do I wanted It up and > running with the old version. > I got the tar.gz from the web site, but do I have to get rid of the > new version? I d

Re: Can not under stand the error obtained when validating a model.py

2008-09-17 Thread Karthik Krishnan
Hi Norman, But if I have an empty file, models.py, that should thrown an error. Thanks, Kartik On Sep 17, 1:45 pm, "Norman Harman" <[EMAIL PROTECTED]> wrote: > Karthik Krishnan wrote: > > The stack trace is given below > > > Traceback (most recent call last): > >   File "manage.py", line 11, i

Re: Two Django visions running at once.

2008-09-17 Thread KillaBee
On Sep 17, 3:49 pm, "Norman Harman" <[EMAIL PROTECTED]> wrote: > KillaBee wrote: > > Is it possible to have two versions of django running at the same time > > on an Ubuntu server(9.0 and 1.0)? > > Yes, depending on your definition of "running". > > Far too much depends on how you've set things

Context Processor in Admin

2008-09-17 Thread Dana
Hello All! I am hitting a wall when trying to modify the admin interface. I have a model "Story" and on the "change_form.html" page in the admin interface, I would like to display a box on the right side that shows a model that has related content. I have created the other model ("Resources") and

Re: Two Django visions running at once.

2008-09-17 Thread Tim Chase
> 1. Django .90 installed so that the app works. > 2. To have this app up and running with .90. > 3. Django 1.0 installed so that I can shut down .90 and run 1.0. > 4. Run 1 so that I can recode my app for 1.0 For the dev-server, it's easy (at least in a Bash shell...for others, YMMV) Assumi

Re: Two Django visions running at once.

2008-09-17 Thread KillaBee
That sounds great, I will try that. and put the old .90 somewhere else. On Sep 17, 4:09 pm, KillaBee <[EMAIL PROTECTED]> wrote: > On Sep 17, 3:49 pm, "Norman Harman" <[EMAIL PROTECTED]> wrote: > > > > > KillaBee wrote: > > > Is it possible to have two versions of django running at the same time >

Re: change file upload destination "on the fly" for tests

2008-09-17 Thread Lisa Dusseault
I have a bunch of unit tests that do file upload too. E.g.: On Wed, Sep 17, 2008 at 11:42 AM, Faheem Mitha <[EMAIL PROTECTED]> wrote: > > > Hi, > > I wrote some unit tests for file upload. since I didn't want the files in > the unit tests to be uploaded to the "official locaion", I changed the

Re: Localizing url patterns

2008-09-17 Thread [EMAIL PROTECTED]
There is a thread on localized named urls here: http://www.b-list.org/weblog/2007/sep/06/tips-and-tricks/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: change file upload destination "on the fly" for tests

2008-09-17 Thread Lisa Dusseault
I have a bunch of unit tests that do file upload too. E.g.: def testBasics(self): testpage = self.test_report.page_set.create(slug="testpage", title = "Test Page") self.assertEquals(testpage.report, self.test_report) testpage.page_spec.save("testgraphspec.json", Conten

Re: FileSystemStorage preventing large file uploads

2008-09-17 Thread [EMAIL PROTECTED]
Better to set the upload filesize limit on your server eg Apache's has a directive for max file size. Otherwise the file will be uploaded and checked anyway. If you want to report an error to the user you could use validation on the form. The code below returns a error if a file extension is not

Re: Problem with Django 1.0 admin on Russian language

2008-09-17 Thread Fedor Tyurin
It seems to be related with database connection properties. I've tried with sqlite3 and problem disappeared. If I run mysql console and request status (\s command) mysql response the following information about character set: Server characterset:cp1251 Db characterset:utf8 Client chara

[SOLVED] Re: get_absolute_url with flatpages doesn't give a complete path

2008-09-17 Thread John Allen
Probably everyone here knows this already, but I did find a working solution in the documentation on the Sites framework: it was to concatenate Site.objects.get_current() with page.get_absolute_url(). To show this in context, I am using it within the custom template tag for a "simple menu for Dja

seeking design advice

2008-09-17 Thread akonsu
hello, i am looking for an advice from people who know django internals well. to simplify, i have a template that currently uses a custom tag. the tag emits the needed markup. suppose the template includes several instances of the tag to generate different pieces of the page. so in other words

Re: Two Django visions running at once.

2008-09-17 Thread KillaBee
OK My brain stopped working Where in that Python Path? On Sep 17, 4:19 pm, KillaBee <[EMAIL PROTECTED]> wrote: > That sounds great, I will try that. and put the old .90 somewhere > else. > > On Sep 17, 4:09 pm, KillaBee <[EMAIL PROTECTED]> > wrote: > > > On Sep 17, 3:49 pm, "Norman Harman" <[EMAI

Re: Context Processor in Admin

2008-09-17 Thread Brian Rosner
On Wed, Sep 17, 2008 at 3:11 PM, Dana <[EMAIL PROTECTED]> wrote: [...] > My issues is that I have used a context_processor to make the > "Resources" that are related to the "Story" usable in the templates, > but the context is being applied to all admin views (as is the nature > of context_process

Store referer to form in database

2008-09-17 Thread Merrick
I have a form on the homepage of mydomain.com that instructs people to submit their email address and we'll notify them when we launch our service. For those visitors that submit the form, I want to store the referer. I am able to print out the HTTP_REFERER on the same template as the form but I c

Re: Problem with Django 1.0 admin on Russian language

2008-09-17 Thread Fedor Tyurin
I set default-character-set to cp1251 (default server encoding) and now admin seems to work correctly 2008/9/18 Fedor Tyurin <[EMAIL PROTECTED]> > It seems to be related with database connection properties. I've tried with > sqlite3 and problem disappeared. > > If I run mysql console and request

Re: Problem with Django 1.0 admin on Russian language

2008-09-17 Thread Fedor Tyurin
Another possible solution (and probably better one) is to use init_command option set to 'SET NAMES utf8'. 2008/9/18 Fedor Tyurin <[EMAIL PROTECTED]> > I set default-character-set to cp1251 (default server encoding) and now > admin seems to work correctly > > 2008/9/18 Fedor Tyurin <[EMAIL PROTEC

Re: Context Processor in Admin

2008-09-17 Thread Dana
Never mind! Figured it out. Used a simple regular expression match to check which page it was on: if re.match(r'^/admin/story/story/\d+/$', request.path): .stuff here. Cheers On Sep 17, 2:11 pm, Dana <[EMAIL PROTECTED]> wrote: > Hello All! > > I am hitting a wall when trying to modi

Re: Context Processor in Admin

2008-09-17 Thread Dana
Brian, thanks. I forgot to mention this project is using 0.96 (e). Thanks for the tip tho, ill use that in the future! On Sep 17, 3:27 pm, "Brian Rosner" <[EMAIL PROTECTED]> wrote: > On Wed, Sep 17, 2008 at 3:11 PM, Dana <[EMAIL PROTECTED]> wrote: > > [...] > > > My issues is that I have used

Re: Odd error when executing "runserver"

2008-09-17 Thread Graham Dumpleton
On Sep 18, 1:03 am, "Whyneedsgoogle2know?" <[EMAIL PROTECTED]> wrote: > > > Traceback (most recent call last): > > > File "", line 1, in > > > File "/usr/lib/python2.5/site-packages/psycopg2/__init__.py", line > > > 60, in > > > from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID > >

Re: django + apache + ssl

2008-09-17 Thread Steve Holden
Note that you can only have one SSL server on an IP address: you can't have multiple virtual hosts running SSL because the connection has to be established (using the server's identity) before the Host: header can be read. I run the SSL server on my private server as a Virtual Host. This involves

Re: Problem with named paths

2008-09-17 Thread Malcolm Tredinnick
On Wed, 2008-09-17 at 08:59 -0700, Brandon Taylor wrote: > Hello everyone, > > I'm using named paths as such: > > url(r'^[-\w]+/(?P[-\w]+)/$', 'render_page', > name='nested_page_link'), > url(r'^(?P[-\w]+)/$', 'render_page', name='page_link'), > [...] > > But, this throws an error: > > Reve

  1   2   >