Stuck in URL............!!! Help

2012-05-18 Thread Ali Shaikh
Using the URLconf defined in wikicamp.urls, Django tried these URL patterns, in this order: 1. ^wikicamp/(?P[^/]+)/edit/$ 2. ^wikicamp/(?P[^/]+)/save/$ 3. ^wikicamp/(?P[^/]+)/$ The current URL, wikicamp/, didn't match any of these. --- Any ideas? I'm admittedly lacking in the regex department

Re: Stuck in URL............!!! Help

2012-05-18 Thread Jirka Vejrazka
> 1. ^wikicamp/(?P[^/]+)/edit/$ > 2. ^wikicamp/(?P[^/]+)/save/$ > 3. ^wikicamp/(?P[^/]+)/$ > > The current URL, wikicamp/, didn't match any of these. All defined URL's expect wikicamp/some_page_name/ (and maybe some extras after). The requested URL has no page name, terminates right after "wikica

Re: Stuck in URL............!!! Help

2012-05-18 Thread doniyor
you need something like this *^wikicamp/* separately, because even if your url doesnot match anything for page_name, your url is still asking something for *^wikicamp/at_least_something/* . Am Freitag, 18. Mai 2012 10:02:37 UTC+2 schrieb Ali Shaikh: > > Using the URLconf defined in wikicamp.

Re: import error: no model named .....

2012-05-18 Thread doniyor
try this urlpattern = patterns(' ', url('^hello/$,hello), ) Am Donnerstag, 17. Mai 2012 20:58:23 UTC+2 schrieb Ali Shaikh: > > Hey... > > > I am practicing to implement simple examples in django... > > started project with > 1.django-admin.py startproject wikicamp > 2.python manage.py s

Image Update with Django - Admin site

2012-05-18 Thread nishad
Hi... Am new to the Django community... Topic:- I have noticed an issue related to the image uploading and it saving with Django admin interface. Steps to trace the issue :- 1. When i was uploaded/(browse) and saved an Article with an image (.jpg) , for the first time it saves perfectly as f

Re: Image Update with Django - Admin site

2012-05-18 Thread Phang Mulianto
hi, thats default behaviour of the image fields. The old image not removed, but still keep intact, and the new image user uploaded will be named with a _1.ext , _2.ext you must handle the saving yourselft to make it rewrite the old images. Check the snippet i use : http://djangosnippets.org/sni

Unable to view results page of polls tutorial

2012-05-18 Thread First Rock
hi al almost done with the django tutorial#4.. But my app doesnt use the html pages, n doesnt load the radio buttons and results page.. Other than those the app is displayed in the default template and shows al the pages of groups users n polls.. i have placed the html templates in templates direct

Add Language menu in Admin

2012-05-18 Thread BadStorm
Hi, I want to add a language value to my model, to permit to user the ability to add content in different languages that I configurated in the setting.py. If my model is defined like this: model.py class News(models.Model): content = models.TextField() language = ?? --- What I

Re: Problem at activating the admin site (Django tutorial part 2)

2012-05-18 Thread Ravi Shakya
I am also facing the exact problem indicated by pasztilla. My usernaleme thing is fine (normal) but I have not been able to fix this issue. Any concrete cause/solution to this? On Friday, August 26, 2011 3:35:39 AM UTC+5:45, pasztilla wrote: > > Hi Babatunde, > > Hi Babatunde, > > > > SITE_ID =

Re: where do you host your django app and how to you deploy it?!

2012-05-18 Thread Cal Leeming [Simplicity Media Ltd]
I know this is an old thread, but I feel obliged to comment. Some of our legacy clients used DreamHost for their django/python apps.. Then dreamhost decided their VPS's needed a software and hardware upgrade, which resulted in lost data, 4-ish days of downtime, numerous server config inconsistenci

Re: where do you host your django app and how to you deploy it?!

2012-05-18 Thread azizmb.in
Im very happy with webfaction . Its a great shared host. It is a tad bit expensive, but the service is awesome. Have used it for multiple projects, with no complaints. As for deployments, Ive been playing around using fabric, there is also a project on github

Struggling with formsets

2012-05-18 Thread David
Given 2 models: class Person(models.Model): first_name = models.CharField(max_length=255) last_name = models.CharField(max_length=255) class PersonAttendance(models.Model): person = models.ForeignKey(Person) attend_date = models.DateField() I need to produce a formset that lists

alternative to .values(*fieldnames)

2012-05-18 Thread Sells, Fred
I'm using Django 1.3 but plan toupgrade to 1.4 later this month. I generally return XML which is consumed by a Flex HttpService in the client so I only use the django template to convert a dictionary to XML. My application is strictly intranet with limited data and users so efficiency considerat

Re: How to serve staticfiles with full URL for local development?

2012-05-18 Thread pedesen
I have a similar problem. My STATIC_URL is a full URL like http://static.mysite.com. When I use the development server with runserver, django *always* takes this URL. In the templates I use {{STATIC_URL}}/myimage.jpg, and in development I always see http://static.mysite.com/myimage.jpg in my br

Re: Struggling with formsets

2012-05-18 Thread pedesen
For this case inline-formsets should be the way to go: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#inline-formsets But I think this will work for a particular person, but not for multiple persons... Am Freitag, 18. Mai 2012 15:27:05 UTC+2 schrieb David: > > Given 2 models: > >

Re: Struggling with formsets

2012-05-18 Thread David
Thanks Pedesen for your reply. I have tried inline-formsets and as you say unfortunately I could only get it to work with a single object. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups

Django in mobile devices

2012-05-18 Thread Phang Mulianto
HI all, i recently see rhomobile.com , which running ruby in mobile devices, and phonegap which use javascript. do anyone aware of the equivalent python / django can be used for mobile devices.. i am thinking about create app for the mobile client using web technology without go deeper in java.

Does Django guarantees to generate well Optimized SQL Query ??

2012-05-18 Thread shariq
Hi, I am writing an Django application. This project need to be very efficient and well optimized. I am very much concern about SQL-Query performance. I am using postgreSQL. I want to know whether Django Guarantees to generate well optimized SQL-Query ??? Thanks Shariq -- You received this m

What persists in memory across requests?

2012-05-18 Thread Ken J
Howdy, I'm quite curious as to what persists in memory across requests in terms of django application variables. I'm currently running a django app in mod_wsgi daemon mode. Because of performance concerns when dealing with large numbers of concurrent requests, I wanted to modify django to keep p

Re: Does Django guarantees to generate well Optimized SQL Query ??

2012-05-18 Thread George Silva
Yes and no. Django provide mechanisms that you will minimize hits to the database. Check for select_related function for example. George On Fri, May 18, 2012 at 1:00 PM, shariq wrote: > Hi, > I am writing an Django application. > This project need to be very efficient and well optimized. > > I

Re: Does Django guarantees to generate well Optimized SQL Query ??

2012-05-18 Thread Thomas Lockhart
On 5/18/12 10:02 AM, George Silva wrote: Yes and no. And it does not (can not) protect one from building a bad model which could result in bad performance. So having a requirement for high performance without having done some reading on data normalization and SQL schema design probably gets th

JQuery .get new url is not updating the page

2012-05-18 Thread furqanmlk
Hi there, I implemented the JQuery to get the data from Database server and display in the form of table on the page when user click one of the DOM element. I tried , *JQuery Code:* $.get("RunId_TestCases",{Variable:Value},function(data){

Django 1.3 online documentation ... error? ... quibble?

2012-05-18 Thread Kevin Cole
Hi, I'm once again attacking the Django with vigor. And THIS time, I've actually got some forward momentum and am approximating progress! Yay! ;-) In reading "Creating forms from models" (https://docs.djangoproject.com/en/1.3/topics/forms/modelforms/) I note the mention of a model field called

Re: where do you host your django app and how to you deploy it?!

2012-05-18 Thread francescortiz
I use django europe, cheap shared hosting with a good setup with lighttpd by default, but you can set up any server you want compiling it. On Monday, April 2, 2012 12:48:24 PM UTC+2, fix3d wrote: > > Where do you host your django app and how to you deploy it?! > > Please share personal exp. --

from django.http import HttpResponse: Unresolved Import. why ?

2012-05-18 Thread doniyor
hey guys, i am getting this error when i try to write my view. when i import this, from django.http import HttpResponse, the word HttpResponse is red error. Unresolved Import: HttpResponse. i dont understand why. i am using python 2.7 and django1.4. what i did before this is, i changed from

Re: What persists in memory across requests?

2012-05-18 Thread akaariai
On May 18, 7:54 pm, Ken J wrote: > I'm quite curious as to what persists in memory across requests in > terms of django application variables.  I'm currently running a django > app in mod_wsgi daemon mode. > > Because of performance concerns when dealing with large numbers of > concurrent requests

Trying to Edit Existing Post; Can't Get Form to Display

2012-05-18 Thread DF
Newbie question. I have an application where registered users can submit stories. The posting and display works great but I wanted users to have the ability to edit any of their stories. The goal would be for a user to find a list of their stories on their profile page, choose one that they woul

Re: Model design question

2012-05-18 Thread oneroler
Mike, Anssi, Thank you for your replies. I will give this a shot and see if I can get it to work. Sam On Thursday, May 17, 2012 9:59:40 PM UTC-7, akaariai wrote: > > On May 18, 5:25 am, oneroler wrote: > > Thanks Mike, that is what I was originally planning to do but realized > > there woul

Re: Trying to Edit Existing Post; Can't Get Form to Display

2012-05-18 Thread Jonathan Baker
The lines: #else: #story_form = StoryForm(instance=story_form) ...appear to be handling the GET request, and they're commented out. On Fri, May 18, 2012 at 3:22 PM, DF wrote: > Newbie question. I have an application where registered users can submit > stories. The posting and display

Re: What persists in memory across requests?

2012-05-18 Thread Ken J
Thanks for the suggestions. I have been using pgbouncer for awhile, and while it helps with the issue of setup/tear down of postgres processes, it still leaves the overhead of a socket setup/tear down between the django app and the pgbouncer process. Because almost every django request I have use

Re: Trying to Edit Existing Post; Can't Get Form to Display

2012-05-18 Thread DF
Thanks. This worked: else: story_form = StoryForm(request.user, instance=story_form) One problem: it just adds a new version of the story instead of updating the previous version. So "editing" just creates multiple versions instead of actually editing the existing story. Is there a wa

Re: Trying to Edit Existing Post; Can't Get Form to Display

2012-05-18 Thread DF
Thanks. I get this error using that code: TypeError at /report/detail/30/edit/ __init__() takes at least 2 arguments (1 given) This is referring to this line: story_form = StoryForm(instance=story) I added a "story_id" argument to this, which brought up the form, but when I submitted it

Re: Template: Foreign Key

2012-05-18 Thread Fady Kamal
it's not working with me On Tuesday, June 30, 2009 10:43:15 AM UTC+2, russelson wrote: > > Hi, > > I'm new to django > > I have two models > > #models.py > > class House(models.Model): > name = models.CharField(blank=True, max_length=50) > > class People(models.Model): > name = mode

Re: JQuery .get new url is not updating the page

2012-05-18 Thread Lee Hinde
On May 18, 2012, at 11:52 AM, furqanmlk wrote: > Hi there, > > I implemented the JQuery to get the data from Database server and display in > the form of table on the page when user click one of the DOM element. > I tried , > > JQuery Code: > $.get("RunId_TestCases",{Variable:Value},function(d

Re: Use Django to implement my GUI!

2012-05-18 Thread Alec Taylor
Dde That architecture diagram shows exactly your problem. You are thinking about this problem incorrectly. - Server: nginx [or whatever] with Django - Client: web-browser - Admin: Client: web-browser #done On Fri, May 18, 2012 at 1:36 PM, Eugène Ngontang wrote: > Hi Guys! > > I've been b

Re: Use Django to implement my GUI!

2012-05-18 Thread Kurtis Mullins
If you're dead set on using a non-browser GUI for the administration application, just use the HTTP Protocol for your communications between the Django Server and whatever Desktop Application you build. However, if you can just use a web browser for that (even if it's a Qt browser or something that

CSRF verification failed. Request aborted.

2012-05-18 Thread plogult...@yahoo.com.cn
I find a code, but the Django version is 0.9, I am using 1.4 and I am a new learner, I want to run below code but report CSRF verification failed. from django.http import HttpResponse text = """ + """ def index(request): if request.POST.has_key('a'): a = int(request.POST[

Re: Use Django to implement my GUI!

2012-05-18 Thread Kurtis Mullins
> > My questions are: > - Can I override the djando admin methods so that i can not only > customized my views and html page, but also manipulate objects in > database, so that i can do another action when catching an event in > the GUi. Anything that can be done with Django's Admin interface ca

Re: Template: Foreign Key

2012-05-18 Thread Kurtis Mullins
Try something along these lines (Note: I'm switching up your variable names a bit to make it easier to read) {% for house in houses %} {{ house.name }} {% for person in house.people.all %} {{ person.name }} {% endfor %} {% endfor %} I just wrote that code block pretty quickly

Re: Template: Foreign Key

2012-05-18 Thread Kurtis Mullins
Whoops -- that might need to be 'house.people_set.all'. Sorry. On Fri, May 18, 2012 at 10:50 PM, Kurtis Mullins wrote: > Try something along these lines (Note: I'm switching up your variable > names a bit to make it easier to read) > > {% for house in houses %} > {{ house.name }} > {% for

Re: JQuery .get new url is not updating the page

2012-05-18 Thread Furqan Malik
Thanks for the reply, You misunderstood my question. Passed_TestCases = data['Data1']; Failed_TestCases = data['Data2']; These values are fine, I am using them to create the table. My question is once these values come from view.py, I want to change the browser url so that url can be send to oth

user.set_password('new password')

2012-05-18 Thread Min Hong Tan
Hi, I 'm trying to change password in views.py in one of my def. having the below code. newpassword ="testing123" user = User.objects.get(username__exact = request.user) user.set_password(newpassword) user.save it didn't prompt me any error. but, why my password still remained unchanged? Regar

Re: user.set_password('new password')

2012-05-18 Thread Jonathan D. Baker
Save is a method, so it needs parentheses: user.save() Sent from my iPhone On May 18, 2012, at 10:53 PM, Min Hong Tan wrote: > Hi, > > I 'm trying to change password in views.py in one of my def. > having the below code. > newpassword ="testing123" > user = User.objects.get(username__exact =

admin error, cannot edit fields or delete records, url refers to incorrect primary key

2012-05-18 Thread Mac
I've set up a 'Reps' model in the admin. I can add records successfully, but if I try to change a record or field, I get a 404 error. When I try to delete a record, I get this traceback here: http://dpaste.com/750121/ My primary keys are integers, but it appears that the urls return them as floats.

Re: from django.http import HttpResponse: Unresolved Import. why ?

2012-05-18 Thread doniyor
okay, i solved the problem.. ctrl + 1. and import to parent modules.. and thats it.. Am Freitag, 18. Mai 2012 22:43:17 UTC+2 schrieb doniyor: > > hey guys, > > i am getting this error when i try to write my view. > > when i import this, from django.http import HttpResponse, the word > HttpRe

'Settings' object has no attribute 'ROOT_URLCONF'

2012-05-18 Thread doniyor
Hi i have this problem, i dont why, i have root_urlconf in my settings.py. i cannot figure out what it wants from me.. pls help -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.

Re: CSRF verification failed. Request aborted.

2012-05-18 Thread doniyor
as Kurtis said, you need {% csrf_token %} and your rendering response should be something like this: return render_to_response('index.html', {'your_key': your_value},context_instance=RequestContext(request)) and those your value will be rendered thru youe_key tag. here is how your form sh

Re: Use Django to implement my GUI!

2012-05-18 Thread Jani Tiainen
Hi, By looking your diagram it's still the same as you described in your earlier mails. So it doesn't help at all. :) 1) Is your server something that exists and is used in everyday life or is it something that you're going to build? 2) Are your clients something that already exists and is used

Re: user.set_password('new password')

2012-05-18 Thread Min Hong Tan
hi.. thanks!! haha... didn't notice that. how can no error...prompt out one On Fri, May 18, 2012 at 11:48 PM, Jonathan D. Baker < jonathandavidba...@gmail.com> wrote: > Save is a method, so it needs parentheses: user.save() > > Sent from my iPhone > > On May 18, 2012, at 10:53 PM, Min Hong