djngo unittest to use "real" database.

2020-09-06 Thread django-newbie
Hi All, I am currently writing test cases for views, Which eventually uses database also. By default a test database is being created and removed after test are run. As the database itself is development database, I don't want my test to create a separate db but use exciting only. Also I will l

Re: How models.Manager is working behind the scene and calling different serialize methods?

2020-05-29 Thread django-newbie
et() query on the other hand, returns a single object. > > Saygılarımla, > Sencer HAMARAT > > > > On Fri, May 29, 2020 at 4:43 AM django-newbie > wrote: > >> Hi, >> I am new to django and going through a tutorial and now confused with one >

How models.Manager is working behind the scene and calling different serialize methods?

2020-05-28 Thread django-newbie
Hi, I am new to django and going through a tutorial and now confused with one particular implementation. models.py import json from django.core.serializers import serialize from django.db import models from django.conf import settings # Create your models here. def upload_update_image(insta

Recommend a way to add my own class into DjanGo

2012-10-17 Thread Django Newbie
Hey guys, I want to create a custom class with methods I will be able to access everywhere in my Views. For example a class that add numbers after declaring it somewhere in Django. *MyNumber = new GenNumberClass()* *MyNumber.setNumbers(1,2)* *result = MyNumber.getAddedResult()* Please point m

Re: Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-21 Thread Another Django Newbie
On Wednesday, March 21, 2012 10:29:48 AM UTC, Jani Tiainen wrote: > > Like this: > > 'default': { >'ENGINE': '...', >'OPTIONS': { > 'threaded': True >} > } > Thanks again Jani, switching my question to the modwsgi group Regards, ADN > > -- You received this message b

Re: Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-21 Thread Another Django Newbie
On Wednesday, March 21, 2012 7:18:16 AM UTC, Jani Tiainen wrote: > > 20.3.2012 16:45, Another Django Newbie kirjoitti: > > > > > > On Tuesday, March 20, 2012 10:28:49 AM UTC, Another Django Newbie wrote: > > > > > > > > On Tuesday,

Re: Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-20 Thread Another Django Newbie
On Tuesday, March 20, 2012 10:28:49 AM UTC, Another Django Newbie wrote: > > > > On Tuesday, March 20, 2012 10:01:36 AM UTC, Tom Evans wrote: >> >> On Mon, Mar 19, 2012 at 5:24 PM, Jani Tiainen wrote: >> > Hi, >> > >> > Since we use sam

Re: Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-20 Thread Another Django Newbie
On Tuesday, March 20, 2012 10:01:36 AM UTC, Tom Evans wrote: > > On Mon, Mar 19, 2012 at 5:24 PM, Jani Tiainen wrote: > > Hi, > > > > Since we use same setup except one part: we use mod_wsgi instead of > > mod_fcgi. > > > > (Since wsgi is considered to be defacto protocol). Could you try to use

Re: Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-19 Thread Another Django Newbie
On Thursday, March 15, 2012 1:05:53 PM UTC, Another Django Newbie wrote: > > Hi, > > I've just started playing with django this week and was following the > example in the Django Book. > > I created an example of my own, based on the models.py in the book and

Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-15 Thread Another Django Newbie
Hi, I've just started playing with django this week and was following the example in the Django Book. I created an example of my own, based on the models.py in the book and tested it with manage.py runserver. All worked OK, but when I try it in apache one of my admin pages is truncated - a number

What am I doing wrong with this URL Pattern

2012-01-27 Thread Django Newbie
Hi, I am trying to figure out a way to call a function depending on the parameter in the URL. Example. url(r'^People/Info/(?P\d+)/$', 'iFriends.People.views.details'), url(r'^People/Info/(?P[a-z]{3})/$', 'iFriends.People.views.detail_name'), It works with numeric value. if I use "http://localho

Re: models.Model

2011-10-17 Thread Webb Newbie
"models" is a module that contains classes Model and CharField. Person inherits from Model. first_name and last_name are instances of CharField. There's no functional programming here. -WN. On Sun, Oct 16, 2011 at 6:43 PM, youpsla wrote: > 1 from django.db import models > 2 > 3 class Person(

Re: Not able to view the admin page through the browser

2010-03-10 Thread Newbie
Found the problem missed to specify the admin entry in INSTALLED_APPS variable in the settings.py file Thanks for the help. On Mar 9, 8:01 pm, Shawn Milochik wrote: > Something is broken in your code. If you set DEBUG = True, you'll find > out what. But since it's False, it is hiding that info

Re: Not able to view the admin page through the browser

2010-03-10 Thread Newbie
Set the Debug=True and got the error as TemplateDoesNotExist at /admin/ What is the reason? On Mar 9, 8:01 pm, Shawn Milochik wrote: > Something is broken in your code. If you set DEBUG = True, you'll find > out what. But since it's False, it is hiding that information for > security reasons.

Not able to view the admin page through the browser

2010-03-09 Thread Newbie
Dear all, Installed the Django framework in my local machine. Am able to create a models and inserted values into database. When I was trying to show the admin page it showed the following error. Traceback (most recent call last): File "/home/thangappan/Non-Technical/Pyt

Re: Problem while creating database tables through the models.

2010-02-12 Thread Newbie
gured the DATABASE_ENGINE name as postgresql in settings.py Please help me. On Feb 12, 10:06 am, Christophe Pettus wrote: > On Feb 11, 2010, at 8:38 PM, Newbie wrote: > > > NOTE : Django version is 1.1.1 and PostgreSQL version is 7.4.16 > > Is there is a reason

Problem while creating database tables through the models.

2010-02-11 Thread Newbie
Dear all, Downloaded and followed the steps which is given in the documentation of Django Created the project called mysite Created the model called polls Ratified the settings.py of the project to create a model as a table in the database using INSTALLED_ A

Problem with mysql like operator with Django

2009-07-05 Thread newbie
Hi, In my view, I connected to the mysql server using the cursor object. I tried to execute the following query: select pincode from pincode where state='Andhra Pradesh' and district='Nellore' and area LIKE '%road%' or '%item%'; The above query is perfectly working when i give it on the mysq

Re: error using ChoiceField

2009-06-11 Thread newbie
gt; but as a guide it's very good. > > Regards, > Radovan > > > > newbie-15 wrote: > > > Hi, > > >       I have created a form which contains a ChoiceField. But in the > > class of the form, I havent given > > > any choices to the ChoiceField. I&#x

error using ChoiceField

2009-06-10 Thread newbie
Hi, I have created a form which contains a ChoiceField. But in the class of the form, I havent given any choices to the ChoiceField. I'm creating the choices dynamically using ajax and adding it on the client side using javascript. I'm also using is_valid function to check whether the inp

Re: problem using ajax in django

2009-06-10 Thread newbie
that created the problem. Thanks for the reply. On Jun 10, 4:47 pm, Daniel Roseman wrote: > On Jun 10, 10:50 am, newbie wrote: > > > > > Hi, > > >          I have written a small javascript ajax code in my django > > application. Its working fine in the develo

Problem with deployment in apache

2009-06-10 Thread newbie
Hi, I deployed my django project in apache. But its working, If i keep it in /var/www/html. Its not working if I keep my project in the Home directory. Its giving the error permission denied. ny idea?? Hanuma. --~--~-~--~~~---~--~~ You received this mes

problem using ajax in django

2009-06-10 Thread newbie
Hi, I have written a small javascript ajax code in my django application. Its working fine in the development environment. But when i use the same code in the same django application running on apache and also on a different url(if it matters), it is not working. I have tried using Fire

Re: displaying image in a template

2009-05-16 Thread newbie
all static files should be served). So when i try {{ imagepath }} where imagepath = "/barcodeimages/image.png" its not working On May 17, 4:11 am, Daniel Roseman wrote: > On May 16, 9:19 pm, newbie wrote: > > > Hi, > > >          Thanks for your immediate  reply

Re: displaying image in a template

2009-05-16 Thread newbie
seman wrote: > On May 16, 9:19 pm, newbie wrote: > > > Hi, > > >          Thanks for your immediate  reply. I've seen the document and > > followed the steps in it already. But was not able achieve any > > progress. In > > > (r'^site_media/(?P.*)$&#x

Re: displaying image in a template

2009-05-16 Thread newbie
ument_root': settings.MEDIA_ROOT}), (r'^identity/franchisebook/print.html/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), So what do i have to specify in the place of site_media? I have tried all the possible replacemetns. But i was

displaying image in a template

2009-05-16 Thread newbie
Hi, I want to display an image from static files directory in a template. The name of the image is stored in a variable(say image). When i try to display it in the template using img tag( src = {{ image }} ), its not displayed. Can someone help me in this regard. Thanks, nazgi. --~--~--

Re: writing a view for an ajax funtion in a template

2009-05-15 Thread newbie
yup. You are right. Thank you very much for the reply :) On May 15, 6:06 pm, Daniel Roseman wrote: > On 2009/5/15, newbie wrote: > > > hi, > > >         Thanks for the reply. > > > So suppose i call the ajax function like this. > > >            

writing a view for an ajax funtion in a template

2009-05-15 Thread newbie
Hi, i'm new to both ajax and django. Can some1 explain me how to write a view function for an ajax functionality in a template. For example, I've registered a ajax event in a template and wanted to send some information to a function in a view which inturn sends its response. How do i d

Re: using ajax in django

2009-05-15 Thread newbie
> > > > beause so far, ive only used tinyMCE pluggable and havent created any > > > > of my own. > > > > > Basically i do not think django is an issue here. Just create html > > > > file with form and then create jquery some jquery events. Adding >

Re: using ajax in django

2009-05-15 Thread newbie
used tinyMCE pluggable and havent created any > > > > of my own. > > > > > Basically i do not think django is an issue here. Just create html > > > > file with form and then create jquery some jquery events. Adding > > > > django into the mix changes n

using ajax in django

2009-05-13 Thread newbie
hi, I'm new to django and dont know much of javascript either. I would like to start working on them. Could someone help me write a simple form which can provide any functionality using ajax, preferably using jquery libraries. It would be great if any event other than the submit event

Re: autofilling select boxes

2009-05-11 Thread newbie
lps, > Bastien > > On May 11, 8:18 am, jai wrote: > > > You can use Dojo or jquerry. > > > On May 11, 10:44 am, newbie wrote: > > > > Hi, > > > >           I'm new to django and also ajax. I want to create a form > > > which has a

Re: ajax cascading select boxes

2009-05-11 Thread newbie
ase their and retrieve the list of states. I want to do something like you said, use the javascript onclick event and send the selection made by the user and based on the selection connect to the database and retrieve the states. But i dont know how to use javascript in a python view. Please help me t

ajax cascading select boxes

2009-05-10 Thread newbie
Hi, I'm a newbie to Django. I have a form which has some attributes to be filled by the user viz., name, age, address etc. I want to get the address of the user by just allowing him making the selections rather than letting him fill it. I'm planning to give him a sele

autofilling select boxes

2009-05-10 Thread newbie
Hi, I'm new to django and also ajax. I want to create a form which has a select box and based on the selection made, the options of another select box are generated. I've achieved this task in web2py but i'm porting my application into django and cudnt find a good start using ajax in d

Re: user_id in admin pages

2008-12-10 Thread Django Newbie
Found it thanks. http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-methods James Bennett wrote: > On Wed, Dec 10, 2008 at 6:28 PM, Django Newbie <[EMAIL PROTECTED]> wrote: > >> This is probably an easy one, but I've tried what make sense to me wit

user_id in admin pages

2008-12-10 Thread Django Newbie
This is probably an easy one, but I've tried what make sense to me with not success. What I want to do is in my admin pages, use the User module and enter the the user_id of whoever is logged in to add an entry in one of my foreign key tables. How can set a field equal to the user_id to be en

Re: Can javascript call a python script?

2008-12-04 Thread Django Newbie
With AJAX you can. Javascript is interpreted by the browser, and you want to call a serverside script. Or you could do it as a form submission, but I assume you want it to happen without refreshing the page, so AJAX is how you would do that. Eric wrote: > Hello, this might be a silly questio

Re: rendering DB text in template

2008-11-28 Thread Django Newbie
Thank you. Alex Koshelev wrote: > Look at this: > http://docs.djangoproject.com/en/dev/topics/templates/#id2 > > > On Fri, Nov 28, 2008 at 21:43, Django Newbie <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > > So I have some text fields

rendering DB text in template

2008-11-28 Thread Django Newbie
So I have some text fields in the db that have some embedded html in the text. How do I get the template to render the text as html? The text fields are recipe.ingredients and recipe.instructions Recipes .RecipeName{ font-size: large; font-weight: bold; } .Reci

Re: Apache Setup

2008-11-26 Thread Django Newbie
Graham Dumpleton wrote: > > On Nov 26, 3:32 pm, Django Newbie <[EMAIL PROTECTED]> wrote: > >> Hi Everybody, >> >> Django newbie here. I'm trying to get it to work under apache with >> mod_python on a freebsd server but running into problems.

Apache Setup

2008-11-25 Thread Django Newbie
Hi Everybody, Django newbie here. I'm trying to get it to work under apache with mod_python on a freebsd server but running into problems. I searched the archives and found similar things, but I tried all the suggestions and still no luck. The error: MOD_PYTHON ERROR Proc

Re: Javascript not being picked up in AJAX based application

2007-01-02 Thread newbie
Yes, it is in the head. These are external scripts. Also, on the server console I see no errors. I get a HTTP 200 when the form is posted [02/Jan/2007 18:18:15] "POST /ajax/ HTTP/1.1" 200 2824 Kenneth Gonsalves wrote: On 03-Jan-07, at 4:17 AM, newbie wrote: > When I c

Javascript not being picked up in AJAX based application

2007-01-02 Thread newbie
I am new to Django and am still playing with some code available on the internet. I was trying to run the YUI-ext and Django application on B-List. When I click the form submit button, the ajax callback does not kick in. I simply get a refresh if the page...On the server console I see that the r