I've been using the docs and haunting this list for a while and I
think I have a more-or-less new-user perspective. First of all, the
docs are great especially when compared to other stuff out there for
other kit. But if we (er, not necessarily me) are going to hack on the
docs we need an objective
I had the same thing...
all what you need is to add " {% csrf_token %}" in each template for Post
form
it will solve your issue
On Sat, Aug 6, 2011 at 7:42 AM, bob gailer wrote:
> I have stumbled around following various pieces of advice:
>
> added to views:
>from django.core.context_proce
I have stumbled around following various pieces of advice:
added to views:
from django.core.context_processors import csrf
modified views to end with:
form = ContactForm()
c = {}
c.update(csrf(request))
c['form'] = form
return render_to_response('contact_fo
Inline.
On 08/03/2011 08:21 AM, francescortiz wrote:
> LESS combines CSS and javascript which I think that goes beyond the
What does it mean? Care to give an example? Like textually combining
both languages? Or does it produces both JavaScript and CSS files?
Last time I checked (today) it is a s
Hello,
I tried click. Error 404.
Vladimir
06.08.2011, 07:31, django-users@googlegroups.com:
> I am out of office right now and will get back to you when I return. If you
> don't hear from me, my assistant should contact you shortly. In the meantime,
> you should take a look at this product I hav
Hello,
I can't use static files too.
urls:
urlpatterns = patterns('',
(r'^', 'testjquery.views.first'),
)
if settings.DEBUG:
urlpatterns += patterns('django.views.static',
(r'^%s/(?P.*)$' % settings.STATIC_URL[1:], 'serve',
{ 'document_root': settings.STATIC_ROOT }),
)
sett
Ok, I apologize. Here is a fuller representation of what I'm doing. I had a
hard time figuring out how much was enough versus too much. This is
simplified, but I think it represents what I'm trying to do. For instance,
don't pay too much attention to the save logic in the view, I haven't
actual
are you referring to the models.py which is present in every app created by
python manage.py startapp books ??
# Create your models here.
from django.db import models
class Publisher(models.Model):
name = models.CharField(max_length=30)
address = models.CharField(max_length=50)
cit
Sorry, typo. I meant Models is defined inside models.py.
--
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...@
wait... every app has its own models.py... and in models.py it says something
like
from django.db import models
class Publisher(models.Model):
name = models.CharField(max_length=30)
address = models.CharField(max_length=50)
city = models.CharField(max_length=60)
state_province =
The model class is defined *inside* Models.py.
--
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...@googlegrou
Hi while going through the Django Book I ran into the following code
Being fairly new to Python the code kind of confused me
from django.db import models --->lineA
class Publisher(models.Model): --->line B
Consider line A
from django.db import models
This means that in the django directory
On Fri, Aug 5, 2011 at 5:14 PM, Subhranath Chunder wrote:
> Your model declarations are very confusing for me, and seems to be running
> around in circles. Very difficult to follow for me.
> The logical relationships are not clear. So, how to arrive at the
> 'rebate_pct' and 'wac' as you actually
That worked perfect, just had to reinstall MySQL-python-1.2.3 and all
modules
Didn't have to do anything to the existing Django projects
thanks again for the help
Cheers
Kieran
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this dis
Great thanks Bill for the quick response.
I did install it with no special instructions so I'll just reinstall to 2.7
Thanks again
Kieran
--
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.
Probably. Depends on how you installed it.
If django was installed somewhere like /usr/lib/python2.5/... then, yes, the
new python install won't have access to it. That would be if you used
pip, eacy_install, or python setup.py as root to install it, and didn't give
any special arguments to inst
On Aug 5, 9:33 pm, Subhranath Chunder wrote:
> Not the exact answer you were looking for, but I was only wondering, if you
> have already figured the actual SQL query then why not simply use that
> instead.
You loose many things by not using the ORM. Currently I use raw() SQL
for making these k
Hi all couldn't find this posted apologies if its been answered.
I have just installed python 2.7, there's packages I wat to use that
are reliant on json.
I have been using Django installed in 2.5 packages on my local
machine.
To get Django now working with 2.7 do I need to install Django and the
Your model declarations are very confusing for me, and seems to be running
around in circles. Very difficult to follow for me.
The logical relationships are not clear. So, how to arrive at the
'rebate_pct' and 'wac' as you actually intend, is a mystery in itself for
me.
If you have the relationshi
Instead of writing:
f = csv.reader(open(fname, 'rb'), delimiter=',', quotechar='"')
you could have written only:
f = csv.reader(open(fname, 'rb'))
The 'delimiter' and 'quotechar' defaults to the ones you've specified.
But, it's nothing wrong to be explicit, rather than to rely on the implicit
val
Thanks. I am on it. Info below for future readers.
What I did was:
1) set the order of the upload file handing in the settings.py so that
default behavior in Django will always be to save the file to drive
instead of keeping it in memory (for files under 2.5M)
FILE_UPLOAD_HANDLERS = (
'django.
Using the string split on CSV like this is bad in practice. Prefer using CSV
manipulation library instead. Like,
http://docs.python.org/library/csv.html
You can use the CSV reader module for your purpose.
On Sat, Aug 6, 2011 at 1:13 AM, Vasu Nagalingam wrote:
> Hi - I am in implementing a batch
Hi - I am in implementing a batch file import function where the data file
is in CSV format. The data file is uploaded (InMemoryFileHandler)
successfully, but I am having trouble parsing the CSV data correctly.
My code:
for line in imported_data:
line = line.split(',')
My data is organi
Not the exact answer you were looking for, but I was only wondering, if you
have already figured the actual SQL query then why not simply use that
instead.
It's not mandatory to use the model query APIs, if your query is complex.
Using the raw() API would still yield you model querysets or instanc
On Fri, Aug 5, 2011 at 1:49 PM, nixlists wrote:
> I need a view where for every row returned from Claim I make a
> calculation based on quantity from the Claim, rebate_pct and wac. Is
> it possible to write a model method that would access these fields
> from the other tables?
If I was in your sh
On Fri, Aug 5, 2011 at 7:51 AM, bruno desthuilliers
wrote:
> Without more informations about your models (and specially the
> relationships), it's going to be rather difficult. As a general
> consideration, if your Claim model can access these other models thru
> relationships, well you just have
I don't think it's necessarily a choice between learning php or
learning python. Most programming languages are fairly similar in
concept, and once you've mastered one it's reasonably easy to pick up
a new one. Python is a great language, but I think it's especially
great as a first language. You
In SQL we can do
SELECT MONTH(date_joined), YEAR(date_joined), COUNT(id) as
joined_month
FROM auth_user
GROUP BY MONTH(date_joined), YEAR(date_joined)
ORDER BY YEAR(date_joined), MONTH(date_joined)
Which yields a table like this
MONTH(date_joined) YEAR(date_joined) joined_month
3
I am writing my first Django application and one feature I want to
include is the ability for each registered user to be able to upload
multiple images. (By registered user, I just mean a typical "create
username/password, wait for email notice, activate account".)
Each image would be automaticall
I think many of the members of this group have a pro-python bias for a
good reason. Most of us have had to work with many other frameworks and
languages and Python is the only one I would use to "unwind".
Sometimes it's worth "paying your dues"
--
You received this message because you are subsc
If you want to alter your schema (remove a field from the table, or
remove the entire table), first remove the field from your model, or
remove the entire model. Then make the change in your database.
Or you can look into using 'south' for schema changes. After you spend
a little time learning it
Dear all,
I'm new at Django . i have got a trouble with delete table.
I want to delete my table that is wrong field , but i can 't figure out how
to do that.
Pls , Help me
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
Does anyone know how to control which column a module appears in,
using django-admin-tools?
it seems to just split the modules up into even numbers of modules per
column, but they aren't all the same size and some i want in specific
columns so they appear at the top, as alerts. Anyone know how to
Sorry for my late response.
I found a way how to do it.
My fist mistake was that I creat a view fo deleting books.
And my form action is pointing this url.
Afrer I changed it to point to "."
But I search for more pythonic way.
This is how i get checked checkboxes;
try:
ch = []
if request.me
Hi,
what I'm trying to do seems to be a little hard. I've got three
model-classes:
class A(models.Model):
...
class B(models.Model):
...
class C(models.Model):
a = models.ForeignKey(A)
b = models.ForeignKey(B)
...
class Meta:
unique_together = ('a', 'b')
I accidentally PHP support for the Django template language.
No support yet for cookies, headers or event GET / POST, but otherwise
functional. See the source code for usage examples.
Link: http://animuchan.net/django_php/
--
You received this message because you are subscribed to the Google Gr
>
> >Basically, unless you inserted your js code (or any other markup)
> >using a {{ var }} or {% tag %}, there is NO "restrictions on these
> >blocks with javascript".
>
> >Did you at least inspected the *rendered* template to see how what
> >your HTML and js looks like ?
>
Thanks for point
Have updated my Linkedin profile with project details.
On Jul 29, 2011 7:41 PM, "Subhranath Chunder" wrote:
> Hi,
>
> I'm an experienced Django developer, with good experience in web
application
> development using Django as the underlying backbone. Have done numerous
> projects in this, and my e
On Fri, Aug 5, 2011 at 9:01 PM, Littke wrote:
> Hi.
>
> Is there a schedule/roadmap for the release of Django 1.4?
>
> If not, how far away would you guesstimate it is?
Hi,
We haven't made any formal announcements about release plans for
Django 1.4 as yet.
If I had to guess, a release is still
With debug = False, under what circumstances (if any) should I have
db.reset_queries()? I understand from docs that queries are cleared in
the request cycle, but can anyone give me an example of what sort of
thing would require it being done manually?
--
You received this message because you are
I'm betting it's just sitting in the template as plain HTML.
--
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
I came into Django as a designer. It can be done, just take baby
steps. The more python you learn, the happier you'll be, and the more
productive. But in the mean time, you can do a lot with generic views
and reusable apps that would keep you from having to write much code
at all. I would suggest f
If you are thinking about diving into PHP, I suggest you read this
first:
http://www.tbray.org/ongoing/When/200x/2006/02/17/PHP
It's five years old, but it contains a lot of links to pro- and anti-
PHP rants, which you should consider. (Consider also that there's no
good Unicode support inside PH
On Fri, Aug 5, 2011 at 15:01, Littke wrote:
> Hi.
> Is there a schedule/roadmap for the release of Django 1.4?
> If not, how far away would you guesstimate it is?
Here is the roadmap wiki:
https://code.djangoproject.com/wiki/Version1.4Roadmap
Which is pretty empty, but you can sort the tickets b
On Aug 5, 3:22 pm, Josh wrote:
> I'm new at Django and am experimenting with JavaScript in templates.
>
> I've put JavaScript from Google Charts in a block and it is displaying the
> chart properly. The onmouseover should display the details of elements in
> the chart, but that isn't working in Dj
What did you change? Hopefully you're using version control and can do a
diff.
The traceback you provided isn't very helpful to most people because
it's from Django's internals instead of your own code.
In any case, you need to do more work before you'll get much help,
unless someone's speci
Hi,
just one thought - if the update is not much time-consuming, you can
write your view which allways parses the data and then cache the view
for 30 seconds. That way if nobody looks at your page, you won't do
useless work in the background.
See https://docs.djangoproject.com/en/dev/topics/cache/
Hi.
Is there a schedule/roadmap for the release of Django 1.4?
If not, how far away would you guesstimate it is?
Thanks.
--
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 un
Hi,
After i modified some models, i started to get following errors:
Traceback (most recent call last):
File "C:\Python26\lib\site-packages\django\core\servers\basehttp.py",
line 280, in run
self.result = application(self.environ, self.start_response)
File "C:\Python26\lib\site-packages
I'm new at Django and am experimenting with JavaScript in templates.
I've put JavaScript from Google Charts in a block and it is displaying the
chart properly. The onmouseover should display the details of elements in
the chart, but that isn't working in Django. In a plain html-page it is
disp
On Aug 5, 5:49 am, Daniel wrote:
> Hi,
>
> I'm working on a Django website made by someone else and I'm trying to
> change how the navigation on the left looks.
(snip)
Programming by accident won't get you very far. You should either
contact the original developper or, if not possible, find out w
There was a different problem actually,
RequestContext(request) was never called
I removed that line and put it in the above return.
Worked fine :)
thank you for the effort tho
On Aug 4, 5:58 pm, Shawn Milochik wrote:
> In your view you should be instantiating the form with the data from
> reque
Thanks guys,
That was really helpful, have a nice day
--
Mohamed Sayed Ghoneim
On Fri, Aug 5, 2011 at 4:37 AM, wrote:
> I am out of office right now and will get back to you when I return. If you
> don't hear from me, my assistant should contact you shortly. Check out this
> massage chair tha
Hi,
I'm working on a Django website made by someone else and I'm trying to
change how the navigation on the left looks.
Currently it shows links to pages on the current level and any child
pages, but we're looking to have it more traditional where it shows
parent and child pages (to a certain ext
On Aug 5, 12:42 am, nixlists wrote:
> On Thu, Aug 4, 2011 at 5:31 PM, Javier Guerra Giraldez
>
> wrote:
> > On Thu, Aug 4, 2011 at 3:53 PM, nixlists wrote:
> >> What's the correct way to write the view then? Any work-arounds?
>
> > - collect the modified objects to a list, don't rely on the quer
Hello.
I'm developing a site with approx. 500 visits per day, mainly from
Norway (Europe).
Now I'm trying to find the best possible way to host this site.
Earlier I've used dedicated hosts like WebFaction and Djangoeurope,
and this has worked pretty well.
However Google AppEnginge is free and pro
last day today :)
https://sites.google.com/site/docsprintsummit/
adam
On 08/03/2011 01:44 AM, Russell Keith-Magee wrote:
On Tue, Aug 2, 2011 at 6:43 PM, eset wrote:
hi,
I am new to the Django list but I am a django fan (we dev with Django
for www.booki.cc)... anyways I wanted to encourage
57 matches
Mail list logo