> This clearly does not work ;)
>
> {{ pick.date "r" }}
Why the above will not work?
On Nov 21, 3:36 am, matches wrote:
> If I want to format the current datetime for an rss feed, I do:
>
> {% now "r" %}
>
> I want to format a date the same way coming from a DB in this format
> "2009-11-18 08:00
You can simple use inbuilt user authentication provided by django.
What problem are you facing with it?
Any way if you are interested in building your own authentication
engine you need to do the following:
you can do this in several way one way is
1) Store cookie in user browser (you can store
Overriding save() is the best place to put that logic and it should
work well with the admin also
(other way is by means of signals)
On Oct 18, 3:45 pm, Tomasz Zieliński
wrote:
> Maybe you can use something like this:
>
> http://stackoverflow.com/questions/1346765/unique-constraint-that-all...
>
Simple Capture the form variable and send it to another template
def view(request):
user_text = request.GET['user_text']
return render_to_reponse("html",{'user_text':user_text})
--rama
On Oct 18, 7:26 pm, A_Swtos wrote:
> I have a form like this:
>
>
> Text:
> maxlength="20"
make sure you have installed the django properly.
open a python shell:
type :
import django
import django.core
if the import does not work it means django has not installed
properly.
http://docs.djangoproject.com/en/dev/
On Oct 14, 9:32 am, Gin wrote:
> when i set my test webserver root
>
> C:
Very simple:
1.Once you are in login page you need to store url to which you need
to go.
How should you do that?
protected view
===
def protected_view(request) :
if user is not authenticated :
url = request.getpath() # method which actually
'importance' field is already comming from model.
Why did you defined again in the forms? (remove it and check out
whether error is occurring or not)
On Oct 1, 2:33 pm, dijxtra wrote:
> On Sep 30, 5:12 pm, Karen Tracey wrote:
>
>
>
> > On Wed, Sep 30, 2009 at 10:53 AM, dijxtra wrote:
>
> > > I
On one thing which i can guide you is
you can use
1.django evolutions
Link : http://code.google.com/p/django-evolution/
2.south
LInk: http://south.aeracode.org/
to add a new column to an already created table via django.
On Oct 1, 2:14 pm, Geobase Isoscale wrote:
> Hi Everyone,
>
> I would l
Below are some thoughts on how to do the above efficiently:
1) Create a temporary table (or Model) with two fields
Class Temp(...):
personid = FK(Person)
searchstring = TextField()
2) When every a perso
[Off topic suggesting another rich text powerful editor]
You can also try django CK editor
1) which is easy to user
2) which is powerful,fast and more robust than TInyMCE
http://code.google.com/p/django-ck/
3) with every ease you can also integrate directly.
On Sep 22, 6:45 am, taijirobot wrote
1.Simply extend the User model by using UserProfile Technique
More details :
http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/
2.You can also customize your authentication needs
More details :
http://groups.google.com/group/django-users/browse_thread/thread/c943
file at server.
>
>
>
> On Tue, Jul 14, 2009 at 9:33 PM, Alex Gaynor wrote:
>
> > On Tue, Jul 14, 2009 at 10:46 AM, Rama Vadakattu > > wrote:
>
> >> I have a django project with N number of dependencies to other
> >> packages.
> >> Now i wan
I have a django project with N number of dependencies to other
packages.
Now i want to deploy the project on production server?
As of now iam doing this.
1.Move the django project to production server.
2.install the dependencies on production server similar to that of the
way i have done on local
you can use the setting TEST_DATABASE_NAME
http://docs.djangoproject.com/en/dev/ref/settings/#test-database-name
--rama
On Jul 3, 2:36 pm, Michael Stevens wrote:
> Hi.
>
> Is there a nice way to use a separate db user when running tests?
>
> I don't want my main user to have to have permission
after import notification
just try to do this
dir(notification) > which list all the methods ,classes in the
package
and see what it contains then atleast you will get a rough idea of
what is going wrong.
On Jul 3, 2:21 am, Anthony wrote:
> Hi,
>
> I'm having trouble installing thi
please have a look at this section
http://docs.djangoproject.com/en/dev/topics/http/sessions/#when-sessions-are-saved
--rama
On Jul 2, 2:15 am, bjoern_mainz wrote:
> Hi,
>
> what i try do do is (in plain python):
>
> products = []
> products.append({"product" : "foo","quantity": 5})
> products.
As the error is with import please try to do this
Just open a python shell and try do the import
>>> import django.core.handlers.modpython
if it works fine then we are sure that modpython is present on the
python path and the problem is not with import ..
On Jun 30, 3:31
Please ignore the last line..
On Jun 25, 2:40 pm, Rama Vadakattu wrote:
> you can put {{MEDIA_URL}}
>
> but while displaying instead of displaying it directly just do the
> below
>
> from django.template.loader import render_to_string
> from django.template imp
you can put {{MEDIA_URL}}
but while displaying instead of displaying it directly just do the
below
from django.template.loader import render_to_string
from django.template import Context, Template
t = Template("flat page content goes here")
newflatpage = t.render({},context_instance=RequestCon
Very well explained. Thanks Russell Keith-Magee
On Jun 23, 4:58 am, Russell Keith-Magee
wrote:
> On Tue, Jun 23, 2009 at 1:21 PM, Rama Vadakattu
> wrote:
>
> > In unit tests i need to load few fixtures i have done as below
>
> > class TestQuestionBankViews(TestCase):
1. i don't know whether it is expected behavior or not.
But here are some ways to solve the above problem.
---
Why it is not accepting @ character in admin ?
As the username of UserCreation form ( from
django.contr
In unit tests i need to load few fixtures i have done as below
class TestQuestionBankViews(TestCase):
#load this fixtures
fixtures = ['qbank',]
def setUp(self):
login = self.client.login
(email="m...@gmail.com",password="welcome")
def test_start
have you gone through the below url:
http://www.b-list.org/weblog/2007/nov/01/django-tips-template-loading-and-rendering/
On Jun 22, 5:49 pm, z0n3z00t wrote:
> I have a common site that is used by different clients. Each client
> wants to be able to custom-brand the site to their liking.
>
> H
Usually Foreign keys are displayed as drop down select list where user
can choose one is multiple options.
Foreign keys are usually initialized with list of tuples [(internal
value,display),(interavalue1,displayvalue2)..]
if you want to present just prepare the list of tuples and give it to
t; message.
>
> I think I like this solution of using the logging module. I guess
> with mod_python your stdout messages make it into apache's logs but
> I'm using mod-wsgi which actually errors when it gets something on
> stdout and throws all stderr messages away. Time
i could not able to understand the problem...
after reading one i can quickly tell is
you are not passing keyword arguments so kwargs will be always empty
please look at the belowlink for more information:
http://www.saltycrane.com/blog/2008/01/how-to-use-args-and-kwargs-in-python/
On
print messages at info level
mlogger.debug("completed the question paper at present reviewing it")
Hope the above is clear for you to start...
--rama vadakattu
.
On Jun 18, 11:20 pm, "eric.frederich"
wrote:
> I need some a
i think ForiegnKey uses ChoiceField as it has to display n number of
choices.
How should we intialize choice field?
---
it should in this form
source = [(actual value,display value),(actual value,display
value) ]
This can be done with javascript as follows :
1) View/middleware (depends on your needs) detects the redirection
url
2) put down the redirection url in the context and redirect to
template say abc.html
3) in abc.html
a) put the message "your are leaving our site"
b) write javascript
else:
form = FooForm()
foo.date = request.session['date']# we
know request.session ['date'] has a value
form = FooForm(instance=foo)
...
You don't need this line==> foo=for
one simple idea ( it may or may not be feasible ) that you can use is
1) write down a middleware
2) examine the context which has a form and with the above error
message
and replace it with your new error message
On Jun 14, 5:45 pm, Vitaly Babiy wrote:
> Hey Everyone,
> I need to change th
Recently i worked with openid i have used the below package for
implementing it.
http://code.google.com/p/django-openid-consumer/
It is basically a fork of simonwillison django-openid implementing
new openid features.
I did not face any problems and successfully implemented openid on my
site.
-
have a look at the below link
http://uswaretech.com/blog/2009/02/how-to-build-a-facebook-app-in-django/
this may help you in understanding the integration of your application
into facebook platform
On Jun 12, 5:11 pm, gganesh wrote:
> Hi,
> I'm not going to integrate my application into faceboo
>From my point of view
use of signals correctly fit your needs.
On Jun 12, 5:31 am, Shuge Lee wrote:
> For some reason, I want to create a static file after user change
> record of DB with admin view, I need to use
> signalhttp://docs.djangoproject.com/en/dev/topics/signals/#topics-signals
> ,
Once user has logged in you can access user in every view by means of
request as below
def view2(request):
user = request.user
On Jun 11, 6:55 am, ariest wrote:
> I have two views and I want to pass the user variable from login view
> to parent1 view but I dont know how to do that.
>
> Can
1.
just put down the appropriate view url for the action attribute of
your form.
On Jun 11, 8:56 am, Abhishek Nanda wrote:
> Hi
>
> I wanted some help about processing forms in an html document returned
> as the result of a given query. I am developing an opac system . now
> once a
you have to use the below code to print messages instead of keys
{% for key,message in form.errors %}
{{ message|striptags }}
{% endfor %}
On Jun 9, 11:21 am, Rama Vadakattu wrote:
> {% for message in form.errors.key %}
> {{message|striptags}}
> {% endfor %
>> the layout has been altered? Why so?
What do you mean by this?
On Jun 9, 11:24 am, vishy wrote:
> Hi,
>
> For my project, I decided to use base.html file.After including it in
> a couple of pages, the layout has been altered? Why so? How does
> blockcontent render?
> thks
--~--~-~--~-
{% for message in form.errors.key %}
{{message|striptags}}
{% endfor %}
The above will print keys instead of values as message is key not a
value.
On Jun 9, 11:06 am, Tom wrote:
> Hi all,
>
> Leveraging the default login view, I want to use my own login.html to
> show all th
i hope you are encountering the problem as request.GET.subseries is
string and id is integer and they are not matching.
On May 29, 3:52 pm, mbdtsmh wrote:
> I have the problem below when I use a tuple to try and match a request
> item; i.e., it never matches. I can do the same thing with a list
Have a look at the below link
http://journal.uggedal.com/creating-a-flexible-monthly-calendar-in-django
This may help you in solving your problem.
On May 22, 12:12 pm, laspal wrote:
> Hi,
> My DB looks lie:
>
> id
> date msg
> 20
So you need dynamic form as below
Class MyForm(forms.ModelForm):
fields
...
def __init__(self, user,*args , **kwargs):
super(MyForm,self).__init__(*args,**kwargs)
if user is not superuser :
Integrating with Gravatar is very easy
1) Get MD5 hash of user's email id
import hashlib
def getMD5(self):
m = hashlib.md5()
m.update(self.user.email)
return m.hexdigest()
2) and prepare image url as below
http://www.gravatar.com/avatar/{{user-email-MD5-
ha
BY passing instance of form as context to the template and saying
{{form.as_table}} in the template.
On May 14, 5:22 pm, aruns wrote:
> Hi,
>
> i have included many static pages in my template using
>
> {% include staticpage.html %}
>
> i have started using views and forms, so i am tring to in
OR you can use django-evolutions which evolves the database schema in
sync with the models.
More details at : http://code.google.com/p/django-evolution/
On Apr 17, 10:29 am, zayatzz wrote:
> If the tables of this app hold no info, then you can do python
> manage.py reset appname. This clears all
hi,
1) I have done request.session.set_expiry(0)
which means user session should expire when he closes the
browser.
But it is not happening i have tested it several times? Any hint
on what can be wrong?
HOw did it test?
---
By closing browser and opening
Please have a look at the below thread which answers the above
question:
http://groups.google.com/group/django-users/browse_thread/thread/c943ede66e6807c/2fbf2afeade397eb#2fbf2afeade397eb
On Apr 8, 9:03 am, Tom wrote:
> Hi experts,
>
> I am a first time web-developer who decided to use python we
The authentication model provided along with django is based on
username.
What to do to change the authentication based on email instead of
username?
To be more specific
~~~
With username authentication , to login user we do the following
user = authenticate(name,password)
The authentication model provided along with django is based on
username.
What to do to change the authentication based on email instead of
username?
To be more specific
~~~
With username authentication , to login user we do the following
user = authenticate(name,password)
Thanks for the clarification.
On Mar 10, 10:05 am, Malcolm Tredinnick
wrote:
> On Mon, 2009-03-09 at 21:47 -0700, Rama Vadakattu wrote:
> > understood.
>
> > But Malcom,
>
> > 1.i feel doing restructuring of data in views for this purpose is not
> > appropriate.
, Malcolm Tredinnick
wrote:
> On Mon, 2009-03-09 at 21:21 -0700, Rama Vadakattu wrote:
> > I have a list in template.
> > I need to access that list based on a forloop.counter.
>
> > For example :
>
> > if forloop.counter is 1 then i need to access list[1]
> >
{% endwith %}
{ %endfor %}
3. {% for k in klist %}
{{ mylist|slice:forloop.counter:forloop.counter }} #This
code is not working
{ %endfor %}
Regards
Rama vadakattu
--~--~-~--~~~---~--~~
You received this message because you are
Keep track of a variable which tells us the action user is currently
doing like "draft,publish,edit "?
the first time the user does a publish you need to trigger an action.
details:
How to know the current action of user?
---
a) 1.
Keep track of a variable which tells us the action user is currently
doing like "draft,publish,edit "?
the first time the user does a publish you need to trigger an action.
details:
How to know the current action of user?
---
a) 1.
if you really want to measure the page response time (amount of time
that a page has taken to download on your local computer)
1) you can use firebug (popular) : it shows all the request and
reponse...
2) AOL's web based test tool : webpagetest.org
3) IBM's page detailer (desktop
So you need to trigger an action the first time you save an object in
to the database.
--
Class A:
#self.id is None whenever a particular instance has not been saved
into a database
#override save method in the object as follows
def save(self) :
firstime =
On Mar 2, 1:10 pm, Malcolm Tredinnick
wrote:
> On Mon, 2009-03-02 at 00:02 -0800, Rama Vadakattu wrote:
> > Thanks Malcolm.Understood very clearly.
>
> > Following the same approach i have used following code in my templates
> > {% url djorum_feed_url ca
w should i use the url tag to form the above
Actually i need this url in my template
On Feb 28, 5:10 am, Malcolm Tredinnick
wrote:
> On Fri, 2009-02-27 at 01:20 -0800, Rama Vadakattu wrote:
> > i am using django feed syndication framework.
>
> > 1) .in urls.py
>
i am using django feed syndication framework.
1) .in urls.py
feeds = {
'category': LatestTopicsByCategory,
}
urlpatterns += patterns('',
url(r'^feeds/(?P.*)/$',
'django.contrib.syndication.views.feed' , {'feed_dict':
feeds},name='djorum_feed_url') ,
there are many ways of solving this problem.
please see the below thread for more details where similar problem was
discussed :
http://groups.google.com/group/django-users/browse_thread/thread/3a9960139307aaec/77b712ee9c08795b#77b712ee9c08795b
Another method which you can use is
=
1) AppServer has to send XML
means
(i assume) DJango running on Apache has to send XML
means
let's route the URL to point to view which sends the respective
XML
URL is the means by which the frontend (javascript) will interact
with appSERVER (django APP)
means
in (django
i think it is always good to decouple the imports and INSTALLED_APPS
(in settings.py) from projectname.
one way of doing this is
a) in INSTALLED_APPS (settings.py)
use just APPNAME instead of PROJECTNAME.APPNAME
(it still works as the project path is on sys
we strive hard to keep track of latest happening in the django .
To assist in this process we have developed a feed/widget which brings out
the popular stories in Django by examining (via friendfeed)
1) Google Reader shared items
2) Deliciuos, M
Yes he can use the below
1.string.ascii_lowercase
2.string.ascii_uppercase
As iam new to python,django i couldn't able to recollect it while
answering.
On Feb 5, 3:57 pm, Masklinn wrote:
> On 5 févr. 09, at 11:40, Rama Vadakattu
> wrote:> k = [chr(i) for i in range(97,12
k = [chr(i) for i in range(97,123)]
The above will give you a list from a to z.
if you want capital letter list [A,Z] then you should use the
respective ascii values range(65,92).
On Feb 5, 3:25 pm, Muslu Yüksektepe wrote:
> hi;
> i need to use a-z list for my photo album. i wanna use link for
CUSTOM_ID---ID
~
INV1 -- 1
INV2 ---2
INV33
.
.
.
i think you need INV1 for display purposes and also i hope it does
not matter much whether you store 1 or INV
Please have a look at the below link:
http://code.google.com/appengine/articles/pure_django.html
May be it helps you in porting the app from appengine to django.
--rama
On Feb 1, 5:16 am, "Mark.Petrovic" wrote:
> Good day. I'm new here, as well as a new (all of two months of
> experience) Pyth
on.
Thanks Eric for your code.
--rama
On Jan 27, 7:48 pm, Eric Abrahamsen wrote:
> On Jan 27, 2009, at 9:45 PM, Rama Vadakattu wrote:
>
>
>
> > Eric,
> > can you please show me the code snippet of specifying a logfile in
> > settings.py.
>
> Sure, here'
Eric,
can you please show me the code snippet of specifying a logfile in
settings.py.
On Jan 27, 6:37 pm, Eric Abrahamsen wrote:
> On Jan 27, 2009, at 9:28 PM, Thomas Guettler wrote:
>
>
>
> > Rama schrieb:
> >> please look at the below logging.conf file.
> >> ...
> >> can any one guide me on h
port setup_environ
import settings
setup_environ(settings)
--
now it is working well.
THanks
On Jan 27, 9:23 am, Malcolm Tredinnick
wrote:
> On Mon, 2009-01-26 at 19:46 -0800, Rama Vadakattu wrote:
> > i configured the DJANGO_SETTINGS_MODULE in /etc/profile.this means
> > that
i configured the DJANGO_SETTINGS_MODULE in /etc/profile.this means
that it is a system wide environmental variable and can be used every
where.
On Jan 26, 8:09 pm, Daniel Roseman
wrote:
> On Jan 26, 1:55 pm, Rama wrote:
>
>
>
> > i have a standalone python script which uses a django module. i n
71 matches
Mail list logo