Re: VERY cheap django hosting?

2011-06-09 Thread Matteius
I've been really happy with Valcato Hosting which has all that shell
hosting shared goodness and a fast turn around on trouble tickets at
excellent pricing:  https://secure.valcato.com/aff.php?aff=070

-Matteius

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to add CSRF to context when using test client???

2011-06-09 Thread Matteius
Greetings,

I am writing unit tests for my application, and I want to leave CSRF
checks enabled in testing.  This means on my POST I am getting 403
because I have not figured out how to add csrf to my context when
using the test client.  Please advise on how to most easily do this:

# Issue a POST request.
response = self.client.post('/student/open_enrollments/',
{'course': 3})
# Check that the response is 200 OK.
self.assertEqual(response.status_code, 200)
# Verify template is the expected one.
self.assertTemplateUsed(response, 'student_portal/
open_enrollments.html')
# Check that the rendered context contains now 0 Courses.
self.assertEqual(len(response.context['courses']), 0)

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Help with custom model method for query

2011-06-09 Thread Chris McComas
I have this views.py and models.py:

http://dpaste.com/552615/

On the view what I want to do is display a list of all the feed types
(News, Sports, etc general categories), then then below each of those
feed type headings display the FeedItems for each feed for that city.

Prior to adding the City model it was pretty easy, I was able to just
do this in my template:

http://dpaste.com/552616/

Maybe it's because it's late and I'm out of coffee, but this is
totally stumping me on how to do this best. Any help would be greatly
appreciated!

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: VERY cheap django hosting?

2011-06-09 Thread AJ
>
> I put all my projects on Google AppEngine ...
> works pretty well with 
> django-nonrel
> although sometimes there are some fairly signifi


I was wondering if you can have multiple instances of an app and if you can
manage your app at a level where you can restricted (IP address) access to
the site with Google App Engine?



On Thu, Jun 9, 2011 at 2:07 PM, Aaron Madison wrote:

> I put all my projects on Google AppEngine ...
> works pretty well with 
> django-nonrel
> although sometimes there are some fairly significant concessions you might
> have to live with to go this route. AppEngine is free if you stay under the
> generous quotas, or a nominal charge if you go over.
>
>
> On Thu, Jun 9, 2011 at 9:48 AM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>> Just as a side note guys, I know there are tons of PHP hosting providers
>> out there which offer dirt cheap hosting, but Python hosting is *extremely*
>> different to PHP. A lot of providers simply don't have any concept of how to
>> properly manage a webapp deployment in production.
>>
>> I'd really question why you'd want a cheap host in the first place. If
>> it's for development/learning, then a VPS is a great choice. However, if
>> this is for a production site, then this might not be the best idea.
>>
>> My apologies if I've duplicated what's already been said (I haven't seen
>> all the replies yet).
>>
>> Cal
>>
>>
>>
>>
>> On Thu, Jun 9, 2011 at 5:50 AM, raj  wrote:
>>
>>> Actually, I might reconsider,
>>> What do you guys think of hostgator? They also have django hosting
>>> with fastcgi, And there's is shared hosting. Pros, cons?
>>> Thanks
>>> -Raj
>>> On Jun 9, 12:27 am, raj  wrote:
>>> > Ya, i think as a first timer, I'm gunna go with something that is non-
>>> > vps. I'll learn about preconfiguring stuff when the time comes. I
>>> > think djangohosting.ch looks the best. But asmallorange and alwaysdata
>>> > also look appealing. Thanks all.
>>> >
>>> > On Jun 8, 8:58 pm, ApogeeGMail  wrote:
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > > +1 for webfaction
>>> > > On Jun 8, 2011, at 8:29 PM, Bobby Roberts wrote:
>>> >
>>> > > > i've been using webfaction.com for a while for $9/mo with one
>>> click
>>> > > > django installs.  You can also checkoutwww.slicehost.comifyou want
>>> > > > your own vps and more control.
>>> >
>>> > > > --
>>> > > > 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...@googlegroups.com.
>>> > > > For more options, visit this group athttp://
>>> groups.google.com/group/django-users?hl=en.
>>>
>>> --
>>> 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...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>>
>>  --
>> 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...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> 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...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
AJ

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: VERY cheap django hosting?

2011-06-09 Thread raj
Can you please elaborate on the second part of your statement? What do
you mean by specifying what python you use? I've also been trained in
using python 2.7, will I notice a difference if I use 2.4? Thank you.
-Raj

On Jun 9, 3:32 pm, elliot  wrote:
> more specific:
>
> Django is already installed, howto page on setting up a project works
> as expected, comes with ssh. all on the baby plan for $4/month (might
> be more if you only get short contract).
>
> I believe Django is 1.1.  My only complaint is that default python is
> 2.4, but I have been using 2.7 (which is kind of a pain because I have
> to specify it, creating an alias didn't work, as customer support
> verified)
>
> On Jun 9, 1:55 pm, elliot  wrote:
>
>
>
>
>
>
>
> > I use hostgator
>
> > works great for me.  customer service is helpful.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Passing extra context data to class-based generic views?

2011-06-09 Thread Greg
I've created a reusable view which allows for an extra_context argument, 
see 
https://github.com/gregplaysguitar/django-baseclasses/blob/master/baseclasses/views.py

+1 on this functionality being added to django itself though.

-- 
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.com/d/msg/django-users/-/5GdKJkspxk0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django and Rich Client

2011-06-09 Thread Ovnicraft
soaplib 

On Thu, Jun 9, 2011 at 1:10 PM, Knack  wrote:

> Hi guys,
>
> I've got a prototype DB + Rich Client app and need to make a proper
> production app out of it. The client is written in PyQt and needs to
> fullfill quite some functional and performance requirements (I would
> really like to keep it). The client connects directly to the DB.
>
> After some thoughts about security I came to the conclusion that using
> django is the way to go. Now I seek some coarse advice / feedback
> wether I'm heading in the right directions. I've got some miles to go
> and looking forward to learning Django, but want to avoid newbie
> pitfalls. So if something of the following sounds like bad ideas to
> you, please let me know ;-).
>
> Current plans are:
>
> 1) Using an Oracle DB
> 2) LDAP authentification
> 3) Role based authorisation. Here I'm a bit unsure about the approach.
> I would implement it by myself within the django world (don't know yet
> where exactly).
> 4) Transfering the data using a web service via https. Here are my
> biggest uncertainties. What kind of web service to use? Rest, xml-rpc
>

I recommend you REsT, IMHO XML-RPC is not fast, SOAP is a good option but we
get just few libraries under development soaplib[1]  is really promise.


or soap? How to package the acual data? Embedded in the html or xml?
>

Just be light.


Regards,

As binary payload? I would need only basic stuff like log in, log out,
> read and write whole database rows, which are basically the business
> objects. Most of the logic is done on the rich client. I would
> transfer large amounts (10s of business objects) of data at
> startup time (very eager loading to the client). But also lazy loading
> of course.
> 5) One important concept is that I change only a small amount of the
> data objects. Most of the changes lead to new versions. Therefore I
> hope to be able to use caching extensivly. The data objects which are
> immutable could be permanently cached in memory. How about
> authorisation of these cached objects? Are there ways django takes
> care of this?
>
> A long first post ;-). Any comments are appreciated!
>
> Cheers,
>
> Jan
>
> --
> 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...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Cristian Salamea
@ovnicraft

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RE: Django and Rich Client

2011-06-09 Thread Sells, Fred
FWIW  I use flex for the rich client and get xml out of django which
flex handles nicely.

I use Ldap for Authorization (had to use legacy junk for authentication
to be compliant) and I have a cron job that loads the ldap groups I need
and there members into my db.  Solves speed and reliability problems
we've had with our ldap server.

IMHO SOAP sucks unless you're using Java where you've got plenty of
tools.  

The Django templating system is sweet and if you combine it with jquery
you can use that .load() function to "assemble" a page of components.

-Original Message-
From: django-users@googlegroups.com
[mailto:django-users@googlegroups.com] On Behalf Of Knack
Sent: Thursday, June 09, 2011 2:10 PM
To: Django users
Subject: [Suspected Spam] Django and Rich Client

Hi guys,

I've got a prototype DB + Rich Client app and need to make a proper
production app out of it. The client is written in PyQt and needs to
fullfill quite some functional and performance requirements (I would
really like to keep it). The client connects directly to the DB.

After some thoughts about security I came to the conclusion that using
django is the way to go. Now I seek some coarse advice / feedback
wether I'm heading in the right directions. I've got some miles to go
and looking forward to learning Django, but want to avoid newbie
pitfalls. So if something of the following sounds like bad ideas to
you, please let me know ;-).

Current plans are:

1) Using an Oracle DB
2) LDAP authentification
3) Role based authorisation. Here I'm a bit unsure about the approach.
I would implement it by myself within the django world (don't know yet
where exactly).
4) Transfering the data using a web service via https. Here are my
biggest uncertainties. What kind of web service to use? Rest, xml-rpc
or soap? How to package the acual data? Embedded in the html or xml?
As binary payload? I would need only basic stuff like log in, log out,
read and write whole database rows, which are basically the business
objects. Most of the logic is done on the rich client. I would
transfer large amounts (10s of business objects) of data at
startup time (very eager loading to the client). But also lazy loading
of course.
5) One important concept is that I change only a small amount of the
data objects. Most of the changes lead to new versions. Therefore I
hope to be able to use caching extensivly. The data objects which are
immutable could be permanently cached in memory. How about
authorisation of these cached objects? Are there ways django takes
care of this?

A long first post ;-). Any comments are appreciated!

Cheers,

Jan

-- 
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...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.


-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Authentication in API (REST)

2011-06-09 Thread Yohanes Adhi Nugraha
Hi Malcolm,

Not that one, if we use django.contrib.auth and @login_required,  it's
only redirects you to login page.
What I saw from another site is, browser will popup an alert with
username and password to be filled.

Nez

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 'ValuesListQuerySet' object has no attribute 'META'

2011-06-09 Thread Ian Clelland
On Thu, Jun 9, 2011 at 11:00 AM, javatina  wrote:

> I need a list of all IDs for model records. So, I do this
> concept_ids = Concept.objects.values_list('concept_id', flat=True)
>
> concept_ids is a ValuesListQuerySet - I got it. According to docs
> since ValuesListQuerySet is a subclass of QuerySet I can do
> list(concept_ids) - see
>
> https://docs.djangoproject.com/en/dev/ref/models/querysets/#when-querysets-are-evaluated
>
> However, I am getting on this line
> 'ValuesListQuerySet' object has no attribute 'META' error.
>
> For the sake of experimentation, if I try
> concept_ids = list(Concept.objects.all())
>
> I am getting 'QuerySet' object has no attribute 'META'. But this is
> like in docs (see link above):
> entry_list = list(Entry.objects.all())
>
> What am I doing wrong?
>


What are you doing with the list once you generate it? Are you just running
that single line of code, for instance, in a Python shell, or is this error
generated in a view?

"META", in all caps like that, is only used in Django as an attribute of an
HttpRequest object. The string "META" doesn't even occur in the db package,
so I can't imagine how simply wrapping a QuerySet in a list() call could
trigger an exception like that.

Can you post the rest of the code around this, or at least more of a
traceback, unless that is really all that there is? And if it is, then I'd
really like to take a look at your model definition.

-- 
Regards,
Ian Clelland


-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Email app is breaking long lines, any fix?

2011-06-09 Thread John Crawford
Just for the record, to close this off - the problem was solved when I
finally configured Django to send email via my *ISP*. Apparently
Django was doing some unnecessary formatting, whether the output went
to file, console, or even *smtp*, going to a local smtp server: python
-m smtpd -n -c DebuggingServer localhost:1025

Sigh... Live and learn.

John C>

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django daemon

2011-06-09 Thread Nan

Wait... how long has django.utils.daemonize existed, and why isn't it
documented?

(Wishing I'd known about this 12 months ago...)

On Jun 9, 8:19 am, Tom Evans  wrote:
> On Thu, Jun 9, 2011 at 12:50 PM, Sherif Shehab Aldin
>
>  wrote:
> > Actually that's what am doing, am saving the files with timestamp, The
> > question is, do I create a daemon to check the dir and process new files in
> > order, and if that's the best practice, how do I use Django environment in
> > the daemon so I can import the models??
>
> I'm not saying this is the best way to do this, but create a
> management command, and then become a daemon. Django makes this easy:
>
> Management 
> commands:https://docs.djangoproject.com/en/1.3/howto/custom-management-commands/
>
> Becoming a daemon:
> from django.utils.daemonize import become_daemon
> become_daemon(our_home_dir=workdir, out_log=out_log, err_log=err_log)
>
> Personally, I would use a MQ (celery, rabbitmq, django-celery) with
> one worker, and push tasks to the worker.
>
> Cheers
>
> Tom

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django daemon

2011-06-09 Thread Sherif Shehab Aldin
Alright, I think now I know what to do ;-)

Thanks everyone who tried to help :-)

On Thu, Jun 9, 2011 at 3:14 PM, Shawn Milochik  wrote:

> On 06/09/2011 07:50 AM, Sherif Shehab Aldin wrote:
>
>> Actually that's what am doing, am saving the files with timestamp, The
>> question is, do I create a daemon to check the dir and process new files in
>> order, and if that's the best practice, how do I use Django environment in
>> the daemon so I can import the models??
>>
>
> A daemon is probably the best way because that way you don't have to figure
> out whether another instance of the process is running each time.
>
> If you want a script to be able to import models all you have to do is have
> your Django settings file known by your environment.
>
> Either set this environment variable: DJANGO_SETTINGS_MODULE
>
>example (must be on PYTHONPATH, of course):
>export DJANGO_SETTINGS_MODULE=myproject.settings
>
> Or (in the script itself):
>
>os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
>
>
> That stuff is explained in detail here:
> https://docs.djangoproject.com/en/1.3/topics/settings/
>
>
>
> --
> 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...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: abc

2011-06-09 Thread jaspreet kaur
k 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 unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Passing cookies around?

2011-06-09 Thread Roy Smith
We're using django as a front end to a pre-existing web site
implemented in PHP.  The PHP code has a vaguely RESTful interface,
where you can make HTTP calls on it and get back JSON-ized data.  The
django layer sits in front of that and talks directly to the browser.
We're not using any models in django; just using the views to render
django templates using the data from the PHP back end.

Authentication on the original site was via session cookies maintained
in the browser.  We're trying to figure out how to make the django
layer deal with authentication.  My thought is that it shouldn't.  It
should be entirely stateless, and just transparently pass cookie
headers back and forth between the browser and the PHP back end.
Probably by using some middleware to do this.

Has anybody done anything like this before?  Am I heading off into
weeds?

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Serge Illaryonov wants to chat

2011-06-09 Thread Serge Illaryonov
---

Serge Illaryonov wants to stay in better touch using some of Google's
coolest new
products.

If you already have Gmail or Google Talk, visit:
http://mail.google.com/mail/b-888d96fd0a-997bf05459-ELIpu97555fCtl3jlI1zKT_ZJlE
You'll need to click this link to be able to chat with Serge Illaryonov.

To get Gmail - a free email account from Google with over 2,800 megabytes of
storage - and chat with Serge Illaryonov, visit:
http://mail.google.com/mail/a-888d96fd0a-997bf05459-ELIpu97555fCtl3jlI1zKT_ZJlE

Gmail offers:
- Instant messaging right inside Gmail
- Powerful spam protection
- Built-in search for finding your messages and a helpful way of organizing
  emails into "conversations"
- No pop-up ads or untargeted banners - just text ads and related information
  that are relevant to the content of your messages

All this, and its yours for free. But wait, there's more! By opening a Gmail
account, you also get access to Google Talk, Google's instant messaging
service:

http://www.google.com/talk/

Google Talk offers:
- Web-based chat that you can use anywhere, without a download
- A contact list that's synchronized with your Gmail account
- Free, high quality PC-to-PC voice calls when you download the Google Talk
  client

We're working hard to add new features and make improvements, so we might also
ask for your comments and suggestions periodically. We appreciate your help in
making our products even better!

Thanks,
The Google Team

To learn more about Gmail and Google Talk, visit:
http://mail.google.com/mail/help/about.html
http://www.google.com/talk/about.html

(If clicking the URLs in this message does not work, copy and paste them into
the address bar of your browser).

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Serge Illaryonov wants to chat

2011-06-09 Thread Serge Illaryonov
---

Serge Illaryonov wants to stay in better touch using some of Google's
coolest new
products.

If you already have Gmail or Google Talk, visit:
http://mail.google.com/mail/b-888d96fd0a-3b21a3b9fb-Uvp05Dr0RIOiVE4GbtbXCoYF7_w
You'll need to click this link to be able to chat with Serge Illaryonov.

To get Gmail - a free email account from Google with over 2,800 megabytes of
storage - and chat with Serge Illaryonov, visit:
http://mail.google.com/mail/a-888d96fd0a-3b21a3b9fb-Uvp05Dr0RIOiVE4GbtbXCoYF7_w

Gmail offers:
- Instant messaging right inside Gmail
- Powerful spam protection
- Built-in search for finding your messages and a helpful way of organizing
  emails into "conversations"
- No pop-up ads or untargeted banners - just text ads and related information
  that are relevant to the content of your messages

All this, and its yours for free. But wait, there's more! By opening a Gmail
account, you also get access to Google Talk, Google's instant messaging
service:

http://www.google.com/talk/

Google Talk offers:
- Web-based chat that you can use anywhere, without a download
- A contact list that's synchronized with your Gmail account
- Free, high quality PC-to-PC voice calls when you download the Google Talk
  client

We're working hard to add new features and make improvements, so we might also
ask for your comments and suggestions periodically. We appreciate your help in
making our products even better!

Thanks,
The Google Team

To learn more about Gmail and Google Talk, visit:
http://mail.google.com/mail/help/about.html
http://www.google.com/talk/about.html

(If clicking the URLs in this message does not work, copy and paste them into
the address bar of your browser).

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Authentication in API (REST)

2011-06-09 Thread Malcolm Box
On 9 June 2011 17:51, Neznez  wrote:

> Hi all, I'm newbie in Django, and I started to build my own API. I
> know that there is Piston or Django REST framework, but I want to
> learn API from scratch. What I want to know is, how to make my HTTP
> Response (View) is perform authentication before can be accessed, or
> we can make it have to throw username and password to access the HTTP
> Response?
>
>
https://docs.djangoproject.com/en/1.3/topics/auth/

Malcolm

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Boolean field, unexpected behavior

2011-06-09 Thread Malcolm Box
On 9 June 2011 21:16, elliot  wrote:

> However, I'm still not clear why i can save without specifying values
> for the CharField or BooleanField.  I didn't say null="true", and I
> didn't provide default values.
>
>
Because both have sensible default values ("" for CharField, False for
BooleanField), and because a Boolean field cannot be null (you need a
NullBooleanField for that).

Malcolm

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Boolean field, unexpected behavior

2011-06-09 Thread elliot
Thanks,

Your email wasn't showing up when I sent the second one.  Little bit
of lag i guess.  What a noob mistake, thanks for the clarification.

I did originally have a default in my model instance, but i deleted it
as part of the debugging.

However, I'm still not clear why i can save without specifying values
for the CharField or BooleanField.  I didn't say null="true", and I
didn't provide default values.

Thanks again,
Elliot

On Jun 9, 2:44 pm, Shawn Milochik  wrote:
> On 06/09/2011 03:42 PM, elliot wrote:
>
> > to my great annoyance, not specifying active has lead to the objects
> > being created as I wanted.  But I cannot rely on this.  Seems like
> > m.active is true if either true or false is specified, and is false if
> > it is never initialized.
>
> See my previous e-mail. If you specify the string 'True' or 'False'
> it'll always evaluate to True.
>
> Also, set a default value in your model.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: NoReverseMatch Error

2011-06-09 Thread krzysiekpl
Hi,

Look at this:

https://docs.djangoproject.com/en/dev/topics/http/urls/#reverse

`viewname` is incorrect in your app you must use 'poll_results'
instead of 'polls.views.results'


Krzysztof Hoffmann


On 9 Cze, 09:28, bahare hoseini  wrote:
> hi there,
> this is my views.py that doesn't have any problem:
>
> from django.shortcuts import get_object_or_404, render_to_response
> from django.core.urlresolvers import reverse
> .
> .
> .
>         return HttpResponseRedirect(reverse('polls.views.results', args=(
> p.id,)))
>
> def results(request, poll_id):
>     p = get_object_or_404(Poll, pk=poll_id)
>     return render_to_response('(...)/polls/results.html', {'poll': p})
> --- 
> -
> but when i edit my urls.py like this:
>
> #...
> urlpatterns = patterns('',
>     (r'^$',
>         ListView.as_view(
>             queryset=Poll.objects.order_by('-pub_date')[:5],
>             context_object_name='latest_poll_list',
>             template_name='(...)polls/index.html')),
>     (r'^(?P\d+)/$',
>         DetailView.as_view(
>             model=Poll,
>             template_name='(...)polls/detail.html')),
>     url(r'^(?P\d+)/results/$',
>         DetailView.as_view(
>             model=Poll,
>             template_name='(...)polls/results.html'),
>         name='poll_results'),
>     (r'^(?P\d+)/vote/$', 'polls.views.vote'),
> --- 
> ---
> and open my browser with the link (http://localhost:8000/polls/id=1/vote),
> I'd face this error: can anybody help please?
>
> Reverse for 'polls.views.results' with arguments '(id=1,)' and keyword
> arguments '{}' not found.
>
> can anybody help?

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Boolean field, unexpected behavior

2011-06-09 Thread Shawn Milochik

On 06/09/2011 03:42 PM, elliot wrote:

to my great annoyance, not specifying active has lead to the objects
being created as I wanted.  But I cannot rely on this.  Seems like
m.active is true if either true or false is specified, and is false if
it is never initialized.


See my previous e-mail. If you specify the string 'True' or 'False' 
it'll always evaluate to True.


Also, set a default value in your model.


--
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



auth.LoginTest seems to require sites

2011-06-09 Thread Brian
Hi,

When I run the unit tests, I get a failure (stack trace below) 
from django.contrib.auth.tests.views.LoginTest. 
test_current_site_in_context_after_login calls Site.objects.get_current() 
which fails because I'm not using that app. If I include it in the list of 
installed apps, then the test passes. However, then a bunch of the tests 
that I've written fail; I think that's because they are using fixtures that 
are not valid with respect to the schema defined the inclusion of sites, but 
I haven't confirmed this.

The standard apps that I'm using are:
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',

Is the test broken or is there something that I'm doing that makes the sites 
app mandatory?

Thanks for any help you can give,

Brian

=

ERROR: test_current_site_in_context_after_login 
(django.contrib.auth.tests.views.LoginTest)
--
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/django/contrib/auth/tests/views.py", 
line 182, in test_current_site_in_context_after_login
site = Site.objects.get_current()
  File "/usr/lib/pymodules/python2.6/django/contrib/sites/models.py", line 
22, in get_current
current_site = self.get(pk=sid)
  File "/usr/lib/pymodules/python2.6/django/db/models/manager.py", line 132, 
in get
return self.get_query_set().get(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 336, 
in get
num = len(clone)
  File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 81, in 
__len__
self._result_cache = list(self.iterator())
  File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 269, 
in iterator
for row in compiler.results_iter():
  File "/usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py", line 
672, in results_iter
for rows in self.execute_sql(MULTI):
  File "/usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py", line 
727, in execute_sql
cursor.execute(sql, params)
  File "/usr/lib/pymodules/python2.6/django/db/backends/sqlite3/base.py", 
line 200, in execute
return Database.Cursor.execute(self, query, params)
DatabaseError: no such table: django_site

-- 
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.com/d/msg/django-users/-/NVb0a5A1C2cJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Boolean field, unexpected behavior

2011-06-09 Thread elliot
to my great annoyance, not specifying active has lead to the objects
being created as I wanted.  But I cannot rely on this.  Seems like
m.active is true if either true or false is specified, and is false if
it is never initialized.

On Jun 9, 2:24 pm, elliot  wrote:
> I am not new to django, but this misbehavior is blowing my mind.  I
> cannot understand what is happening.  please help.
>
> Django 1.1
>
> I have:
> class MeetingMember(models.Model):
>     lastname = models.CharField(max_length = 30)
>     firstname = models.CharField(max_length = 30)
>     active = models.BooleanField()
>
> and a script to set initial values:
>
> def fillmembers():
>
>     pad_unreals= 1
>
>     print "ALL: ",MeetingMember.objects.all()
>
>     for x in range(pad_unreals):
>         m = MeetingMember()
>         m.firstname, m.lastname = 'unsued','unused'
>         m.save()
>         print "1: ",m.pk,m.active
>         m.active = "False"
>         print "2: ",m.active
>         m.save()
>         print "3: ",m.pk,m.active
>         print ""
>
>     for x in MeetingMember.objects.all():
>         print x.pk,x.active
>
> And the output i get is:
>
> ALL:  []
> 1:  1 False
> 2:  False
> 3:  1 False
>
> 1 True
>
> ###
>
> !?
>
> This is starting with a freshly synced DB (sqlite)
>
> First, why can i save without specifying active? (also, the CharFields
> seem to be empty stings and i can save without specifying them also)
>
> second, after specifying false, saving and verifying that it is false,
> when I retrieve it from the DB, I get true!
>
> I can edit it in the admin to false and it stays false,  I can edit it
> on the command line and it stays false.  but the script behaves oddly.
>
> please help, and I will learn something important.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Boolean field, unexpected behavior

2011-06-09 Thread Shawn Milochik

You have two problems:

1. You're assigning a string to a boolean. The string will evaluate to true.

2. You're not re-querying the database after the first save, so your 'm' 
instance still retains the string 'False.'


Here's some sample output with commentary which will illustrate.

#get an object from the database
>>> x = SomeModel.objects.get(pk = 1)

#it's currently False
>>> x.some_bool
False

#assign some junk that's not True or False
>>> x.some_bool = 'apple'

#yep, still there...
x.some_bool
>>> 'apple'

#this just saved True in the database
#because 'apple' evaluates to True.
>>> x.save()

#but my in-memory instance still contains 'apple'
>>> x.some_bool
'apple'

#until I go get it from the database again.
>>> x = SomeModel.objects.get(pk = 1)

>>> x.some_bool
True


--
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: VERY cheap django hosting?

2011-06-09 Thread elliot
more specific:

Django is already installed, howto page on setting up a project works
as expected, comes with ssh. all on the baby plan for $4/month (might
be more if you only get short contract).

I believe Django is 1.1.  My only complaint is that default python is
2.4, but I have been using 2.7 (which is kind of a pain because I have
to specify it, creating an alias didn't work, as customer support
verified)

On Jun 9, 1:55 pm, elliot  wrote:
> I use hostgator
>
> works great for me.  customer service is helpful.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Boolean field, unexpected behavior

2011-06-09 Thread elliot
I am not new to django, but this misbehavior is blowing my mind.  I
cannot understand what is happening.  please help.

Django 1.1

I have:
class MeetingMember(models.Model):
lastname = models.CharField(max_length = 30)
firstname = models.CharField(max_length = 30)
active = models.BooleanField()

and a script to set initial values:

def fillmembers():

pad_unreals= 1

print "ALL: ",MeetingMember.objects.all()

for x in range(pad_unreals):
m = MeetingMember()
m.firstname, m.lastname = 'unsued','unused'
m.save()
print "1: ",m.pk,m.active
m.active = "False"
print "2: ",m.active
m.save()
print "3: ",m.pk,m.active
print ""

for x in MeetingMember.objects.all():
print x.pk,x.active


And the output i get is:


ALL:  []
1:  1 False
2:  False
3:  1 False

1 True


###

!?

This is starting with a freshly synced DB (sqlite)

First, why can i save without specifying active? (also, the CharFields
seem to be empty stings and i can save without specifying them also)

second, after specifying false, saving and verifying that it is false,
when I retrieve it from the DB, I get true!

I can edit it in the admin to false and it stays false,  I can edit it
on the command line and it stays false.  but the script behaves oddly.

please help, and I will learn something important.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django admin report

2011-06-09 Thread Leonardo da Costa Santos
Good morning guys!

I came to share with you the Django Admin Report ... she is a little Django
app that makes it easy to export reports in PDF using the administration
interface of django.

The idea is to just tell the class of directors which is the list of template
fields to be exported (list_report) and add a generic action (report_generic
), which he does the rest alone. With this you use the filters bassta
administration and research and select the lines that go to the report by
clicking on the action (Generating report net) PDF will appear in your
browser to be downloaded!

You can encortrar the sources here:
https://github.com/leonardocsantoss/django-admin-report


Today in list_report attributes can be passed either as methods ... Yet he can
not print an attribute of a foreign key ... This will be the next step
would the
project!

Thanks! And hopefully save a few hours of you!

Sincerely,

Leonardo da Costa Santos
Desenvolvedor na e-Tick/EasyWeb
Graduando em Sistemas de Informação - FIP

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: VERY cheap django hosting?

2011-06-09 Thread elliot
I use hostgator

works great for me.  customer service is helpful.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: abc

2011-06-09 Thread Iván Raskovsky
Hello, why don't you start with the first steps[0]?

https://docs.djangoproject.com/en/1.3/#first-steps

On Thu, Jun 9, 2011 at 3:29 PM, jaspreet  wrote:
> i m new to django ...i need the help
>
> --
> 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...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



abc

2011-06-09 Thread jaspreet
i m new to django ...i need the help

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: VERY cheap django hosting?

2011-06-09 Thread Jagdeep Singh Malhi

Webfraction.com  very cheap for hosting django

For more plan :
http://www.webfaction.com/services/hosting

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Add custom html between two model fields in Django admin's change_form

2011-06-09 Thread mf
Thanks christian, it worked!!.

On 8 jun, 12:21, "christian.posta"  wrote:
> Well, there are a couple things you could do:
>
> for the PresupuestoAdminForm, you could do this to the CharField:
> name = forms.CharField(max_length=100,
> widget=forms.TextInput(attrs={'readonly': 'readonly'}))
> (note the CharField is from the 'forms' package, not the 'models'
> you'll also need to remove the 'name' entry from the readonly_fields
> tuple)
>
> Alternatively, you could ignore using the custom ModelForm, and add
> the 'name' field directly to the PresupuestoAdmin class. In that case
> you can use the readonly_fields tuple.
>
> I would probably go with the first choice since it will allow you to
> write a custom query to populate the field in the constructor.
>
> Example:
>
> class StoreAdminForm(forms.ModelForm):
>     test = forms.CharField(max_length=100,
> widget=forms.TextInput(attrs={'readonly': 'readonly'}))
>
>     def __init__(self, *args, **kwargs):
>         super(StoreAdminForm, self).__init__(*args, **kwargs)
>
>         if kwargs.has_key('instance'):
>             instance = kwargs['instance']
>             # do something with the instance here, like use it to
> calculate something,
>             # then set the value on the 'test' field using
> self.fields['test']
>
>     class Meta:
>         model = Store
>
> Good luck!
>
> On Jun 7, 9:16 am, mf  wrote:
>
>
>
>
>
>
>
> > Thanks christian. I've followed your good advice but I don't know why
> > am I getting  this error: "PresupuestoAdmin.readonly_fields[1], 'name'
> > is not a callable or an attribute of 'PresupuestoAdmin' or found in
> > the model 'Presupuesto' ". It seems that the 'name' field is not added
> > to the form used by the admin.
>
> > class PresupuestoAdminForm(forms.ModelForm):
> >     name = models.CharField(max_length=100)
>
> >     class Meta:
> >         model = Presupuesto
>
> > class PresupuestoAdmin(admin.ModelAdmin):
> >     form = PresupuestoAdminForm
>
> >     fieldsets = (
> >         (None, {
> >             'fields': (('id', 'fecha_emision', ), ('obra',
> > 'num_pres_ext',),
> >             'proveedor', 'descripcion', 'observaciones',
> > 'importe_contratado',)
> >         }),
> >     )
> >     readonly_fields = ('id', 'name',)
>
> > admin.site.register(Presupuesto, PresupuestoAdmin)
>
> > On 7 jun, 11:11, "christian.posta"  wrote:
>
> > > Create a different ModelForm that contains your readonly fields (and
> > > populate them however you want) and set this on your ModelAdmin form.
>
> > > See the ModelAdmin.form option in the 
> > > docs.https://docs.djangoproject.com/en/1.2/ref/contrib/admin/#modeladmin-o...
>
> > > On Jun 7, 6:01 am, mf  wrote:
>
> > > > Let's say I've two models:
>
> > > >     class Book(models.Model):
> > > >         name = models.CharField(max_length=50)
> > > >         library = models.ForeignKeyField('Library')
>
> > > >     class Library(models.Model):
> > > >         name = models.CharField(max_length=50)
> > > >         address = models.CharField(max_length=50)
> > > >         tel = models.CharField(max_length=50)
>
> > > > Is there a nice way to add some html(a readonly input field) between
> > > > name and address in the Library change_form template?. I'm doing it
> > > > overriding [admin/includes/fieldset.html][1] but it's getting messy
> > > > and I can't find a way to display the html exactly where I want to.
> > > > For example, if I want to add html displaying the amount of books that
> > > > the library has below the name field I woul do this:
>
> > > >     {% for field in line %}
> > > >         ...
> > > >         {% if field.field.name == 'name' %}
> > > >             {{ field.field }}
> > > >             
> > > >                 
> > > >                     Total books:
> > > >                      > > > id="totbooks" readonly="readonly">
> > > >                 
> > > >            
> > > >         {% else %}
> > > >             {{ field.field }}
> > > >         {% endif %}
> > > >         ...
> > > >     {% endfor %}
>
> > > >   
> > > > [1]:https://code.djangoproject.com/browser/django/trunk/django/contrib/ad...

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: VERY cheap django hosting?

2011-06-09 Thread Aaron Madison
I put all my projects on Google AppEngine ...
works pretty well with
django-nonrel
although sometimes there are some fairly significant concessions you might
have to live with to go this route. AppEngine is free if you stay under the
generous quotas, or a nominal charge if you go over.

On Thu, Jun 9, 2011 at 9:48 AM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Just as a side note guys, I know there are tons of PHP hosting providers
> out there which offer dirt cheap hosting, but Python hosting is *extremely*
> different to PHP. A lot of providers simply don't have any concept of how to
> properly manage a webapp deployment in production.
>
> I'd really question why you'd want a cheap host in the first place. If it's
> for development/learning, then a VPS is a great choice. However, if this is
> for a production site, then this might not be the best idea.
>
> My apologies if I've duplicated what's already been said (I haven't seen
> all the replies yet).
>
> Cal
>
>
>
>
> On Thu, Jun 9, 2011 at 5:50 AM, raj  wrote:
>
>> Actually, I might reconsider,
>> What do you guys think of hostgator? They also have django hosting
>> with fastcgi, And there's is shared hosting. Pros, cons?
>> Thanks
>> -Raj
>> On Jun 9, 12:27 am, raj  wrote:
>> > Ya, i think as a first timer, I'm gunna go with something that is non-
>> > vps. I'll learn about preconfiguring stuff when the time comes. I
>> > think djangohosting.ch looks the best. But asmallorange and alwaysdata
>> > also look appealing. Thanks all.
>> >
>> > On Jun 8, 8:58 pm, ApogeeGMail  wrote:
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > > +1 for webfaction
>> > > On Jun 8, 2011, at 8:29 PM, Bobby Roberts wrote:
>> >
>> > > > i've been using webfaction.com for a while for $9/mo with one click
>> > > > django installs.  You can also checkoutwww.slicehost.comifyou want
>> > > > your own vps and more control.
>> >
>> > > > --
>> > > > 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...@googlegroups.com.
>> > > > For more options, visit this group athttp://
>> groups.google.com/group/django-users?hl=en.
>>
>> --
>> 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...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>  --
> 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...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django and Rich Client

2011-06-09 Thread Knack
Hi guys,

I've got a prototype DB + Rich Client app and need to make a proper
production app out of it. The client is written in PyQt and needs to
fullfill quite some functional and performance requirements (I would
really like to keep it). The client connects directly to the DB.

After some thoughts about security I came to the conclusion that using
django is the way to go. Now I seek some coarse advice / feedback
wether I'm heading in the right directions. I've got some miles to go
and looking forward to learning Django, but want to avoid newbie
pitfalls. So if something of the following sounds like bad ideas to
you, please let me know ;-).

Current plans are:

1) Using an Oracle DB
2) LDAP authentification
3) Role based authorisation. Here I'm a bit unsure about the approach.
I would implement it by myself within the django world (don't know yet
where exactly).
4) Transfering the data using a web service via https. Here are my
biggest uncertainties. What kind of web service to use? Rest, xml-rpc
or soap? How to package the acual data? Embedded in the html or xml?
As binary payload? I would need only basic stuff like log in, log out,
read and write whole database rows, which are basically the business
objects. Most of the logic is done on the rich client. I would
transfer large amounts (10s of business objects) of data at
startup time (very eager loading to the client). But also lazy loading
of course.
5) One important concept is that I change only a small amount of the
data objects. Most of the changes lead to new versions. Therefore I
hope to be able to use caching extensivly. The data objects which are
immutable could be permanently cached in memory. How about
authorisation of these cached objects? Are there ways django takes
care of this?

A long first post ;-). Any comments are appreciated!

Cheers,

Jan

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Authentication in API (REST)

2011-06-09 Thread Neznez
Hi all, I'm newbie in Django, and I started to build my own API. I
know that there is Piston or Django REST framework, but I want to
learn API from scratch. What I want to know is, how to make my HTTP
Response (View) is perform authentication before can be accessed, or
we can make it have to throw username and password to access the HTTP
Response?

My code is very simple, like this one:
def test_api_view(request, whatever):
  #
  # do things
  #
  return HttpResponse(serializers.serialize("json", mydictionary),
mimetype='application/json')

Thank you.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



'ValuesListQuerySet' object has no attribute 'META'

2011-06-09 Thread javatina
I need a list of all IDs for model records. So, I do this
concept_ids = Concept.objects.values_list('concept_id', flat=True)

concept_ids is a ValuesListQuerySet - I got it. According to docs
since ValuesListQuerySet is a subclass of QuerySet I can do
list(concept_ids) - see
https://docs.djangoproject.com/en/dev/ref/models/querysets/#when-querysets-are-evaluated

However, I am getting on this line
'ValuesListQuerySet' object has no attribute 'META' error.

For the sake of experimentation, if I try
concept_ids = list(Concept.objects.all())

I am getting 'QuerySet' object has no attribute 'META'. But this is
like in docs (see link above):
entry_list = list(Entry.objects.all())

What am I doing wrong?

Thanks,

Serge

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Updating static files: Still in browser cache

2011-06-09 Thread Malcolm Box


Sent from my iPhone, please excuse any typos

On 9 Jun 2011, at 14:21, DrBloodmoney  wrote:

> On Thu, Jun 9, 2011 at 9:16 AM, Malcolm Box  wrote:
>> On 9 June 2011 08:09, Thomas Guettler  wrote:
>>> 
>>> My static files (JS/CSS) are cached in the browser. But if there is a bug
>>> in a file, an update won't help people which have already cached the old
>>> file.
>>> 
>>> You would need a new URL for every change in the JS/CSS files.
>>> 
>> 
>> Version all static assets, bump the version when you change them.
> 
> I keep the file name the same and append a querystring eg.
> /static/js/mycustom.js?v=1001 then just increment the querystring on
> versioning.

That works but may bust intermediate caches. Some won't cache anything with a 
query string. 

Malcolm

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



hierarchal inheritance

2011-06-09 Thread LurkingFrog
In our current system, I have noted a pattern of hierarchal inheritance with 
regards to gathering configuration information .  In the simplest case, we 
add generic foreign key to the table containing the configuration and check 
the existence of records in order of a predetermined precedence. For 
example, to find a pay rate for work completed we check for the following 
objects in the rate table:

   1. Contractor - the person being paid
   2. WorkType - the reason the payment is being made
   3. JobSite - the location making the payment
   4. Client - the account it is being payed from
   
These objects are not related except by business logic and the hierarchy 
varies depending on the setting being asked for.  While code which using 
this data is simple, the administration has become incredibly difficult from 
a UI perspective.

I was wondering if there are any apps out there which implement this kind of 
functionality with the associated admin pages/widgets before I go rolling my 
own.  I have looked, but haven't been able to find anything that suits this 
situation.
 
Thanks   

-- 
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.com/d/msg/django-users/-/bu0F4clGnSwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 2 projects based on the same codebase

2011-06-09 Thread Benedict Verheyen

> Hi,
> 
> 
> I developed a calltracking for our team and now, another team is interested 
> to have their own calltracking.
> The best way to seem to deal with a project that is the same from the start, 
> is to makea new virtualenv
> and "git clone" the codebase. The new project might slightly differ in the 
> futur.
> 
> I have a development machine where I maintain the code, then "git push" the 
> code to a server.
> On the production machine, i "git pull" the code.
> This all works but what if the 2nd team wants slight changes, changes that my 
> team may not want?
> 2 virtualenv's based on the same code might not be the best option in this 
> case.
> 
> Do I create a new repository for the code of the other project ?
> I feels like the best way to go ahead.
> However, this would mean that I need to maintain 2 projects that are and 
> probably will remain very similar.
> How would i transfer code changes from 1 repository to the other? Patches?
> 
> Thanks for any insight, or links to documentation that deal with this kind of 
> setup and
> sorry in advance for going OT.
> 
> Regards,
> Benedict
> 

Hi,

thanks for the info.
I will use a seperate repository for the 2nd project.

Regards,
Benedict

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: VERY cheap django hosting?

2011-06-09 Thread Cal Leeming [Simplicity Media Ltd]
Just as a side note guys, I know there are tons of PHP hosting providers out
there which offer dirt cheap hosting, but Python hosting is *extremely*
different to PHP. A lot of providers simply don't have any concept of how to
properly manage a webapp deployment in production.

I'd really question why you'd want a cheap host in the first place. If it's
for development/learning, then a VPS is a great choice. However, if this is
for a production site, then this might not be the best idea.

My apologies if I've duplicated what's already been said (I haven't seen all
the replies yet).

Cal



On Thu, Jun 9, 2011 at 5:50 AM, raj  wrote:

> Actually, I might reconsider,
> What do you guys think of hostgator? They also have django hosting
> with fastcgi, And there's is shared hosting. Pros, cons?
> Thanks
> -Raj
> On Jun 9, 12:27 am, raj  wrote:
> > Ya, i think as a first timer, I'm gunna go with something that is non-
> > vps. I'll learn about preconfiguring stuff when the time comes. I
> > think djangohosting.ch looks the best. But asmallorange and alwaysdata
> > also look appealing. Thanks all.
> >
> > On Jun 8, 8:58 pm, ApogeeGMail  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > +1 for webfaction
> > > On Jun 8, 2011, at 8:29 PM, Bobby Roberts wrote:
> >
> > > > i've been using webfaction.com for a while for $9/mo with one click
> > > > django installs.  You can also checkoutwww.slicehost.comifyou want
> > > > your own vps and more control.
> >
> > > > --
> > > > 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...@googlegroups.com.
> > > > For more options, visit this group athttp://
> groups.google.com/group/django-users?hl=en.
>
> --
> 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...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Updating static files: Still in browser cache

2011-06-09 Thread Martin
Use django-compressor.

On Thu, Jun 9, 2011 at 9:21 PM, DrBloodmoney  wrote:

> On Thu, Jun 9, 2011 at 9:16 AM, Malcolm Box  wrote:
> > On 9 June 2011 08:09, Thomas Guettler  wrote:
> >>
> >> My static files (JS/CSS) are cached in the browser. But if there is a
> bug
> >> in a file, an update won't help people which have already cached the old
> >> file.
> >>
> >> You would need a new URL for every change in the JS/CSS files.
> >>
> >
> > Version all static assets, bump the version when you change them.
>
> I keep the file name the same and append a querystring eg.
> /static/js/mycustom.js?v=1001 then just increment the querystring on
> versioning.
>
> --
> 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...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Payment form

2011-06-09 Thread delegbede
Get another IT Guy or become one.
Sent from my BlackBerry wireless device from MTN

-Original Message-
From: lillian 
Sender: django-users@googlegroups.com
Date: Thu, 9 Jun 2011 06:41:57 
To: Django users
Reply-To: django-users@googlegroups.com
Subject: Payment form

Hello, I want to set up a Payment form on my Listen On Demand talk
programs.  How does one set up a form on this system.  Please use
simple words.  I've lost my IT guy and I'm on my own.  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 unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Payment form

2011-06-09 Thread Tom Evans
On Thu, Jun 9, 2011 at 2:41 PM, lillian  wrote:
> Hello, I want to set up a Payment form on my Listen On Demand talk
> programs.  How does one set up a form on this system.  Please use
> simple words.  I've lost my IT guy and I'm on my own.  Thanks,
>

Hire a new IT guy. This is not a trivial topic.

If you are determined to do it by yourself, you will need to learn a
lot of details. Start with the Django tutorial.

Did you have a payment processor in mind?

Cheers

Tom

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Payment form

2011-06-09 Thread lillian
Hello, I want to set up a Payment form on my Listen On Demand talk
programs.  How does one set up a form on this system.  Please use
simple words.  I've lost my IT guy and I'm on my own.  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 unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Updating static files: Still in browser cache

2011-06-09 Thread DrBloodmoney
On Thu, Jun 9, 2011 at 9:16 AM, Malcolm Box  wrote:
> On 9 June 2011 08:09, Thomas Guettler  wrote:
>>
>> My static files (JS/CSS) are cached in the browser. But if there is a bug
>> in a file, an update won't help people which have already cached the old
>> file.
>>
>> You would need a new URL for every change in the JS/CSS files.
>>
>
> Version all static assets, bump the version when you change them.

I keep the file name the same and append a querystring eg.
/static/js/mycustom.js?v=1001 then just increment the querystring on
versioning.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Updating static files: Still in browser cache

2011-06-09 Thread Malcolm Box
On 9 June 2011 08:09, Thomas Guettler  wrote:

> My static files (JS/CSS) are cached in the browser. But if there is a bug
> in a file, an update won't help people which have already cached the old
> file.
>
> You would need a new URL for every change in the JS/CSS files.
>
>
Version all static assets, bump the version when you change them.

Malcolm

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django daemon

2011-06-09 Thread Shawn Milochik

On 06/09/2011 07:50 AM, Sherif Shehab Aldin wrote:
Actually that's what am doing, am saving the files with timestamp, The 
question is, do I create a daemon to check the dir and process new 
files in order, and if that's the best practice, how do I use Django 
environment in the daemon so I can import the models??


A daemon is probably the best way because that way you don't have to 
figure out whether another instance of the process is running each time.


If you want a script to be able to import models all you have to do is 
have your Django settings file known by your environment.


Either set this environment variable: DJANGO_SETTINGS_MODULE

example (must be on PYTHONPATH, of course):
export DJANGO_SETTINGS_MODULE=myproject.settings

Or (in the script itself):

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'


That stuff is explained in detail here:
https://docs.djangoproject.com/en/1.3/topics/settings/


--
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django daemon

2011-06-09 Thread Tom Evans
On Thu, Jun 9, 2011 at 12:50 PM, Sherif Shehab Aldin
 wrote:
> Actually that's what am doing, am saving the files with timestamp, The
> question is, do I create a daemon to check the dir and process new files in
> order, and if that's the best practice, how do I use Django environment in
> the daemon so I can import the models??
>

I'm not saying this is the best way to do this, but create a
management command, and then become a daemon. Django makes this easy:

Management commands:
https://docs.djangoproject.com/en/1.3/howto/custom-management-commands/

Becoming a daemon:
from django.utils.daemonize import become_daemon
become_daemon(our_home_dir=workdir, out_log=out_log, err_log=err_log)

Personally, I would use a MQ (celery, rabbitmq, django-celery) with
one worker, and push tasks to the worker.

Cheers

Tom

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django daemon

2011-06-09 Thread Sherif Shehab Aldin
Actually that's what am doing, am saving the files with timestamp, The
question is, do I create a daemon to check the dir and process new files in
order, and if that's the best practice, how do I use Django environment in
the daemon so I can import the models??


On Thu, Jun 9, 2011 at 1:46 PM, Shawn Milochik  wrote:

> Here's one idea:
>
> When you retrieve the files from the remote server, put them in your local
> temp directory named with a datestamp.
>
> Then, just ensure you process them in order, and you won't have to worry
> about the out-of-order insertions.
>
>
> --
> 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...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django daemon

2011-06-09 Thread Shawn Milochik

Here's one idea:

When you retrieve the files from the remote server, put them in your 
local temp directory named with a datestamp.


Then, just ensure you process them in order, and you won't have to worry 
about the out-of-order insertions.



--
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django daemon

2011-06-09 Thread Sherif Shehab Aldin
Hi all,

I need your suggestions regarding the following.
I have a Django app, with custom command that runs throw cron and it grabs
files from some servers, those files holds data that needs to be inserted
into Django models. I can't make the Django command to read the files and
insert the data into the models because that could take much time, and the
next cron job could have been started, which results in unsorted insertion


What am thinking of right now, is having a daemon that checks for new files,
and reads the data, adds the records to the model. But how do I access
Django environment from a separate daemon??

I am not sure If that's the right way to do it anyway, so any suggestions is
highly appreciated. :)

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django transactions.

2011-06-09 Thread Malcolm Box
On 8 June 2011 11:07, Marc Aymerich  wrote:

> On Tue, Jun 7, 2011 at 11:53 PM, Malcolm Box 
> wrote:
> > n 7 June 2011 15:16, Marc Aymerich  wrote:You're
> right :) I'm using Mysql with myisam, I'm going to switch to
> InnoDB engine and try again.
>
> I thought that the transaction stuff were implemented in python and
> doesn't relay on DB backend. :(
>
>
As a thought experiment, how did you think that would work? Remember in
production there's a bunch of separate processes running Django - how would
they implement a database transaction?

Malcolm

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django-ztask

2011-06-09 Thread Markus Gattol
since you want feedback, that's 
http://www.reddit.com/r/Python/comments/hve19/django_zeromq_djangoztask/
probably something to watch :)

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django solved tutorial for download??

2011-06-09 Thread Harjot Gill
www.djangoproject.com , this is the official website of django.In this
website you will find the solved example of django application.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: tuple comparison to make one tuple

2011-06-09 Thread MikeKJ


Excellent thank you guys and thanks for the pointer to itertools
-- 
View this message in context: 
http://old.nabble.com/tuple-comparison-to-make-one-tuple-tp31802229p31808134.html
Sent from the django-users mailing list archive at Nabble.com.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 2 projects based on the same codebase

2011-06-09 Thread Malcolm Box
On 9 June 2011 08:06, Benedict Verheyen  wrote:

>
> I developed a calltracking for our team and now, another team is interested
> to have their own calltracking.
> The best way to seem to deal with a project that is the same from the
> start, is to makea new virtualenv
> and "git clone" the codebase. The new project might slightly differ in the
> futur.
>
>
Clone the codebase into a new repository for the new team. Deploy from this
repository to your server, so each team has their own repository deployed
into their own virtualenv.

Then if either side modifies the common code, you can git push/git pull the
changes across between the two root repositories.

You could also consider using git submodules to refer to the "master" copy
of the calltracking module in the second team repository.

Malcolm

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django solved tutorial for download??

2011-06-09 Thread Praveen Krishna R
I don't understand what you mean by "django tutorial solved"
There is a tutorial which gets you up and running with django, if you are a
beginner. and its here ! https://docs.*django*
project.com/en/dev/intro/tutorial01/
*
*
On Wed, Jun 8, 2011 at 5:09 PM, Pardini Andres  wrote:

> Hi guys,
>
> I am looking for django tutorial solved, for downloading
>
> If anyone has a link, please share it :)
>
> Cheers!!
>
> --
> 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...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 2 projects based on the same codebase

2011-06-09 Thread delegbede
Hi Benedict,

This is a mere advice. I hope someone can come up with an elegant solution 
pretty soon.

The two projects though similar are different and as such there is a 
possibility that one might get more complex than the other at a much faster 
rate depending on the client's need. Just go ahead and have a different 
repository for each and let them be independent of each other.

My reason for this is that you have gone live and shouldn't take chances in 
trying to save time or keystrokes.

If there are other solutions, I would also like to see.

All the best.

Regards.
Sent from my BlackBerry wireless device from MTN

-Original Message-
From: Benedict Verheyen 
Sender: django-users@googlegroups.com
Date: Thu, 09 Jun 2011 09:06:34 
To: 
Reply-To: django-users@googlegroups.com
Subject: 2 projects based on the same codebase

Hi,


I developed a calltracking for our team and now, another team is interested to 
have their own calltracking.
The best way to seem to deal with a project that is the same from the start, is 
to makea new virtualenv
and "git clone" the codebase. The new project might slightly differ in the 
futur.

I have a development machine where I maintain the code, then "git push" the 
code to a server.
On the production machine, i "git pull" the code.
This all works but what if the 2nd team wants slight changes, changes that my 
team may not want?
2 virtualenv's based on the same code might not be the best option in this case.

Do I create a new repository for the code of the other project ?
I feels like the best way to go ahead.
However, this would mean that I need to maintain 2 projects that are and 
probably will remain very similar.
How would i transfer code changes from 1 repository to the other? Patches?

Thanks for any insight, or links to documentation that deal with this kind of 
setup and
sorry in advance for going OT.

Regards,
Benedict

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



NoReverseMatch Error

2011-06-09 Thread bahare hoseini
hi there,
this is my views.py that doesn't have any problem:

from django.shortcuts import get_object_or_404, render_to_response
from django.core.urlresolvers import reverse
.
.
.
return HttpResponseRedirect(reverse('polls.views.results', args=(
p.id,)))

def results(request, poll_id):
p = get_object_or_404(Poll, pk=poll_id)
return render_to_response('(...)/polls/results.html', {'poll': p})

but when i edit my urls.py like this:

#...
urlpatterns = patterns('',
(r'^$',
ListView.as_view(
queryset=Poll.objects.order_by('-pub_date')[:5],
context_object_name='latest_poll_list',
template_name='(...)polls/index.html')),
(r'^(?P\d+)/$',
DetailView.as_view(
model=Poll,
template_name='(...)polls/detail.html')),
url(r'^(?P\d+)/results/$',
DetailView.as_view(
model=Poll,
template_name='(...)polls/results.html'),
name='poll_results'),
(r'^(?P\d+)/vote/$', 'polls.views.vote'),
--
and open my browser with the link (http://localhost:8000/polls/id=1/vote),
I'd face this error: can anybody help please?

Reverse for 'polls.views.results' with arguments '(id=1,)' and keyword
arguments '{}' not found.

can anybody help?

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Updating static files: Still in browser cache

2011-06-09 Thread Alexey Moskvin
Tomas, try this: https://github.com/jaddison/django-cachebuster

On 9 июн, 11:09, Thomas Guettler  wrote:
> Hi,
>
> My static files (JS/CSS) are cached in the browser. But if there is a bug
> in a file, an update won't help people which have already cached the old file.
>
> You would need a new URL for every change in the JS/CSS files.
>
> How do you handle this?
>
>   Thomas
>
> --
> Thomas Guettler,http://www.thomas-guettler.de/
> E-Mail: guettli (*) thomas-guettler + de

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Excel dumps to Office 10

2011-06-09 Thread Thomas Guettler
Hi,

That's bad news. I liked this pattern very much: Send the browser a HTML table
with content type application/vnd.ms-excel. This is much better than CSV.

If you find a solution, please post here.

  Thomas

On 06.06.2011 17:10, Bobby Roberts wrote:
> hey -
> 
> we are dumping results to excel as such:
> 
> 
> response = render_to_response('templatename_excel.html',
> {'trs':trs,})
> filename='myfilename.xls'
> response['Content-Disposition'] = 'attachment; filename='
> + filename
> response['Content-Type'] = 'application/vnd.ms-excel;
> charset=utf-8'
> return response
> 
> 
> where trs is our record set.  This works fine for office 2003 and open
> office but we get an invalid format error when trying to open the item
> in office 2010... we can click OK on the alert box and the file opens
> but it is still annoying.  Do you have to do anything specifically for
> Excel 2010 to get that message to go away?
> 
> 

-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



2 projects based on the same codebase

2011-06-09 Thread Benedict Verheyen
Hi,


I developed a calltracking for our team and now, another team is interested to 
have their own calltracking.
The best way to seem to deal with a project that is the same from the start, is 
to makea new virtualenv
and "git clone" the codebase. The new project might slightly differ in the 
futur.

I have a development machine where I maintain the code, then "git push" the 
code to a server.
On the production machine, i "git pull" the code.
This all works but what if the 2nd team wants slight changes, changes that my 
team may not want?
2 virtualenv's based on the same code might not be the best option in this case.

Do I create a new repository for the code of the other project ?
I feels like the best way to go ahead.
However, this would mean that I need to maintain 2 projects that are and 
probably will remain very similar.
How would i transfer code changes from 1 repository to the other? Patches?

Thanks for any insight, or links to documentation that deal with this kind of 
setup and
sorry in advance for going OT.

Regards,
Benedict

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Updating static files: Still in browser cache

2011-06-09 Thread Thomas Guettler
Hi,

My static files (JS/CSS) are cached in the browser. But if there is a bug
in a file, an update won't help people which have already cached the old file.

You would need a new URL for every change in the JS/CSS files.

How do you handle this?

  Thomas

-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.