Error -- 'str' object has no attribute 'creation_counter'

2009-06-22 Thread Phil

Hi,

I'm getting the error 'str' object has no attribute 'creation_counter'
in Django admin when adding an Inlines option to an admin.ModelAdmin
class... and I don't understand why.

Traceback:
File "C:\python25\lib\site-packages\django\core\handlers\base.py" in
get_response
  86. response = callback(request, *callback_args,
**callback_kwargs)
File "C:\python25\lib\site-packages\django\contrib\admin\sites.py" in
root
  157. return self.model_page(request, *url.split('/',
2))
File "C:\python25\lib\site-packages\django\views\decorators\cache.py"
in _wrapped_view_func
  44. response = view_func(request, *args, **kwargs)
File "C:\python25\lib\site-packages\django\contrib\admin\sites.py" in
model_page
  176. return admin_obj(request, rest_of_url)
File "C:\python25\lib\site-packages\django\contrib\admin\options.py"
in __call__
  199. return self.change_view(request, [unquote(part) for
part in url.split(PRIMARY_KEY_URL_SEPARATOR)])
File "C:\python25\lib\site-packages\django\db\transaction.py" in
_commit_on_success
  238. res = func(*args, **kw)
File "C:\python25\lib\site-packages\django\contrib\admin\options.py"
in change_view
  597. formset = FormSet(instance=obj)
File "C:\python25\lib\site-packages\django\forms\models.py" in
__init__
  468. queryset=qs)
File "C:\python25\lib\site-packages\django\forms\models.py" in
__init__
  352. super(BaseModelFormSet, self).__init__(**defaults)
File "C:\python25\lib\site-packages\django\forms\formsets.py" in
__init__
  67. self._construct_forms()
File "C:\python25\lib\site-packages\django\forms\models.py" in
_construct_forms
  474. super(BaseInlineFormSet, self)._construct_forms()
File "C:\python25\lib\site-packages\django\forms\formsets.py" in
_construct_forms
  76. self.forms.append(self._construct_form(i))
File "C:\python25\lib\site-packages\django\forms\models.py" in
_construct_form
  477. form = super(BaseInlineFormSet, self)._construct_form
(i, **kwargs)
File "C:\python25\lib\site-packages\django\forms\models.py" in
_construct_form
  357. return super(BaseModelFormSet, self)._construct_form(i,
**kwargs)
File "C:\python25\lib\site-packages\django\forms\formsets.py" in
_construct_form
  96. self.add_fields(form, i)
File "C:\python25\lib\site-packages\django\forms\models.py" in
add_fields
  491. if self._pk_field == self.fk:
File "C:\python25\lib\site-packages\django\db\models\options.py" in
__eq__
  28. return field_name in self.names
File "C:\python25\lib\site-packages\django\db\models\fields
\__init__.py" in __cmp__
  102. return cmp(self.creation_counter,
other.creation_counter)

Exception Type: AttributeError at /admin/binatang/plantfamily/1/
Exception Value: 'str' object has no attribute 'creation_counter'

Parent and child models:
class plantFamily(models.Model):
familyID = models.AutoField(primary_key=True)
family = models.CharField(max_length=50,null=True)

class plantGenus(models.Model):
genusID = models.AutoField(primary_key=True)
familyID = models.ForeignKey(plantFamily,
verbose_name='family',null=True,blank=True)
genus = models.CharField(max_length=50,null=True)

...and admin entries:
class plGenIn(admin.TabularInline):
model = plantGenus

class plFamAdmin(admin.ModelAdmin):
inlines = [plGenIn,]

I'm sure I had this working before, but since then I have installed
the composite primary key patch and I notice the 2nd to last traceback
is in class CompositePrimaryKey... Could this be something to do with
it?? All ideas appreciated

Thanks

Phil B

--~--~-~--~~~---~--~~
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: Error -- 'str' object has no attribute 'creation_counter'

2009-06-23 Thread Phil

OK thanks Karen, so the patch is the cause, foreign key filters now
work fine with the 1.0.2 main release. Of course, once again I have
the problem that tables with composite primary keys are not working...

I still don't understand why though. The class CompositePrimaryKey is
not present in the main release. However, as neither my main table or
the foreign key table had composite primary keys, why did the code use
this class?

Phil

On Jun 24, 1:02 am, Karen Tracey  wrote:
> On Tue, Jun 23, 2009 at 2:02 AM, Phil  wrote:
> > I'm sure I had this working before, but since then I have installed
> > the composite primary key patch and I notice the 2nd to last traceback
> > is in class CompositePrimaryKey... Could this be something to do with
> > it?? All ideas appreciated
>
> Certainly if you see code from the patch in the traceback then I'd be
> inclined to suspect the patch as the cause.  Next step would be to try to
> recreate the error without the patch -- if you can't, that would be more
> evidence there is some situation the patch isn't handling properly.
>
> Karen
--~--~-~--~~~---~--~~
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: Error -- 'str' object has no attribute 'creation_counter'

2009-06-23 Thread Phil

> OK thanks Karen, so the patch is the cause, foreign key filters now
> work fine with the 1.0.2 main release. Of course, once again I have
> the problem that tables with composite primary keys are not working...

Whoops, I just described a different problem (foreign key filters)
that was caused by the patch. But reverting to the base release also
fixed the Inlines issue that I raised in the first place. It seems the
composite foreign key patch needs some work

Phil

On Jun 24, 11:07 am, Phil  wrote:
> OK thanks Karen, so the patch is the cause, foreign key filters now
> work fine with the 1.0.2 main release. Of course, once again I have
> the problem that tables with composite primary keys are not working...
>
> I still don't understand why though. The class CompositePrimaryKey is
> not present in the main release. However, as neither my main table or
> the foreign key table had composite primary keys, why did the code use
> this class?
>
> Phil
>
> On Jun 24, 1:02 am, Karen Tracey  wrote:
>
> > On Tue, Jun 23, 2009 at 2:02 AM, Phil  wrote:
> > > I'm sure I had this working before, but since then I have installed
> > > the composite primary key patch and I notice the 2nd to last traceback
> > > is in class CompositePrimaryKey... Could this be something to do with
> > > it?? All ideas appreciated
>
> > Certainly if you see code from the patch in the traceback then I'd be
> > inclined to suspect the patch as the cause.  Next step would be to try to
> > recreate the error without the patch -- if you can't, that would be more
> > evidence there is some situation the patch isn't handling properly.
>
> > Karen
--~--~-~--~~~---~--~~
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: syncdb is not doing anything

2009-07-06 Thread Phil

Hi,

you may want to try sqlreset keyword to get the right sql output for
your db and put it down into the db directly (copy\paste)

something like this:
python manage.py sqlreset yourapp

this will drop old tables and create all new ones. Though all data is
going to be lost.
syncdb doesn't change a thing if you run in after model changes, but
it does for the new models.

Cheers,
Phil

On Jul 6, 3:17 pm, chefsmart  wrote:
> Hi,
>
> I have been working on an app for some time now. I have been using the
> Django svn trunk.
>
> I have a lot of data in the database. Today I modified a couple of
> fields and added a couple of fields (date and char fields) to three of
> my models. No fields have been removed from the original model
> definitions.
>
> When I do "python manage.py sql myapp" the output shows some
> inconsistent sql that is syntactically wrong. I thought this may
> simply be a jumbled string output problem, so I ran syncdb anyway.
> However, syncdb is not doing anything. I mean no messages, no error
> outputs, nothing. It just simply exits with a blank line output. I
> checked my database (mysql) and there were no changes made. So syncdb
> is not doing anything, even though the sqlall output shows it wants to
> do a lot of sql commands.
>
> Moreover, the manage.py sql myapp command shows that syncdb wants to
> drop and reconstruct tables that I have not modified, and that are not
> related to the modified models in any way.
>
> What could be going on?
>
> Regards,
> CM

--~--~-~--~~~---~--~~
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: Problem with Reverse

2009-07-06 Thread Phil

Hi,

agree with that - does it work if you go through the url first?

Cheers,
Phil

On Jul 6, 3:21 am, Karen Tracey  wrote:
> On Sat, Jul 4, 2009 at 11:44 PM, tam...@gmail.com  wrote:
>
> > Hi,
>
> > I am trying to decouple my views.py with respect to my url.py but I
> > have a problem.
>
> > -I do have a principal url.py which contains and include to a second
> > url.py:
> > urlpatterns = patterns('',
> > (r'^users/', include('myapp.users.urls'))
> > .
>
> > -Thus the second url.py contains:
> > url(regex='^edit/(?P\w+)/$', prefix='myapp.users',
> > view='views.edit_user_profile', name='users_edit'),
>
> > -In my views.py (in signup function) I try to call:
> > url = reverse('users_edit', kwargs={'username':user.username})
> > return HttpResponseRedirect(url)
>
> > -But instead of being correctly redirected I have got the following
> > error:
> > ViewDoesNotExist at /users/signup/
> > Tried select in module myapp.users.views. Error was: 'module' object
> > has no attribute 'select'
>
> > Any hint? :-(
>
> Are you sure you are even getting to your signup view?  From the error
> message it does not sound like it -- you are getting ViewDoesNotExist for
> /users/signup.  What is the urlpattern for your signup view?  It appears to
> be referencing a view named 'select', which isn't being found.
>
> Karen

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Model save() weird behaviour

2009-07-16 Thread Phil

Hi All,

noticed an interesting behaviour in model save:

class Page(models.Model):
title = models.CharField(_(u"Title"), max_length=50)
fulltitle = models.CharField(_(u"Full Title"), max_length=50)
...

def save():
   # title is received from a form, say i've entered 'QWERTY'
title1 =  str(self.title)
self.fulltitle = title1
#fulltitle = title = 'QWERTY'
self.title = 'sampletext'
super(Article, self).save()

after all i got:
fulltitle = title = 'sampletext'
i was expecting to have:
fulltitle =  'QWERTY'
title = 'sampletext'

so - does it mean that i pass reference to an existing object, not a
value? Do i miss some fundamental thing about Django? :)

Cheers
Phil

--~--~-~--~~~---~--~~
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 as username, issue with admin page

2009-07-16 Thread Phil

Hi,

as a simple idea you may overcome that by prompting user to enter
email and then generate username for a User model, if you mean it,
yourself. Of course you can leave option to enter username, but leave
email as required or allow to enter any of those in the same field.
Kind of 'slugify' will help.

apologise if that isn't what you're looking for.

Cheers

On Jul 16, 7:16 pm, selcukcihan  wrote:
> Hi, i am using email as username. Both username and email fields in
> User model always have the same value which is an email.
>
> From previous posts and code snippets, i got logins authentication and
> other stuff working. However, i just can't seem to get the admin page
> to create/modify user's whose username is an email. UserChangeForm &
> UserCreationForm tell me "This value must contain only letters,
> numbers and underscores.".
>
> To overcome this issue, i wrote the following code
>
> class OurUserChangeForm(UserChangeForm):
>     username = forms.EmailField
>
> class OurUserCreationForm(UserCreationForm):
>     username = forms.EmailField
>
> class OurUserAdmin(UserAdmin):
>     form = OurUserChangeForm
>     add_form = OurUserCreationForm
>
> and i register with
> admin.site.unregister(User)
> admin.site.register(User, OurUserAdmin)
>
> but it is not working. Any help/pointers 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: usernames for auth.User are too restrictive for my company's clients

2009-07-16 Thread Phil

Hi Andrew,

like just posted that in here:
http://groups.google.com/group/django-users/browse_thread/thread/81d856b37b979d0c?hl=en

you may allow user to enter name, surname, email using standard Django
User class (has email, and lastname, firstname fields) but hide
username field and then generate username yourself using, say, email
or both email or username, etc.

Cheers,
Phil

On Jul 16, 5:50 am, "Andrew D. Ball"  wrote:
> Good afternoon.
>
> Here's the username field from the latest Django trunk's 
> django.contrib.auth.models module:
>
> username = models.CharField(_('username'), max_length=30, unique=True, 
> help_text=_("Required. 30 characters or fewer.     Alphanumeric characters 
> only (letters, digits and underscores)."))
>
> Why is the format of the username so restrictive?  The company I work for
> has clients with usernames that contain spaces, email addresses, possibly even
> non-ASCII characters.  I would love to use the standard User model, but I 
> can't
> dictacte the format of the usernames of our clients' own systems.
>
> Is there any way to work around this?  We have already implemented our own
> user model, but I would like to use the standard Django one to make 
> integration
> with apps like Satchmo more feasible.
>
> Peace,
> Andrew
> --
> ===
> Andrew D. Ball
> ab...@americanri.com
> Software Engineer
> American Research Institute, Inc.http://www.americanri.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: Model save() weird behaviour

2009-07-16 Thread Phil

oh, sorry for that - exampling mistake, should be:

class Page(models.Model):
title = models.CharField(_(u"Title"), max_length=50)
fulltitle = models.CharField(_(u"Full Title"), max_length=50)
...

def save():
   # title is received from a form, say i've entered 'QWERTY'
title1 =  str(self.title)
self.fulltitle = title1
#fulltitle = title = 'QWERTY'
self.title = 'sampletext'
super(Page, self).save()


Thanks for that correction,
Cheers,
Phil

On Jul 16, 9:50 pm, Karen Tracey  wrote:
> On Thu, Jul 16, 2009 at 7:09 AM, Phil  wrote:
>
> > Hi All,
>
> > noticed an interesting behaviour in model save:
>
> > class Page(models.Model):
> >    title = models.CharField(_(u"Title"), max_length=50)
> >    fulltitle = models.CharField(_(u"Full Title"), max_length=50)
> > ...
>
> >    def save():
> >       # title is received from a form, say i've entered 'QWERTY'
> >        title1 =  str(self.title)
> >        self.fulltitle = title1
> >        #fulltitle = title = 'QWERTY'
> >        self.title = 'sampletext'
> >        super(Article, self).save()
>
> That can't really be the save() for Page because it's calling super(Article,
> self)...?
>
> Karen
--~--~-~--~~~---~--~~
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: Current user in model.save() context

2009-07-16 Thread Phil

Hi Josh,

unfortunately it seems that there is no way to do so. As you've
noticed that correctly you can use request (request.user) in any place
but model save.

most likely that will be view:

---
if form.is_valid():
newObj = form.save(commit=False)
newObj.user = request.user
newObj.save()
---

Cheers,
Phil

On Jul 17, 7:19 am, Joshua Russo  wrote:
> I think I might be overlooking something simple here. I have a set of
> 4 fields in almost every table (user create & modified and date create
> & modified). The date (datetime) is easy with auto_now and
> auto_now_add options.
>
> The user has been much trickier. I can't figure out how (if possible)
> to get access to the current user information in the context of a
> model. The work around that I've implemented is a method that takes
> the model, user id, and a boolean indicating modification or new. I
> then use this in location where I still have a request object (and
> thus request.user.id) like my views or save_model() of the admin form.
>
> Is this as good as I can do, or can I access the current user (or
> request object) from within the model?
>
> Thanks
> Josh
--~--~-~--~~~---~--~~
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: Model save() weird behaviour

2009-07-20 Thread Phil

anyone?
any ideas? :)

On Jul 17, 11:00 am, Phil  wrote:
> oh, sorry for that - exampling mistake, should be:
>
> class Page(models.Model):
>     title = models.CharField(_(u"Title"), max_length=50)
>     fulltitle = models.CharField(_(u"Full Title"), max_length=50)
> ...
>
>     defsave():
>        # title is received from a form, say i've entered 'QWERTY'
>         title1 =  str(self.title)
>         self.fulltitle = title1
>         #fulltitle = title = 'QWERTY'
>         self.title = 'sampletext'
>         super(Page, self).save()
>
> Thanks for that correction,
> Cheers,
> Phil
>
> On Jul 16, 9:50 pm, Karen Tracey  wrote:
>
>
>
> > On Thu, Jul 16, 2009 at 7:09 AM, Phil  wrote:
>
> > > Hi All,
>
> > > noticed an interesting behaviour in modelsave:
>
> > > class Page(models.Model):
> > >    title = models.CharField(_(u"Title"), max_length=50)
> > >    fulltitle = models.CharField(_(u"Full Title"), max_length=50)
> > > ...
>
> > >    defsave():
> > >       # title is received from a form, say i've entered 'QWERTY'
> > >        title1 =  str(self.title)
> > >        self.fulltitle = title1
> > >        #fulltitle = title = 'QWERTY'
> > >        self.title = 'sampletext'
> > >        super(Article, self).save()
>
> > That can't really be thesave() for Page because it's calling super(Article,
> > self)...?
>
> > Karen
--~--~-~--~~~---~--~~
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: Model save() weird behaviour

2009-07-22 Thread Phil

Thanks Brian,

'QWERTY' goes from the form entry here...but that's not important as
issue is located somewhere else, precisely save is called twice...
apologise for that

Cheers,
Philip

On Jul 21, 2:52 pm, Brian May  wrote:
> On Thu, Jul 16, 2009 at 04:09:36AM -0700, Phil wrote:
> >     defsave():
> >        # title is received from a form, say i've entered 'QWERTY'
> >         title1 =  str(self.title)
> >         self.fulltitle = title1
> >         #fulltitle = title = 'QWERTY'
> >         self.title = 'sampletext'
> >         super(Article, self).save()
>
> > after all i got:
> >         fulltitle = title = 'sampletext'
> > i was expecting to have:
> >         fulltitle =  'QWERTY'
> >         title = 'sampletext'
>
> Why should it do that?
>
> The only line containing QWERTY is commented out, and even if it wasn't
> commented out it does nothing. Maybe you meant to say:
>
> self.fulltitle = self.title = 'QWERTY'
>
> As such, what you have is:
>
> self.fulltitle = self.title
> self.title = 'sampletext'
> self.save()
>
> So the new value of self.fulltitle depends on what self.title previously was.
> --
> Brian May 
--~--~-~--~~~---~--~~
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 the url template tags

2009-08-28 Thread Phil

Guys,

I have this error in my template when rendering my view: "Caught an
exception while rendering: Reverse for 'entry_archive_month' with
arguments '()' and keyword arguments '{'month': 8, 'year': 2009}' not
found."

I've starred at my code for too long and I can't see where the problem
lies. I'm sure it's a stupid and silly error, but I've look too much
at my code and can't seem to figure out what is happening.

Basically, the tag {% url blog:entry_archive_month
year=date.year,month=date.month %} is throwing the 'reverse for
'entry_archive_month not found'.
I've tried with args instead of kwargs (i.e.: {% url
blog:entry_archive_monthdate.year,date.month %} but without success

In another template, I have {% url blog:entry_archive_year
year=year.year %} and it works perfectly fine (and even the 'args'
version, which seems to indicate that this is some serious flaw in my
understanding of url namespace and reversing in django).

I'm just baffled and to tired to see clearly what is my stupipd
mistake.

Here is the traceback: http://dpaste.com/86470/

Here is some part of my code (the two urls.py): http://dpaste.com/hold/86487/

Can anyone help me with this one ?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



MySQL with pyodbc error

2009-05-15 Thread Phil

Hi,

I'm trying Django with MySQL and the pyodbc connector. However, it
appears that Django can only cope with the mysqldb connector. I get a
load of traceback ending with the error:

File "C:\python26\lib\site-packages\django\db\backends\mysql\base.py",
line 13, in 
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
module: No module named MySQLdb

Is there replacement code for pyodbc to get this working?

Cheers
Phil

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Complex Query Optimization

2009-09-12 Thread Phil

I am trying to minimize the database hits. Take this example...

from django.contrib.auth.models import User

class Group(models.Model):
# a bunch of fields here
user = models.ForeignKey(User, related_name="groups")

class Member(models.Model):
# a bunch of fields here
user = models.ForeignKey(User, related_name="members")
groups= models.ForeignKey(Invitation, related_name="members")

Basically the idea of the above is that given a user, you can fetch a
list of members. Or, given a group, you can fetch a list of members
belonging to that group.

In one of my templates, I would like to paginate based on the groups,
lets say 10 groups per page. But for each group displayed, I want to
also display each member. The groups will be small enough so this
won't be ridiculous. I feel confident than this can be done _without_
having to perform 11 queries per page (one for the groups, and then 1
for getting the members of each group). Am I correct? If so, how?

Mildly off topic, I am trying to figure out what exactly happens when
using MyModel.objects.all(). I understand that it is just an iterable
but, using the example of pagination, when you do Paginator
(MyModel.objects.all(), 10), is there no database hit until you get a
specific page, where it will only fetch the 10 for the page it needs?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



trouble creating first project

2010-10-10 Thread Phil
Hi,

I am having trouble creating my first project. I am running the latest
version of Ubuntu and I installed Django from svn, when I run 'import
django' i get no errors back so I assume its installed OK.

When I run 'django-admin.py startproject myproject' I get back an
error saying 'django-admin.py: command not found'.

How can I solve/get around this error? Appreciate any help/ advice
offered

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: trouble creating first project

2010-10-12 Thread Phil
Thanks for reply Steve.

Yes I seen the section about symbolic linking on the django website.
It says on the website to type this command

"ln -s WORKING-DIR/django-trunk/django/bin/django-admin.py /usr/local/
bin"

which I did(replacing WORKING_DIR obviously with the right path), but
I'm not sure what "/usr/local/bin" is supposed to point to or what
path should this be exactly?


On Oct 11, 6:20 pm, Steve Holden  wrote:
> On 10/11/2010 1:47 AM, Phil wrote:> Hi,
>
> > I am having trouble creating my first project. I am running the latest
> > version of Ubuntu and I installed Django from svn, when I run 'import
> > django' i get no errors back so I assume its installed OK.
>
> > When I run 'django-admin.py startproject myproject' I get back an
> > error saying 'django-admin.py: command not found'.
>
> > How can I solve/get around this error? Appreciate any help/ advice
> > offered
>
> When you install Django from svn it doesn't add django-admin to any of
> the directories that your system looks for programs in (i.e. those
> directories on your path).
>
> When you install Django with setuptools (i.e. using setup.py) then you
> should find that django-admin is placed where it can be found.
>
> The simplest way around this is to make a symbolic link from one of the
> directories on your path to the django-admin.py file.
>
> regards
>  Steve
> --
> DjangoCon US 2010 September 7-9http://djangocon.us/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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 i18n and google bots

2007-05-02 Thread Phil

Guys,

I use the i18n framework of django to offer my site content in two
language: French and English. As the language preference is kept in a
cookie, all the URLs of my site are therefore language agnostic. All
is working fine.

But, when the googlebots hits my site, they only hit the French-
translated content!
I checked the cached version of the site in google and all the pages
are in French.

Has somebody already given some thoughts on this and found a solution,
or do I will have to change my URLs as to have to sets, one in English
and one in French (http://www.mysite.com/path/to/url/fr/ and
http://www.mysite.com/path/to/url/en/) or something equivalent ?

Phil.


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



Re: django i18n and google bots

2007-05-02 Thread Phil

I have indeed access to my logs, I'll check that and let you know.
Many thanks Malcolm.

On May 2, 10:32 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Wed, 2007-05-02 at 08:16 +, Phil wrote:
> > Guys,
>
> > I use the i18n framework of django to offer my site content in two
> > language: French and English. As the language preference is kept in a
> > cookie, all the URLs of my site are therefore language agnostic. All
> > is working fine.
>
> > But, when the googlebots hits my site, they only hit the French-
> > translated content!
> > I checked the cached version of the site in google and all the pages
> > are in French.
>
> > Has somebody already given some thoughts on this and found a solution,
> > or do I will have to change my URLs as to have to sets, one in English
> > and one in French (http://www.mysite.com/path/to/url/fr/and
> >http://www.mysite.com/path/to/url/en/) or something equivalent ?
>
> Do you have access to your web server's logs? If so, you might want to
> pull out all the Google bot hits and see if there's a pattern in the way
> they are pulling the URLs to see why they might be getting the French
> content.
>
> I don't know for sure what your problem might be, but there is one
> suspect: If Google's crawler is cookie-aware there is one bug in
> Django's i18n stuff that may be hitting you. Unfortunately, the "set
> language" link changes your i18n setting when it is requested via a GET
> request. This is bad: it has side-effects, so only a POST should trigger
> the change. The result of this bug is that anything crawling every link
> in the site will have their language changed just by issuing a GET on
> the "set language" link. In the very near future, I'm going to fix this
> bug -- it's ticket #3651, if you're interested. I'm going to have a "day
> of backwards-incompatible changes" later this week and this will be one
> of them.
>
> Regards,
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django i18n and google bots

2007-05-02 Thread Phil

I've already submitted a sitemap to google. But as Eugene said, and
after doing some research today, I'm afraid that the bots are
impervious to cookies.
This means that I will have to construct URL with a language
designator )c:

On May 2, 8:12 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I don't know if it would help, but if you sign up for the google
> webmaster tools you can set a preferred site root. Also, submitting a
> sitemap might help.
>
> On May 2, 7:37 am, Eugene Morozov <[EMAIL PROTECTED]> wrote:
>
> > I think there's no other solution as to use language designator in
> > URLs and placing language links on the main page. There's no way
> > Google or any other bot can crawl the site several times with
> > different cookies or something. Currently I'm redoing site in Django
> > that suffers the same problem and it was a design decision to use
> > googlebot-friendly urls.
> > Eugene
>
> > On 2 май, 12:16, Phil <[EMAIL PROTECTED]> wrote:
>
> > > Guys,
>
> > > I use the i18n framework of django to offer my site content in two
> > > language: French and English. As the language preference is kept in a
> > > cookie, all the URLs of my site are therefore language agnostic. All
> > > is working fine.
>
> > > But, when the googlebots hits my site, they only hit the French-
> > > translated content!
> > > I checked the cached version of the site in google and all the pages
> > > are in French.
>
> > > Has somebody already given some thoughts on this and found a solution,
> > > or do I will have to change my URLs as to have to sets, one in English
> > > and one in French 
> > > (http://www.mysite.com/path/to/url/fr/andhttp://www.mysite.com/path/to...)
> > >  or something equivalent ?
>
> > > Phil.


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



Re: FastCGI shared hosting

2007-11-26 Thread Phil

In case your hoster is dreamhost, please consider changing your
"app.fci" to "dispatcher.fcgi". Dreamhost is known to do special stuff
when the fcgi is named that way.

On Nov 22, 6:31 pm, Dwarf <[EMAIL PROTECTED]> wrote:
> Hello,
> the problem is getting to be annoyed.
> I have shared django hosting with Apache, fcgid module and flup.
> The problem is that my  app.fcgi sript does not respawn when I make
> changes in it or say:
> " touch app.fci"
> It runs with rights of "apache" user and I have no clue how to restart
> it.
>
> Administrator tells me to change my "app.fcgi"  in the way that it
> itself takes care about it.
> But I believe that Apache should take care about it.
>
> Can anyone hints me where to dig?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: template and special character problem

2006-09-19 Thread Phil

I finally nailed it !

For some strange reason my editor did not save the index.html template
in utf8.
I've reloaded both template in another editor, force to save in utf-8
and all went well.

Thanks to all for the support.

Jorge Gajon wrote:
> On 9/18/06, Phil <[EMAIL PROTECTED]> wrote:
> > I tried what you suggested (replace my meta http-equiv by your version)
> > and it does no good )c:
>
> Sorry to hear that Phil, I don't know what else to suggest :(  It is
> really weird that it works when you duplicate the content-type line
> though.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Fast fcgi on dreamhost --> shauwn of the dead, help me shoot zombies

2006-12-04 Thread Phil

I stumbled across your post via jeffcrot.com and this came just right
at the perfect timing.

I just launched my first django app this week end (a site about online
gaming, http://www.netday.be, but beware it's in french) and I run into
some much 500 error trouble that I wasn't really confident.

But now, it runs smoothly since.

A great thanks.

Phil.

On Dec 3, 4:37 pm, "Maciej Bliziński" <[EMAIL PROTECTED]>
wrote:
> coulix napisał(a):
>
> > Any idea on how to fix these problems on dreamhost?I'm not sure if what 
> > you're currently experiencing is the same problem
> I had few days ago. I did notice zombie processes and my Django app on
> Dreamhost was down every now and then. I've solved this problem by
> renaming django.fcgi file to dispatch.fcgi and changing corresponding
> lines in the .htaccess file. More details on my 
> blog:http://automatthias.wordpress.com/2006/12/01/django-on-dreamhost-inco...
> 
> Cheers,
> Maciej


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



Re: Fast fcgi on dreamhost --> shauwn of the dead, help me shoot zombies

2006-12-07 Thread Phil

Yes, me too
It failed twice since Monday morning.
)c:

But 'happily', it is not a mission critical site, so I can afford to
have some downtime from time to time.

Which you luck.

Phil.

On Dec 6, 11:43 pm, "coulix" <[EMAIL PROTECTED]> wrote:
> I did the rename trick, still screw today.
> I will change my hosting pay a little bite more for a virtual server
> and set up apache + mod_python.
> i should have done this since the begining.
>
> On Dec 5, 2:38 am, "Phil" <[EMAIL PROTECTED]> wrote:
>
> > I stumbled across your post via jeffcrot.com and this came just right
> > at the perfect timing.
>
> > I just launched my first django app this week end (a site about online
> > gaming,http://www.netday.be, but beware it's in french) and I run into
> > some much 500 error trouble that I wasn't really confident.
>
> > But now, it runs smoothly since.
>
> > A great thanks.
>
> > Phil.
>
> > On Dec 3, 4:37 pm, "Maciej Bliziński" <[EMAIL PROTECTED]>
> > wrote:
>
> > >coulixnapisał(a):
>
> > > > Any idea on how to fix these problems on dreamhost?I'm not sure if what 
> > > > you're currently experiencing is the same problem
> > > I had few days ago. I did notice zombie processes and my Django app on
> > > Dreamhost was down every now and then. I've solved this problem by
> > > renaming django.fcgi file to dispatch.fcgi and changing corresponding
> > > lines in the .htaccess file. More details on my 
> > > blog:http://automatthias.wordpress.com/2006/12/01/django-on-dreamhost-inco...
> 
> > > Cheers,
> > > Maciej


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



template and special character problem

2006-09-12 Thread Phil

Hi all,

Warning: I'm a new user in town, new to django (albeit already totaly
converted this great framework), so be totally warned about my
potentially uber-noob question.

I have some troubles in the way special character (accentuated
character �, �, � and the like) are presented in the browser.

Here is my setup:

My settings.py file contains LANGUAGES = 'fr' as my site will be
presented in french.

I have a base.html template where I specify DOCTYPE, xml namespace,
etc.

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
http://www.w3.org/1999/xhtml"; lang="{{ LANGUAGE_CODE }}"
xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif
%}>

In the  part, I also have



I have all my {% block %} nicely setup.

In my base.html template, I have some accentuated character.

I also have an index.html template that extends base.html. In this
template, I also have accentuated character.

When I render index.html, the special character from base.html are
rendered normaly but the ones from index.html are shown as '?'.

Anyone has an idea where I need to look ?

Phil.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: template and special character problem

2006-09-16 Thread Phil

Hi Jorge,

thanks for the tip. I'll check that.
In the meantime, I've solved this with a bit of a uncool hack.

In the base.html template I added in the  section a {% block
extrahead %}{% endblock %}.
And in the index.html template I added {% block extrahead %}  {% endblock %}

This seems to solved my problem but leave my html output with several
'content-type' meta which is not that good and not that bad.

I plan to debug this to see why Django doesn't seem to know what is the
encoding of the index.html template.

Jorge Gajon wrote:
> Hi,
>
> On 9/12/06, Phil <[EMAIL PROTECTED]> wrote:
> > When I render index.html, the special character from base.html are
> > rendered normaly but the ones from index.html are shown as '?'.
>
> Make sure that the editor you are using is writing your files to disk
> with the correct encoding.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: template and special character problem

2006-09-16 Thread Phil

Now that I think of it, I use the same editor for all of my templates,
so I doubt that this is the root cause.

Jorge Gajon wrote:
> Hi,
>
> On 9/12/06, Phil <[EMAIL PROTECTED]> wrote:
> > When I render index.html, the special character from base.html are
> > rendered normaly but the ones from index.html are shown as '?'.
>
> Make sure that the editor you are using is writing your files to disk
> with the correct encoding.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: template and special character problem

2006-09-18 Thread Phil

Hi Jorge,

I tried what you suggested (replace my meta http-equiv by your version)
and it does no good )c:

I also checked my settings.py and there is no DEFAULT_CHARSET nor
DEFAULT_CONTENT_TYPE, so they are defaulted to uft-8 and text/html.

Thanks for the suggestion, though.

Jorge Gajon wrote:
> On 9/16/06, Phil <[EMAIL PROTECTED]> wrote:
> > In the base.html template I added in the  section a {% block
> > extrahead %}{% endblock %}.
> > And in the index.html template I added {% block extrahead %}  > http-equiv="content-type" content="application/xhtml+xml;
> > charset=UTF-8" /> {% endblock %}
>
> It is really strange that you need to duplicate your content-type to
> make it work. I believe your problem lies in how the browser is
> interpreting your html file and not in Django.
>
> Also, what happens if you instead specify your content-type in your
> base.html file like this?
>
> 
>
> There are two differences, Content-Type (first letters are uppercase)
> and the mime type is "text/html" instead of "application/xhtml+xml"
>
> By default, Django serves the Content-Type header (in the HTTP
> response headers) like that. See DEFAULT_CHARSET and
> DEFAULT_CONTENT_TYPE:
>
> http://www.djangoproject.com/documentation/settings/#default-charset
>
>
> > I plan to debug this to see why Django doesn't seem to know what is the
> > encoding of the index.html template.
>
> If your text editor is correctly writing your files in UTF-8 and you
> didn't changed the DEFAULT_CHARSET setting in your settings file, then
> there shouldn't be any problem with how Django reads your templates.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



multiple valuesfor keyword arguement 'prefix'

2012-02-16 Thread Phil
Hi,

I have a basic django blog built and am now trying to use generic views in 
it but am getting the following error, I'm not sure where I am going wrong:


Environment:


Request Method: GET
Request URL: http://127.0.0.1:8080/blog/

Django Version: 1.3.1
Python Version: 2.7.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.formtools',
 'django.contrib.admindocs',
 'tagging',
 'blog']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" 
in get_response
  101. request.path_info)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" 
in resolve
  252. sub_match = pattern.resolve(new_path)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" 
in resolve
  250. for pattern in self.url_patterns:
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" 
in _get_url_patterns
  279. patterns = getattr(self.urlconf_module, "urlpatterns", 
self.urlconf_module)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" 
in _get_urlconf_module
  274. self._urlconf_module = import_module(self.urlconf_name)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py" in 
import_module
  35. __import__(name)
File "/home/phil/mydev/projects/job/blog/urls.py" in 
  15. 
(r'^(?P\d{4})/(?P\w{3})/(?P\d{2})/(?P[-\w]+)/$', 
'object_detail', entry_info_dict, 'blog_entry_detail', {'template_name': 
'blog/detail.html'}),
File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/defaults.py" 
in patterns
  24. t = url(prefix=prefix, *t)

Exception Type: TypeError at /blog/
Exception Value: url() got multiple values for keyword argument 'prefix'


**

my 'urls.py':


from django.conf.urls.defaults import *
from blog.models import Entry

entry_info_dict = {
'queryset': Entry.objects.all(),
'date_field': 'pub_date',
}

urlpatterns = patterns('django.views.generic.date_based',
(r'^$', 'archive_index', entry_info_dict, 'blog_entry_archive_index', 
{'template_name': 'blog/index.html'}),
(r'^(?P\d{4})/$', 'archive_year', entry_info_dict, 
'blog_entry_archive_year'),
(r'^(?P\d{4})/(?P\w{3})/$', 'archive_month', 
entry_info_dict, 'blog_entry_archive_month'),
(r'^(?P\d{4})/(?P\w{3})/(?P\d{2})/$', 'archive_day', 
entry_info_dict, 'blog_entry_archive_day'),

(r'^(?P\d{4})/(?P\w{3})/(?P\d{2})/(?P[-\w]+)/$', 
'object_detail', entry_info_dict, 'blog_entry_detail', {'template_name': 
'blog/detail.html'}),
)



*

end of 'Entry' in models.py:

"""
def get_absolute_url(self):
return ('blog_entry_detail', (), {'year': 
self.pub_date.strftime("%Y"),
'month': 
self.pub_date.strftime("%b").lower(),
'day': self.pub_date.strftime("%d"),
'slug': self.slug})
get_absolute_url = models.permalink(get_absolute_url)

-- 
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/-/TbcBxu_Es-IJ.
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.py makemessages issue

2012-07-12 Thread Phil
Hi,

(django version 1.3.1, Python2.7)

(at the end of my settings file)

# translation support
ugettext = lambda s: s

LANGUAGES = (
('en', ugettext('English')),
('es', ugettext('Spanish')),
('de', ugettext('German')),
)

LOCALE_PATHS = (
'/home/phil/project/locale',
)


I am implementing languages into my django website. It's working fine but 
when I run "django-admin.py makemessages" on the command line it gives the 
following error

"Error: This script should be run from the Django SVN tree or your project 
or app tree. If you did indeed run it from the SVN checkout or your project 
or application, maybe you are just missing the conf/locale (in the django 
tree) or locale (for project and application) directory? It is not created 
automatically, you have to create it by hand if you want to enable i18n for 
your project or application."

So like it says, I create the "locale" folder manually then(it's in the 
root of my project directory) run makemessages again but I just get another 
error saying...

"Error: Type 'django-admin.py help makemessages' for usage information."

Any idea's where I could be going wrong?

-- 
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/-/IukJjVtKua4J.
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-admin.py makemessages issue

2012-07-12 Thread Phil
ugh, that would explain it! Thanks a lot Tomas.

On Thursday, July 12, 2012 7:02:11 PM UTC+1, Tomas Neme wrote:
>
> "django-admin.py makemessages -l de" 
> "django-admin.py makemessages -l es" 
>
>
> > Hi, 
> > 
> > (django version 1.3.1, Python2.7) 
> > 
> > (at the end of my settings file) 
> >  
> > # translation support 
> > ugettext = lambda s: s 
> > 
> > LANGUAGES = ( 
> > ('en', ugettext('English')), 
> > ('es', ugettext('Spanish')), 
> > ('de', ugettext('German')), 
> > ) 
> > 
> > LOCALE_PATHS = ( 
> > '/home/phil/project/locale', 
> > ) 
> >  
> > 
> > I am implementing languages into my django website. It's working fine 
> but 
> > when I run "django-admin.py makemessages" on the command line it gives 
> the 
> > following error 
> > 
> > "Error: This script should be run from the Django SVN tree or your 
> project 
> > or app tree. If you did indeed run it from the SVN checkout or your 
> project 
> > or application, maybe you are just missing the conf/locale (in the 
> django 
> > tree) or locale (for project and application) directory? It is not 
> created 
> > automatically, you have to create it by hand if you want to enable i18n 
> for 
> > your project or application." 
> > 
> > So like it says, I create the "locale" folder manually then(it's in the 
> root 
> > of my project directory) run makemessages again but I just get another 
> error 
> > saying... 
> > 
> > "Error: Type 'django-admin.py help makemessages' for usage information." 
> > 
> > Any idea's where I could be going wrong? 
> > 
> > -- 
> > 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/-/IukJjVtKua4J. 
> > 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. 
>
>
>
> -- 
> "The whole of Japan is pure invention. There is no such country, there 
> are no such people" --Oscar Wilde 
>
> |_|0|_| 
> |_|_|0| 
> |0|0|0| 
>
> (\__/) 
> (='.'=)This is Bunny. Copy and paste bunny 
> (")_(") to help him gain world domination. 
>

-- 
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/-/VTaFRRrgGVAJ.
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-admin.py makemessages issue

2012-07-12 Thread Phil
Now I'm getting the following error...

Error: errors happened while running xgettext on __init__.py
/bin/sh: 1: xgettext: not found


It creates the right folders, but no .mo files.


On Thursday, July 12, 2012 7:13:14 PM UTC+1, Phil wrote:
>
> ugh, that would explain it! Thanks a lot Tomas.
>
> On Thursday, July 12, 2012 7:02:11 PM UTC+1, Tomas Neme wrote:
>>
>> "django-admin.py makemessages -l de" 
>> "django-admin.py makemessages -l es" 
>>
>>
>> > Hi, 
>> > 
>> > (django version 1.3.1, Python2.7) 
>> > 
>> > (at the end of my settings file) 
>> >  
>> > # translation support 
>> > ugettext = lambda s: s 
>> > 
>> > LANGUAGES = ( 
>> >     ('en', ugettext('English')), 
>> > ('es', ugettext('Spanish')), 
>> > ('de', ugettext('German')), 
>> > ) 
>> > 
>> > LOCALE_PATHS = ( 
>> > '/home/phil/project/locale', 
>> > ) 
>> >  
>> > 
>> > I am implementing languages into my django website. It's working fine 
>> but 
>> > when I run "django-admin.py makemessages" on the command line it gives 
>> the 
>> > following error 
>> > 
>> > "Error: This script should be run from the Django SVN tree or your 
>> project 
>> > or app tree. If you did indeed run it from the SVN checkout or your 
>> project 
>> > or application, maybe you are just missing the conf/locale (in the 
>> django 
>> > tree) or locale (for project and application) directory? It is not 
>> created 
>> > automatically, you have to create it by hand if you want to enable i18n 
>> for 
>> > your project or application." 
>> > 
>> > So like it says, I create the "locale" folder manually then(it's in the 
>> root 
>> > of my project directory) run makemessages again but I just get another 
>> error 
>> > saying... 
>> > 
>> > "Error: Type 'django-admin.py help makemessages' for usage 
>> information." 
>> > 
>> > Any idea's where I could be going wrong? 
>> > 
>> > -- 
>> > 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/-/IukJjVtKua4J. 
>> > 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. 
>>
>>
>>
>> -- 
>> "The whole of Japan is pure invention. There is no such country, there 
>> are no such people" --Oscar Wilde 
>>
>> |_|0|_| 
>> |_|_|0| 
>> |0|0|0| 
>>
>> (\__/) 
>> (='.'=)This is Bunny. Copy and paste bunny 
>> (")_(") to help him gain world domination. 
>>
>

-- 
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/-/FylY8YehSxgJ.
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.



model translationissue

2012-07-12 Thread Phil
Hi,

I'm trying to translate form names from a model. I have a working contact 
form for example and have the following code



from django import forms
from django.core.mail import mail_managers
from django.utils.translation import ugettext_lazy as _

class ContactForm(forms.Form):
name = forms.CharField(_('name'), max_length=100)


==

It adds it to my .po file ok, but when I run it in the browser I get the 
following error...


Environment:


Request Method: GET
Request URL: http://127.0.0.1:8080/contact/

Django Version: 1.3.1
Python Version: 2.7.3
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.formtools',
 'django.contrib.admindocs',
 'tagging',
 'blog']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django_mobile.middleware.MobileDetectionMiddleware',
 'django_mobile.middleware.SetFlavourMiddleware')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" 
in get_response
  101. request.path_info)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" 
in resolve
  250. for pattern in self.url_patterns:
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" 
in _get_url_patterns
  279. patterns = getattr(self.urlconf_module, "urlpatterns", 
self.urlconf_module)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" 
in _get_urlconf_module
  274.     self._urlconf_module = import_module(self.urlconf_name)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py" in 
import_module
  35. __import__(name)
File "/home/phil/project/urls.py" in 
  2. from views import *
File "/home/phil/project/views.py" in 
  7. from forms import ContactForm
File "/home/phil/project/forms.py" in 
  5. class ContactForm(forms.Form):
File "/home/phil/project/forms.py" in ContactForm
  6. name = forms.CharField(_('name'), max_length=100)

Exception Type: TypeError at /contact/
Exception Value: __init__() got multiple values for keyword argument 
'max_length'


-- 
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/-/m5L_nLBNK6cJ.
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.



html compress advice

2012-07-26 Thread Phil
Hi,

Just looking for some advice/ wisdom really.

I have compressed my css/js files and am now looking to strip all the white 
space from the html in the templates to help speed things up as much as 
possible. Is putting my hole base.html file between django's "spaceless" 
template tag an ok way of going about this or would that slow things/ make 
much difference down in the long run?

-- 
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/-/15DFNIBBk80J.
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: html compress advice

2012-07-26 Thread Phil
ah, thank you. I'll take a look now.

On Thursday, July 26, 2012 10:34:49 PM UTC+1, mhulse wrote:
>
> Hi, 
>
> > Just looking for some advice/ wisdom really. 
>
> While not a direct answer to your question, there was a discussion on 
> the group recently on the topic of the spaceless tag: 
>
> "{% spaceless %} abuse (?)" 
>  
>
> You might find some wisdom there. :) 
>

-- 
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/-/lmKrWiGYzTMJ.
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.



setting up Django Compressor

2012-08-31 Thread Phil
Hi,

Django1.4, Python2.7

I am currently trying to get django compressor to work locally, I installed 
django_compressor via pip install earlier, added it to my installed apps. 
Here is a copy of my base template


{% load i18n %}
{% load compress %}





  



{% compress css %}

{% endcompress %}
.



When I view the source it outputs the following

**

  http://127.0.0.1:8080/media/CACHE/css/fbe3d01c9f33.css>" 
type="text/css" media="all" />


**


So it is creating the cached css file, but it doesn't seem to be able to 
find it(ie page loads with no style applied to it), any ideas what it could 
be that I am missing?


-- 
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/-/qpwRn4wDPycJ.
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: How sitemaps used in the Django

2012-08-31 Thread Phil
Hi Mugdha,

First add 'django.contrib.sitemaps' to your installed apps.

Then create a file "sitemap.py" in your project root with something like


from django.core.urlresolvers import reverse
from django.contrib.sitemaps import Sitemap
from blog.models import Entry

class ViewSitemap(Sitemap):
"""Reverse static views for XML sitemap."""
def items(self):
# Return list of url names for views to include in sitemap
return ['home']

def location(self, item):
return reverse(item)

class BlogSitemap(Sitemap):
changefreq = "never"
priority = 0.5

def items(self):
return Entry.objects.filter(status=1)

def lastmod(self, obj):
return obj.pub_date


sitemaps = {'views': ViewSitemap,
   'blog_posts': BlogSitemap,
  }
***

in urls.py...
**
from project.sitemap import sitemaps
.
url('^$', home, name='home'),
etc...


On Friday, August 31, 2012 10:04:26 AM UTC+1, Mugdha wrote:
>
> Please help me in generating site maps for app. which is in django.
>

-- 
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/-/QOnbgyvZ9qAJ.
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: How sitemaps used in the Django

2012-08-31 Thread Phil
nearly forgot, also in urls.py...

(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': 
sitemaps}),

On Friday, August 31, 2012 10:04:26 AM UTC+1, Mugdha wrote:
>
> Please help me in generating site maps for app. which is in django.
>

-- 
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/-/yrioUkQZcFAJ.
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: setting up Django Compressor

2012-09-02 Thread Phil
Hi Joni,

Thanks a million for reply.

Yes I am using django runserver, its a working site just trying to get 
compressor working locally before moving to production. My css works fine 
without the compressor app. I can't see the file if I copy it in my url I 
get a 500 error and the "CACHE" folder doesn't seem to exist anywhere. I 
didn't have anything in my "urls.py" for media, but I added the following 
to see if it would help but it still didn't work...

***
if settings.DEBUG:
urlpatterns = patterns('',
url(r'^media/(?P.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
url(r'', include('django.contrib.staticfiles.urls')),
) + urlpatterns
***



On Saturday, September 1, 2012 3:09:42 PM UTC+1, Joni Bekenstein wrote:
>
> The generated css file seems to be in your media directory. If you copy 
> that URL, can you see the css file? Are you using Django's dev server 
> (runserver)? If so, did you add to your urls.py a view to serve the media 
> files? (and that view should only exist when DEBUG is true since in 
> production you're probably going to serve static files and media files 
> directly with your webserver)

-- 
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/-/2QOYzFLa-f0J.
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: setting up Django Compressor

2012-09-05 Thread Phil
Hi Joni,

Yes I have 'compressor.finders.CompressorFinder' added. All the 
requirements are installed too I double checked them all, tried installing 
them all individually and it said they were all installed already. When I 
first setup the site it was using django1.3, but recently upgraded it. 

My static url setting is

STATIC_URL = '/media/'

and media is(for local setup)...

MEDIA_URL = 'http://127.0.0.1:8080/media/'

Not sure what's going on, might just try another compressor at this stage 
as I am not having any joy with this one.



On Sunday, September 2, 2012 3:38:27 PM UTC+1, Joni Bekenstein wrote:
>
> Just to cover the basics, did you follow all installation steps described 
> here:
> http://django_compressor.readthedocs.org/en/latest/quickstart/#installation
>
> Mainly adding 'compressor.finders.CompressorFinder' to STATICFILES_FINDERS
>
>
> Another thing kind of odd is that your css URL starts with /media/. Whats 
> your STATIC_URL and MEDIA_URL setting? Check this out: 
> http://django_compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_URL
>
> It looks like its defaulting to MEDIA_URL, but you said you were using 
> Django 1.4, which should have STATIC_URL available.
>
>
> On Sunday, September 2, 2012 11:13:53 AM UTC-3, Phil wrote:
>>
>> Hi Joni,
>>
>> Thanks a million for reply.
>>
>> Yes I am using django runserver, its a working site just trying to get 
>> compressor working locally before moving to production. My css works fine 
>> without the compressor app. I can't see the file if I copy it in my url I 
>> get a 500 error and the "CACHE" folder doesn't seem to exist anywhere. I 
>> didn't have anything in my "urls.py" for media, but I added the following 
>> to see if it would help but it still didn't work...
>>
>> ***
>> if settings.DEBUG:
>> urlpatterns = patterns('',
>> url(r'^media/(?P.*)$', 'django.views.static.serve',
>> {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
>> url(r'', include('django.contrib.staticfiles.urls')),
>> ) + urlpatterns
>> ***
>>
>>
>>
>> On Saturday, September 1, 2012 3:09:42 PM UTC+1, Joni Bekenstein wrote:
>>>
>>> The generated css file seems to be in your media directory. If you copy 
>>> that URL, can you see the css file? Are you using Django's dev server 
>>> (runserver)? If so, did you add to your urls.py a view to serve the media 
>>> files? (and that view should only exist when DEBUG is true since in 
>>> production you're probably going to serve static files and media files 
>>> directly with your webserver)
>>
>>

-- 
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/-/bfE-bHAJpOkJ.
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.



login auth issue - beginner

2011-08-20 Thread Phil
Hi, 

I am new to Django and am trying to use the built in auth features for the 
first time. I have been following the steps on the djangobook website 
here... 

http://www.djangobook.com/en/1.0/chapter12/ 

However I am getting the following error on my login page. Anyone know where 
I am going wrong?... 


Environment: 


Request Method: GET 
Request URL: http://127.0.0.1:8080/login/ 

Django Version: 1.3 
Python Version: 2.7.1 
Installed Applications: 
['django.contrib.auth', 
'django.contrib.contenttypes', 
'django.contrib.sessions', 
'django.contrib.sites', 
'django.contrib.messages', 
'django.contrib.staticfiles', 
'django.contrib.admin', 
'django.contrib.admindocs', 
'healthapp', 
'healthapp.myhealth'] 
Installed Middleware: 
('django.middleware.common.CommonMiddleware', 
'django.contrib.sessions.middleware.SessionMiddleware', 
'django.middleware.csrf.CsrfViewMiddleware', 
'django.contrib.auth.middleware.AuthenticationMiddleware', 
'django.contrib.messages.middleware.MessageMiddleware') 


Traceback: 
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" 
in get_response 
111. response = callback(request, *callback_args, **callback_kwargs) 
File "/home/phil/mydev/projects/healthapp/../healthapp/views.py" in login 
16. username = request.POST['username'] 
File "/usr/local/lib/python2.7/dist-packages/django/utils/datastructures.py" 
in __getitem__ 
256. raise MultiValueDictKeyError("Key %r not found in %r" % (key, self)) 

Exception Type: MultiValueDictKeyError at /login/ 
Exception Value: "Key 'username' not found in " 

-- 
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/-/9zw1FCvQ33kJ.
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: login auth issue - beginner

2011-08-20 Thread Phil
Thanks for reply. 

Yes my form is using POST. Here is my template file...

{% block content %}

  {% if form.errors %}
Sorry, that's not a valid username or password
  {% endif %}

  
User name:

Password:




  

{% endblock %}

-- 
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/-/N7rqZwk4FCsJ.
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.



"manage.py" command not found

2011-08-30 Thread Phil
Hi,

I'm running the latest django 1.4 alpha from the repository.

I have a django project hosted on bitbucket, I run the bitbucket "clone" 
command and pull down my code onto my server. But when I go into my project 
folder and run the command...

"./manage.py runfcgi method=threaded host=127.0.0.1 port=8080"

I get the following error...

"manage.py: command not found"

If I start a project directly on my server running the "startproject" 
command it works fine, it's only when I clone a project onto my server I get 
this.

Is there anything I can do to make my cloned projects work? As I need to be 
able to pull the latest project versions from my repositories.

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/-/14GRq9ygTJsJ.
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: "manage.py" command not found

2011-08-30 Thread Phil
The permissions were OK, but putting python in front of it seems to have 
worked(I have database connection issue now, but once I fix that I reckon it 
will be work)!

Thanks Yves, big help!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Y0D0NYyo4Q8J.
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: "manage.py" command not found

2011-08-30 Thread Phil
I opened my "manage.py" file to insert the line, but it was already there on 
the first line.


-- 
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/-/uXSA23Fl7iEJ.
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.



error message on runserver locally

2012-12-15 Thread Phil
Hi,

I had django setup and working for over a year now working with it on and 
off. I was away for a month, came back and now whenever I run 
"django-admin.py runserver 8080" I get the following error...

ImportError: Settings cannot be imported, because environment variable 
DJANGO_SETTINGS_MODULE is undefined.

I can import django from command line(version 1.4.3), I ran 
"django-admin.py startproject test" to try a new project. It has 
"os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test.settings")" declared 
in "manage.py" in the root and in "test/test/wsgi.py" it's also declared so 
how is my DJANGO_SETTINGS_MODULE undefined?

-- 
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/-/DKnfFKq7KcQJ.
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: error message on runserver locally

2012-12-15 Thread Phil
Hi Xavier, I tried a project called "boom" too and same message, plus my 
other 3 django projects I had working previously all get the same error now.

On Saturday, December 15, 2012 2:34:48 PM UTC, Xavier Ordoquy wrote:
>
> Hi Phil, 
>
> test is a python module. Your project name conflicts with it. 
> You should use another name for your project. 
>
> Regards, 
> Xavier Ordoquy, 
> Linovia. 
>

-- 
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/-/kFwQlmOsSQgJ.
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.



virtualenv setup

2012-12-29 Thread Phil
Hi,

I have python/django working system wide. But am currently looking into 
using Heroku for a new project so am trying to get virtualenv setup for the 
first time. When I run "django-admin.py startproject whatever" it creates 
the project ok, but then when I run "python manage.py runserver 8080" from 
the project folder I get the following error...

ImportError: No module named django.core.management

Is it because at the top of my "manage.py" it is pointing to my system wide 
python(#!/usr/bin/env python) instead of my virtualenv one? If so how do I 
fix this? I tried changing the path at the top of the manage.py file but 
didn't seem to do anything.

-- 
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/-/n4-fu8ioveIJ.
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: virtualenv setup

2012-12-29 Thread Phil
Hi,

Thanks for reply. Yeah I activated the source(terminal has "venv" beside my 
username). I followed instructions here(so I pip installed django etc after 
getting virtualenv up and running)...

https://devcenter.heroku.com/articles/django#prerequisites

If I runserver thats when I get the error. If I runserver without 
activating source it works fine but that would be using my system wide 
python. Just need to figure out how to get it to recognise the virtualenv 
python.


On Saturday, December 29, 2012 10:16:45 PM UTC, quinonesvictor wrote:
>
> Hi Phil
>
> sorry for the question, but, did you activate your virtualenv source?
> $ source bin/activate (?)
>
> Anyway, I'd try to install django via pip once you I have my virtualenv 
> created and activated.
>
> Cheers
>
> On Sat, Dec 29, 2012 at 7:01 PM, Phil >wrote:
>
>> Hi,
>>
>> I have python/django working system wide. But am currently looking into 
>> using Heroku for a new project so am trying to get virtualenv setup for the 
>> first time. When I run "django-admin.py startproject whatever" it creates 
>> the project ok, but then when I run "python manage.py runserver 8080" from 
>> the project folder I get the following error...
>>
>> ImportError: No module named django.core.management
>>
>> Is it because at the top of my "manage.py" it is pointing to my system 
>> wide python(#!/usr/bin/env python) instead of my virtualenv one? If so how 
>> do I fix this? I tried changing the path at the top of the manage.py file 
>> but didn't seem to do anything.
>>  
>> -- 
>> 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/-/n4-fu8ioveIJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> -- 
> Quiñones Victor Manuel
> Tel: +54 0362 15 4 880839
> Resistencia - 3500
> Argentina 
>

-- 
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/-/Gb4JYmpcK-0J.
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 setup advice for AWS Elastic Beanstalk

2013-02-03 Thread Phil
Hi,

I am following the steps here to setup django on aws...
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Python_django.html

I got as far as step 6 but when I "git aws.push" I never see the django "it 
worked" page, only the green beanstalk page. I'm sure where I've gone wrong 
is where Ive placed particular files/ folders so was just looking for some 
advice/ clarification on where everything should be.

So I created my virtualenv("~/web/mysiteenv/"), activate it, pip installs 
etc. From inside that folder I create my djangoproject("mysite"). So the 
files/ folders I'm unsure about are the following:


   1. I run "git init" from "~/web/mysiteenv/mysite"
   2. Where should beanstalk folder("AWS-ElasticBeanstalk-CLI-2.2") be? I 
   had it at "~/web/mysiteenv"
   3. I run "eb start" from "~/web/mysiteenv/mysite"
   4. Where should I run "mkdir .ebextensions", I ran it inside 
   "~/web/mysiteenv/mysite" I put the config file in the ".ebextensions" 
   folder.

If anyone can see where I've gone wrong I would be very grateful to you. 
I've deleted the project so I can start over. 








-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




empty static_url

2013-03-02 Thread Phil
Hi,

I'm using django1.4.3

I have a django project with 3 apps. All 3 apps templates extend 
'app.html'. On 2 of my projects the CSS loads fine, but on third one the 
CSS doesn't get loaded because it's not adding '/static/' to the url to the 
CSS. So instead of '/static/css/style.css' I'm getting '/css/style.css' ...



STATIC_URL is working on the 2 projects that use generic views, but not on 
the other one. So how can 'STATIC_URL' be blank and how can this be fixed? 
I tried adding the following to my index.html template but no joy...

{% load static %}
{% get_static_prefix as STATIC_PREFIX %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: empty static_url

2013-03-06 Thread Phil
Hi Tom,

Thanks a million for the reply, you helped solve my issue.

Technically speaking, if that is your template, and you end up with 
"/css/style.css", then STATIC_URL is not empty, it is '/'. 

Yeah sorry, I should have just had "css/style.css" as I wasn't even getting 
the forward slash.

Yes thats correct, 1 project with 3 apps etc. I just changed the last line 
in my view(that wasn't working, not the 2 generic view ones) from...

return render_to_response('sales/index.html', {'sales_list': sales_list})

to...

return render_to_response('sales/index.html', {'sales_list': 
sales_list},context_instance=RequestContext(request))

and that did the job. Thanks again.





On Monday, March 4, 2013 2:33:50 PM UTC, Tom Evans wrote:
>
> On Sat, Mar 2, 2013 at 4:47 PM, Phil > 
> wrote: 
> > Hi, 
> > 
> > I'm using django1.4.3 
> > 
> > I have a django project with 3 apps. All 3 apps templates extend 
> 'app.html'. 
> > On 2 of my projects the CSS loads fine, but on third one the CSS doesn't 
> get 
> > loaded because it's not adding '/static/' to the url to the CSS. So 
> instead 
> > of '/static/css/style.css' I'm getting '/css/style.css' ... 
> > 
> >  
>
> Technically speaking, if that is your template, and you end up with 
> "/css/style.css", then STATIC_URL is not empty, it is '/'. 
>
> > 
> > STATIC_URL is working on the 2 projects that use generic views, but not 
> on 
> > the other one. So how can 'STATIC_URL' be blank and how can this be 
> fixed? I 
> > tried adding the following to my index.html template but no joy... 
> > 
> > {% load static %} 
> > {% get_static_prefix as STATIC_PREFIX %} 
> > 
>
> To clarify - you only have one project, with three apps in it. In two 
> of the apps, which only use generic views, STATIC_URL works correctly, 
> but in third app it does not. 
>
> Do these views in the third app use RequestContext to render the 
> templates? Generic views do… 
>
> Cheers 
>
> Tom 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Error.

2013-07-27 Thread Phil
How did you start your server? Using a command line such as "python 
manage.py runserver"? Or through your IDE (PyCharm, Eclipse, etc...)? 
Somewhere you mush have a window showing this kind of information:

Validating models...

0 errors found
July 27, 2013 - 12:33:15
Django version 1.5.1, using settings 'foo.settings.local'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Note that if will be slightly different if you are using gunicorn or 
something else. Also, make sure your settings file contains "DEBUG = True".

Regards,
Phil

On Saturday, July 27, 2013 8:45:39 AM UTC-3, Nigel Legg wrote:
>
> Running locally on windows7. Where would I find the logs?
> On 27 Jul 2013 12:42, "Roberto López López" > 
> wrote:
>
>>  Well, I suppose you are running that locally or have access to the 
>> server. So show the logs.
>>
>>
>>
>> On 07/27/2013 01:40 PM, Nigel Legg wrote:
>>  
>> I have provided all the information I have. That's all there is on the 
>> screen in the browser. There is no trace.
>> On 27 Jul 2013 12:26, "Roberto López López" > 
>> wrote:
>>
>>>
>>> Could be. But if you don't provide more information (i.e. detailed
>>> information about how you get that error, error stacktrace, logs), you
>>> won't get an answer.
>>>
>>>
>>> On 07/27/2013 01:21 PM, Nigel Legg wrote:
>>> > I've just set up a new view / url etc, which has quite a bit of
>>> > processing behind it.  When I click on the link for it, I get the
>>> > "Connecting" message for a few minutes, and then just "A server error
>>> > has occurred. Please contact the administrator." appears.  Is this a
>>> > time out message?
>>> > Regards,
>>> > Nigel Legg
>>> > 07914 740972
>>> > http://www.trevanianlegg.co.uk
>>> > http://twitter.com/nigellegg
>>> > http://uk.linkedin.com/in/nigellegg
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups "Django users" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> > an email to django-users...@googlegroups.com .
>>> > To post to this group, send email to 
>>> > django...@googlegroups.com
>>> .
>>> > Visit this group at http://groups.google.com/group/django-users.
>>> > For more options, visit https://groups.google.com/groups/opt_out.
>>> >
>>> >
>>>
>>>
>>> --
>>>
>>> Roberto López López
>>> System Developer
>>> Parallab, Uni Computing
>>> +47 55584091
>>>
>>> --
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com .
>>> To post to this group, send email to django...@googlegroups.com
>>> .
>>> Visit this group at http://groups.google.com/group/django-users.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>>
>> -- 
>>
>> Roberto López López
>> System Developer
>> Parallab, Uni Computing+47 55584091
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re:

2013-07-30 Thread Phil
Shouldn't you dedicate a specific path to your flat pages, like this: 
(r'^pages/', include('django.contrib.flatpages.urls'))? The 
documentation<https://docs.djangoproject.com/en/dev/ref/contrib/flatpages/>also 
indicates that you can use a "catchall" pattern, but AFTER any other 
URL patterns.

I am not a Django expert by any mean, but I don't think (r'', 
include('django.contrib.flatpages.urls')) works, since the regex is empty...

Regards,
Phil

On Tuesday, July 30, 2013 1:02:53 PM UTC-3, Robin Lery wrote:
>
>
>
> -- Forwarded message --
> From: Robin Lery >
> Date: Tue, Jul 30, 2013 at 9:22 PM
> Subject: 
> To: django...@googlegroups.com 
>
>
> Hello,
> I am stuck at a point where i should be able to type in a search query on 
> the page and it django should get back a list of matching pages if any. But 
> it doesnt show me any pages, even though its there, and gives me an erros:
>
> Page not found (404)
> Request Method: GET  Request URL: 
> http://127.0.0.1:8000/search/?csrfmiddlewaretoken=W6n1O1vQCMyDojxEkR4mPnRrVz9lYVt1&q=one
>   
>  
> No FlatPage matches the given query.
>
> Please point me as to where am doing wrong. Thank you.
>
> *my views.py:*
>
> from django.http import HttpResponse
> from django.template import loader, Context
> from django.contrib.flatpages.models import FlatPage
>
> def search(request):
> query = request.GET['q']
>  resuts = FlatPage.objects.filter(content__icontains=query)
> template = loader.get_template('search/search.html')
>  context = Context({
> 'query':query,
> 'resuts':resuts
>  })
> response = template.render(context)
> return HttpResponse(response)
>
> *urls.py:*
>
> from django.conf.urls import patterns, include, url
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
> url(r'^admin/', include(admin.site.urls)),
> (r'^tinymce/(?P.*)$', 'django.views.static.serve', { 
> 'document_root': 'C:/Users/Kakar/web/cms/static/js/tinymce/' }),
> (r'', include('django.contrib.flatpages.urls')),
> (r'^search/$', 'search.views.search'),
> )
>
> *settings.py:*
> In the installed-apps, I have installed 'search'.
>
> *default.html:*
>
> 
> 
>  {{ flatpage.title }}
> 
> 
>  
> {% csrf_token %}
> Search:
>  
> 
>  
> {{ flatpage.title }}
> {{ flatpage.content }}
>  
> 
>
> *search.html:*
>
> 
> 
>  Search
> 
> 
>  You searched for "{{query}}"; the results are listed below.
> {% if results %}
>  
> {% for page in results %}
> 
>  {{page.title}}
> 
> {% endfor %}
>  
> {% else %}
> No results.
>  {% endif %}
> 
> 
> *
> *
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: I all django's user I'm new here and also new to Python+ django technology. but i wanna learn phython........

2013-08-01 Thread Phil
Hi,

There are lots of excellent resources online to learn Django. I am myself 
going through that process. 

The best place to get started is, of course, the excellent Django 
documentation: https://docs.djangoproject.com/en/1.5/intro/tutorial01/

Finally, once you have a good grasp on the basics, I would recommend the 
excellent https://django.2scoops.org/. Their book will really take you to 
the next level, and if you can't afford to buy it, they will give it you 
for free. In the same vein, http://www.deploydjango.com/ is very 
interesting. Of course Google will yield tons of other interesting blogs on 
the topic.

For Python itself, http://learnpythonthehardway.org/ or (my favourite) 
http://www.diveintopython.net/ are excellent resources to get you started.

Regards,
Phil

On Thursday, August 1, 2013 6:28:48 AM UTC-3, Rakesh Balhara wrote:
>
> I all django's user I'm new here and also new to Python+ django 
> technology. but i wanna learn phython and i hv to make a project in this 
> technology so plzz tell me where from i start to learning i just want 
> to learn it within one week...
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Importing project URLs without a database

2013-08-01 Thread Phil
Could you post the entire content of your script? There is no way those 2 
lines (and the necessary "os" import) can cause this error.

Regards,
Phil

On Thursday, August 1, 2013 5:39:46 PM UTC-3, Jon Dufresne wrote:
>
> Hi,
>
> I am trying to write a script that outputs information about all URLs in 
> the project. The script should be able to do this without having a database 
> populated or even created.
>
> Right now the script gets to the following line:
>
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
> from project import urls
>
> However, this raises an exception _mysql_exceptions.OperationalError: 
> (1049, "Unknown database 'project'").
>
> It appears that Django is trying to connect to the database, but all I 
> want to do is analyze the URLs. Is this possible?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Admin Center is not displaying

2013-08-05 Thread Phil
There are 3 steps in the documentation. You seem to have done the first 2, 
but what about your mysite/urls.py file? Did you uncomment those lines:

# Uncomment the next two lines to enable the admin:*from django.contrib import 
admin**admin.autodiscover()*

Regards,
Phil

On Sunday, August 4, 2013 12:57:33 AM UTC-3, Cole Calhoun wrote:
>
> I am running Python 2.7.4 and Django 1.5.1 on a Mac.
>
> I completed the first part of the "Writing your first Django app." 
> tutorial (https://docs.djangoproject.com/en/1.5/intro/tutorial01/) and 
> everything went as the tutorial explained. Once I got to the second part of 
> the tutorial, it asked me to add /admin/ to my local dev url, nothing 
> rendered. I didn't receive any errors in the terminal, but the site stayed 
> the same, I saw no changes.
>
> One thing I did notice while going through the tutorial was that in 
> mysite/settings.py the django.contrib.app was not included. Once I noticed 
> that, I added it, synced the database again, but it still wouldn't work. 
> The tutorial says that it is meant for version 1.5 and 2.+ and I am running 
> 1.5.1.
>
> If anyone has any insight as to what the problem may be, that would be 
> greatly appreciated.
>
> Thanks!
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Can't run manage.py runserver (Django 1.5.1)

2013-08-05 Thread Phil
Without knowing more what you are doing, it is hard to help. But it seems 
like you are trying to decode as utf-8 something encoded differently. 
Please provide more information about what you are doing with Django.

Regards,
Phil

On Sunday, August 4, 2013 3:38:11 PM UTC-3, Anton Yermolenko wrote:
>
> Hi guys
>
> i'm new to python as well as django. Seeking help for this problem
>
> I have python 3.3 installed and django 1.5.1 on win 7
> so when i run manage.py runserver i got this error message
>
> c:\mysite>python manage.py runserver
> Validating models...
>
> 0 errors found
> August 04, 2013 - 18:51:37
> Django version 1.5.1, using settings 'mysite.settings'
> Development server is running at http://127.0.0.1:8000/
> Quit the server with CTRL-BREAK.
> Error: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start 
> byte
>
> Googling didn't help, unfortunately
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: not able to run applets

2013-08-05 Thread Phil
How are you invoking the applet? Could you show your relevant code 
(template)?

Regards,
Phil

On Monday, August 5, 2013 5:08:12 AM UTC-3, Kaushik Roy wrote:
>
> hello everyone,
>
> i am a new user of django and i am doing a small project for my course. i 
> can show static content like images, css and scripts, but 
> my applets are not running at all. i have a simple hello world applet and 
> its not showing. could anyone throw some light on this? its important for 
> me.
>
> is there any difference between how normal static content and applets are 
> dealt with?
>
> cheers,
> Kaushik
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




error on django-admin.py startproject

2011-07-02 Thread Phil
Hi,

I recently installed the latest development version of Django from
subversion. I followed all steps on site, got no errors. When I type
"import django" in Python interpreter I get no errors.

But when I try run "django-admin.py startproject mysite" I get the
following error...

"ImportError: No module named functools"

Any idea's on what the problem could be?

I am running python2.7 and latest django.

Many 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: error on django-admin.py startproject

2011-07-02 Thread Phil
Well I already have subversion installed, that's how I got django in
the first place. When I type "import functools" into the python
interpreter I get no errors back either. I can't make it out.

On Jul 2, 7:31 pm, ravinder singh  wrote:
> @
>   plz try this
>     sudo apt-get install subversion
> than
>       django-admin.py startproject mysite.ok

-- 
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: error on django-admin.py startproject

2011-07-03 Thread Phil
Thanks for all the comments everyone, it's a great help.

Yes I have more than one python installed, when I got the server it
had python2.4 and I read the latest django stopped supporting 2.4 so I
installed python2.7 after reading this(also it said not to delete
python2.4 because 'yum' needs it to survive). But I had already
installed django when I just had 2.4. So I reinstalled django after
installing python2.7, but it is still obviously pointing to wrong
python version.

Is it now just a matter of me changing the top line in my 'django-
admin.py' file to point to correct python version, something like?...

#! /path/to/python2.7/env python2.7

If yes, how do I find correct path to python2.7 because I changed it
to where I have python2.7 and it tells me

"bad interpreter: No such file or directory"

Thanks again.





On Jul 3, 12:18 pm, bruno desthuilliers
 wrote:
> On 2 juil, 21:57, Phil  wrote:
>
> > When I type "import functools" into the python
> > interpreter I get no errors back either. I can't make it out.
>
> see my other answer - either you're not invoking the right Python (if
> you have more than one) or something messes with your sys.path.
> functools was added in Python 2.5, so if you do have a 2.4 version
> installed and django-admin ends up invoking Python 2.4 you're problem
> is almost solved.

-- 
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: error on django-admin.py startproject

2011-07-07 Thread Phil
Thanks for advice everyone.

I had installed python2.7 the normal way using "wget
http://www.python.org/ftp/python/2.7/Python-2.7.tar.bz2";

I am reading up a bit more on it and will give it another go hopefully
with more success.

Thanks again.


On Jul 4, 10:15 am, Tim Diggins  wrote:
> I think it helps you to use virtualenv when using django on a machine
> with multiple pythons (it's a great tool anyway, but this is an extra
> reason).
>
> the trick is to use virtualenv's -p argument when creating the
> environment, to specify the path to the python executable.
> so, in summary:
>
> 1) install virtualenv[1] (in any python - whatever one works on the
> command line - maybe by installing the python-virtualenv package on
> your packaging system. Depending on your packaging system, you may
> need to then upgrade it (using pip, which virtualenv automatically
> installs: pip install --upgrade virtualenv)
> 2) create a virtualenv
> virtualenv -p /path/to/python2.7 /some/new/path/for/env
> 3) activate the virtualenv in your shell
> /some/new/path/for/env/bin/activate
> 4) install django using that environment
> (it will pick up the python in the shell - you can also I think use
> pip with a subversion repos[2], but I haven't done that).
> [1]http://pypi.python.org/pypi/virtualenv
> [2]http://www.pip-installer.org/en/latest/requirement-format.html
>
> On Jul 4, 9:26 am, bruno desthuilliers 
> wrote:
>
>
>
>
>
>
>
> > On Jul 3, 5:46 pm, Phil  wrote:
>
> > > Thanks for all the comments everyone, it's a great help.
>
> > > Yes I have more than one python installed, when I got the server it
> > > had python2.4 and I read the latest django stopped supporting 2.4 so I
> > > installed python2.7 after reading this(also it said not to delete
> > > python2.4 because 'yum' needs it to survive).
>
> > Yeps, uninstalling your system's Python is usually a *very* bad idea
> > (unless you want a broken system, of course).
>
> > > But I had already
> > > installed django when I just had 2.4. So I reinstalled django after
> > > installing python2.7, but it is still obviously pointing to wrong
> > > python version.
> > > Is it now just a matter of me changing the top line in my 'django-
> > > admin.py' file to point to correct python version, something like?...
>
> > > #! /path/to/python2.7/env python2.7
>
> > > If yes, how do I find correct path to python2.7
>
> > how did you install python 2.7 ?
>
> > Also and FWIW, this has nothing to do with django so this discussion
> > would be better on comp.lang.python
>
> > HTH

-- 
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.



get django/lighttpd "hello world" page

2011-07-18 Thread Phil
Hi,

I have an ubuntu server, django is fully installed and working,
lighttpd is installed and working(works with standard html page), but
I am not sure how to get them talking to each other?

It is my first time putting a django site onto a live server so any
help is appreciated. I'm used to a php "stick everything into webroot"
setup.

I have the following in my lighttpd.conf file as mentioned on django
website

server.document-root = "/var/www"
fastcgi.server = (
"/mysite.fcgi" => (
"main" => (
# Use host / port instead of socket for TCP fastcgi
"host" => "my ip address",
"port" => 80,
#"socket" => "/home/user/mysite.sock",
"check-local" => "disable",
)
),
)


At present all that is doing is loading my html page in my webroot. I
have restarted lighttpd and all. But not sure how it see's django
project?

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: get django/lighttpd "hello world" page

2011-07-18 Thread Phil
Thanks for reply. Yeah I seen that, I did run "./manage.py runfcgi
method=threaded host=my ip address port=80" in my mysite directory but
am still getting a "not found" page.


On Jul 18, 10:41 pm, Daniel Roseman  wrote:
> Op maandag 18 juli 2011 20:29:03 UTC+1 schreef Phil het volgende:
>
>
>
>
>
>
>
>
>
> > Hi,
>
> > I have an ubuntu server, django is fully installed and working,
> > lighttpd is installed and working(works with standard html page), but
> > I am not sure how to get them talking to each other?
>
> > It is my first time putting a django site onto a live server so any
> > help is appreciated. I'm used to a php "stick everything into webroot"
> > setup.
>
> > I have the following in my lighttpd.conf file as mentioned on django
> > website
>
> > server.document-root = "/var/www"
> > fastcgi.server = (
> >     "/mysite.fcgi" => (
> >         "main" => (
> >             # Use host / port instead of socket for TCP fastcgi
> >             "host" => "my ip address",
> >             "port" => 80,
> >             #"socket" => "/home/user/mysite.sock",
> >             "check-local" => "disable",
> >         )
> >     ),
> > )
>
> > At present all that is doing is loading my html page in my webroot. I
> > have restarted lighttpd and all. But not sure how it see's django
> > project?
>
> > Thanks.
>
> See the very good documentation on FastCGI 
> setup:https://docs.djangoproject.com/en/1.3/howto/deployment/fastcgi/
> - it even has a section specifically on lighttpd.
> --
> DR.

-- 
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: get django/lighttpd "hello world" page

2011-07-20 Thread Phil
if I can get a standard HTML to display on port 80 with lighttpd does
that still mean I have to use a different port for fcgi?

On Jul 18, 10:59 pm, Javier Guerra Giraldez 
wrote:
> On Mon, Jul 18, 2011 at 4:55 PM, Phil  wrote:
> > I did run "./manage.py runfcgi
> > method=threaded host=my ip address port=80"
>
> don't use port 80 for FastCGI.  chances are that it's already used
>
> --
> Javier

-- 
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: get django/lighttpd "hello world" page

2011-07-20 Thread Phil
thanks Javier! I switched it to port 8080 now.

I have a "lighttpd/lighttpd.conf" with the following...

server.document-root = "/var/www"

$HTTP["host"] =~ "(^|\.)mydomain\.com$" {
fastcgi.server = (
"/var/www/mydomain.fcgi" => (
"main" => (
# Use host / port instead of socket for TCP fastcgi
"host" => "my ip address",
"port" => 8080,
#"socket" => "/home/user/mysite.sock",
#"check-local" => "disable",
)
),
)
}


But I also have a "lighttpd/conf-enabled/10-fastcgi.conf" file with
the following

server.modules += ( "mod_fastcgi" )

$HTTP["url"] =~ "^/cgi-bin/" {
cgi.assign = ( ".py" => "/usr/bin/python" )
}

## Warning this represents a security risk, as it allow to execute any
file
## with a .pl/.php/.py even outside of /usr/lib/cgi-bin.
#
cgi.assign  = (
#   ".pl"  => "/usr/bin/perl",
#   ".php" => "/usr/bin/php-cgi",
   ".py"  => "/usr/bin/python",
)


Do I have the correct code in the right place or am I missing
something out?


On Jul 20, 7:52 pm, Javier Guerra Giraldez  wrote:
> On Wed, Jul 20, 2011 at 1:42 PM, Phil  wrote:
> > if I can get a standard HTML to display on port 80 with lighttpd does
> > that still mean I have to use a different port for fcgi?
>
> absolutely.
>
> the port used between the webserver and webapp must _not_ be the same
> where the browsers connect to the webserver.
>
> --
> Javier

-- 
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: get django/lighttpd "hello world" page

2011-07-20 Thread Phil
thanks Javier.

On Jul 20, 8:13 pm, Javier Guerra Giraldez  wrote:
> On Wed, Jul 20, 2011 at 2:02 PM, Phil  wrote:
> >            "host" => "my ip address",
>
> sometimes flup (and other fastcgi launchers) bind only to the
> 127.0.0.1 IP.  if you want to put the webserver and webapp on
> different machines, be sure to bind to all IPs (typically setting "0"
> as IP on the launcher).  if both webserver and webapp are on the same
> machine, faster and safer is to use 127.0.0.1 (and even faster and
> safer is to use socket files)
>
> --
> Javier

-- 
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.



Setup issue

2011-01-04 Thread Phil
Hi all,

I am having a setup issue on my personal laptop, I got through setup
and couple of tutorials on my Mac in work but not having any joy at
home. I'm running Ubuntu 10.04 Lucid Lynx.

I run "import django" and I don't get any errors back so I thought I
was OK, but when I run "django-admin.py startproject projectname" I
get back an error saying...

"File ", line 1django-admin.py startproject
projectname..Error: invalid syntax"


I'm running on python 2.6.5, I had python3 installed and got rid of it
encase it was conflicting, basically my question is were do I need to
start looking, I must be missing something but I'm not sure were to
start. Any advice I could get would be magic as it's my new year
resolution to be efficient django man by end of year, not off to a
great start :(

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Setup issue

2011-01-04 Thread Phil
Hi Shawn,

When it wasn't working I tried both from command line and from
interpreter, from command line just says "command not found". No I
wasn't calling the project that, I've tried a few different project
names and none seem to work.

Thanks for advice/ tips. I'll keep posted when I get to the bottom of
it.



On Jan 4, 3:33 pm, Shawn Milochik  wrote:
> What actual project name are you using? Have you tried using different 
> project names?
>
> If you're literally using "projectname" then you may be using a command-line 
> argument and causing a conflict.
>
> Shawn

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Setup issue

2011-01-16 Thread Phil
Thanks for reply Mike and TheRedRabbit, unfortunately I have never got
to try your suggestions. Before your response came in I tried
upgrading Lucid Lynx to Maverick Meerkat and lets just say it didn't
go well for me, I no longer have Linux installed on my laptop so am
back in Windows :(

to be continued



On Jan 6, 3:51 am, Mike Ramirez  wrote:
> > on linux you have to type:
>
> > 'python django-admin.py startproject projectname'
>
> > I think your missing the python let me know if this sorts it out
>
> Forgot to add the executable bit must be set in the permissions i.e.:
> chmod a+x django-admin.py  (though this is already done for you by the
> django team as it comes out of svn/tarballs with it set.)

-- 
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: Admin interface question

2009-03-30 Thread Phil Edwards

Phil Edwards wrote:
> Hi All:
> 
> First off, apologies if this message ends up appearing twice - I had a 
> minor problem getting Google to recognise that I'd subscribed...
> 

Somehow, I just *knew* that was going to happen... :-)

-- 

Regards

Phil Edwards   |  PGP/GnuPG Key Id
Brighton, UK   |  0x68393AEE


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Admin interface question

2009-03-30 Thread Phil Edwards

Hi All:

First off, apologies if this message ends up appearing twice - I had a 
minor problem getting Google to recognise that I'd subscribed...

For my first 'teach myself Django' project, I'm implementing an 
application to manage a software repository. Programs in the repository 
have a category (office, internet, multimedia, etc, etc) associated with 
them and a changelog is maintained showing which items were added to, 
deleted from or changed in each subsequent release of the repository.

I've worked through the tutorials and read some of the online book. I 
have my models defined and the admin interface for my application works 
pretty much the way I want it.

The models look like this:

-begin models.py-
from django.db import models

categoryChoices = (
 (1, 'Security'),
 (2, 'Office'),
 (3, 'Programming'),
 (4, 'Internet'),
 (5, 'Multimedia'),
 (6, 'Miscellaneous'),
)

# Create your models here.
class Program(models.Model):

 ratingChoices = (
 (1, 'Essential'),
 (2, 'Important'),
 (3, 'Nice to Have'),
 (4, 'Geeks Only'),
 )

 category = models.IntegerField(choices = categoryChoices)
 rating = models.IntegerField(choices = ratingChoices)
 name = models.CharField(max_length = 50)
 version = models.CharField(max_length = 15)
 description = models.TextField()
 mainURL = models.URLField(verify_exists = False)
 downloadURL = models.URLField(verify_exists = False)
 installerPath = models.FileField(upload_to = 'downloads')

 def __unicode__(self):
 return str(self.name) + ' v' + str(self.version)

class Release(models.Model):
 version = models.CharField(max_length = 15)
 reldate = models.DateField()

 def __unicode__(self):
 return 'v' + str(self.version) + ' (' + str(self.reldate) + ')'

class ChangeLog(models.Model):
 relVersion = models.ForeignKey('Release')
 category = models.IntegerField(choices = categoryChoices)
 logEntry = models.CharField(max_length = 100)

--end models.py--

My admin interface looks like this:

-begin admin.py-
from django.contrib import admin
from winxpUtils.software.models import Program, Release, ChangeLog

class ProgramAdmin(admin.ModelAdmin):
 list_display = ('name', 'version', 'category', 'rating')
 ordering = ('name',)
 list_filter = ('category', 'rating')
 search_fields = ('description',)

class ChangeInline(admin.TabularInline):
 model = ChangeLog
 extra = 3

class ReleaseAdmin(admin.ModelAdmin):
 list_display = ('version', 'reldate')
 ordering = ('-version',)
 inlines = [ChangeInline]

class ChangeLogAdmin(admin.ModelAdmin):
 list_display = ('relVersion', 'category', 'logEntry')
 ordering = ('category',)
 list_filter = ('relVersion',)

admin.site.register(Program, ProgramAdmin)
admin.site.register(Release, ReleaseAdmin)
admin.site.register(ChangeLog, ChangeLogAdmin)

--end admin.py--

The only thing that I can't figure out in the admin interface is how to 
make my 'TabularInline' bit display the way I want it to. When I go to 
the 'Releases' page, every ChangeLog entry has the title 'ChangeLog 
object' displayed above it. Is there any way to get rid of this? The 
'polls' application in the tutorial doesn't have object names displaying 
like this, but I can't see what I'm doing differently. Just in case my 
explanation isn't clear, I've put a partial screen shot here:

http://www.linux2000.com/django-admin.png

The titles I want to get rid of are circled. Hope this makes sense and 
thanks in advance for any suggestions.

-- 

Regards

Phil Edwards   |  PGP/GnuPG Key Id
Brighton, UK   |  0x68393AEE


--~--~-~--~~~---~--~~
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: First Django project - Admin question

2009-03-30 Thread Phil Edwards

Daniel Roseman wrote:
> 
> Before answering, I'd point out you have a very significant potential
> bug. Each of your __unicode__ methods actually uses str(). This will

Thank you, that's useful to know - one more item in the (so far!) quite 
empty bag of Django experience!

> Now, on to the question. It's actually related, in that the value that
> gets printed there is the unicode of the inline model. If you want to
> change the value, define a __unicode__ on ChangeLog. But to actually
> remove the value, you'll need to override the inline template. You can
> copy what's in django/contrib/admin/templates/admin/edit_inline/
> tabular.html and just remove lines 25-28. Place the your overridden
> template somewhere in your own templates directory, and put
> template='path/to/your/template.html' in the ChangeInline admin class.

That sort of works - it gets rid of the text, but the space on the page 
that it used to occupy is still there. I've got a better clue where to 
look now, which is good.

Thanks for your help.


-- 

Regards

Phil Edwards   |  PGP/GnuPG Key Id
Brighton, UK   |  0x68393AEE


--~--~-~--~~~---~--~~
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 download archives for this mailing list?

2009-04-15 Thread Phil Mocek

How can I download a complete archive of this list?  Various Web
searches for combinations of "google groups," "list," "archive,"
"download," etc., have not turned up the answer.  I'd like to be
able to search and browse the list using my own MUA instead of
having to go through Google's Web interface.

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Is django-users available via NNTP?

2009-04-15 Thread Phil Mocek

Is this list available via NNTP on Usenet?  Google Groups started
out as a Web interface to Usenet.  It's unclear now where the line
between mailing list and newsgroup lies with Google Groups.

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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: Is django-users available via NNTP?

2009-04-15 Thread Phil Mocek

On Wed, Apr 15, 2009 at 07:49:00PM -0500, Eugene Lazutkin wrote:
> I use NNTP provided by gmane. The group is gmane.comp.python.django.user.

That group isn't carried by my Usenet provider, Giganews.  Are you
connecting directly to a Gmane server, or do you get it through your own
Usenet provider?

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Why does dumpdata, flush, loaddata cycle not result in same db content?

2009-04-15 Thread Phil Mocek

I have a simple project using the flatpages app.  If I use
manage.py to run dumpdata (with no command line arguments,
redirecting output to a file), then flush, then loaddata (with no
command line arguments, redirecting input from a file), my sqlite3
database file is different than a backup copy I made of it, and
when I run the app, it seems to be reset to an empty-database
condition.  Why is this?

The dump file appears to contain the content of my database.

The Django docs [1] say:

dumpdata

django-admin.py dumpdata 

Outputs to standard output all data in the database associated
with the named application(s).

If no application name is provided, all installed applications
will be dumped.

The output of dumpdata can be used as input for loaddata.

[1]: 

In the root directory of my project, I'm running:

./manage.py dumpdata >data.json
./manage.py flush
# (answer yes to flush, no to create superuser)
./manage.py loaddata http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



manage.py loaddata fails to report error [was: Why does dumpdata, flush, loaddata cycle not result in same db content?]

2009-04-15 Thread Phil Mocek

On Thu, Apr 16, 2009 at 11:03:33AM +0800, Russell Keith-Magee wrote:
> Loaddata doesn't take input from stdin - it loads files that are
> specified on the command line.

Thanks, Russell.

I should have read the documentation for the loaddata command more
closely, but this is quite counter-intuitive.  Can someone tell me
what the rationale for this syntax is?

The built-in usage help shows that the filename argument (called a
fixture for reasons that I have not yet researched) is mandatory:

Usage: manage.py loaddata [options] fixture [fixture ...]

However, manage.py does not report an error when a fixture is not
specified:

$ ./manage.py loaddata 
$ echo $?
0

Only when I bump the verbosity up from 0 to 2 is an error
reported, and the return code still indicates success:

$ ./manage.py loaddata --verbosity=1 ; echo $?
0
$ ./manage.py loaddata --verbosity=2 ; echo $?
No fixtures found.
0

This is pretty bad unless there's a preferred method of loading
data in a non-interactive manner.


Possibly-relevant tickets found with a search of the Django Trac
(for "manage.py loaddata") include:

#6724 (loaddata w/ errors displays no warnings or error in output)
closed as duplicate of #4499 (integrity error silently failing with 
postgres and loaddata)

#4431 (manage.py loaddata should have better error reporting)
closed as fixed with r6936

#4371 (fixture loading fails silently in testcases)
closed as fixed with r7595

#10200 (loaddata command does not raise CommandError on errors)
new

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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: manage.py loaddata fails to report error (#10849)

2009-04-16 Thread Phil Mocek

On Thu, Apr 16, 2009 at 04:04:29PM +0800, Russell Keith-Magee wrote:
> On Thu, Apr 16, 2009 at 11:30 AM, Phil Mocek wrote:
> > The built-in usage help shows that the filename argument (called a
> > fixture for reasons that I have not yet researched) is mandatory:
> >
> >Usage: manage.py loaddata [options] fixture [fixture ...]
> >
> > However, manage.py does not report an error when a fixture is not
> > specified:
> >
> >$ ./manage.py loaddata
> >$ echo $?
> >0
> 
> The fact that no error message is raised for the 'you didn't provide
> any arguments' case looks like a bug to me.  This should be logged
> as a new ticket so it isn't forgotten.

Done.  I opened #10849 (management loaddata: bad syntax not reported,
results in successful return code) [1] and associated it with component
"django-admin.py".

Also, I previously made note of this behavior in #10200 (loaddata
command does not raise CommandError on errors) [2].


References:

[1]: <http://code.djangoproject.com/ticket/10849>
[2]: <http://code.djangoproject.com/ticket/10200#comment:5>

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



proposal to allow loaddata to read from stdin [was: manage.py loaddata fails to report error]

2009-04-17 Thread Phil Mocek

On Thu, Apr 16, 2009 at 04:04:29PM +0800, Russell Keith-Magee wrote:
> The problem with loading a fixture from stdin is that you have no idea
> what format that fixture is.  Currently, fixture format is detected
> from the filename extension

It's impossible to detect anything about the content of a file by
examining its filename.  If loaddata makes any assumptions about fixture
format based on the filename of a fixture, then I would consider this to
be a bug.

However, due to long-standing conventions, the filename suffix
("extension" in MS-DOS parlance) often provides a clue about the format
of the data within.  These conventions allow loaddata to make a
reasonable guess about the content of a file based on its name.  That
may be a useful practice, but it's still just a guess.

> if fixture data [were to come from] from stdin, we would need to
> either:
> 
>  1) Use file magic to work out what type of input was being provided
>  2) Add a --format option so the input format could be explicitly
> specified.
> 
> Neither of these two options particularly appeals to me, but I am open
> to be being convinced otherwise.

Disclaimer:  I'm new to Django, and I don't yet have my head around what
a fixture is.  I'm very familiar with using command line utilities to
read character streams.  My discussion of this topic is offered in the
context of using loaddata with fixtures that happen to be (or happen to
come from?) files or from standard input.

Whether input is read from standard input or from a file whose name was
passed on the command line, loaddata will not know what is in the file
until the file is read.  It can predict what the format of the data will
be based on the name of a file.  It could make what is likely to be a
better prediction about the format of the data if the caller explicitly
stated on the command line what the format is intended to be.  In either
case, loaddata would be engaging in risky behavior if it used the data
without some verification that it is of a particular format.

A --format option would achieve parity with the syntax of loaddata's
counterpart, dumpdata, and would allow the caller to explicitly state
what loaddata should expect.  This would provide more information to
loaddata about the format of the data than a filename provides, because
the best the filename can do is imply something about the format of the
data.  Validly-formatted data still wouldn't be guaranteed, but the
program would then know what the caller intends for the format to be,
and that is more information than it would have were it provided with
nothing but the stream of data and a filename.

If it's reasonable for the program to predict data format based on
filename, then it would seem to be reasonable in the absence of a
filename to predict the data format based on whatever the default format
is documented to be.  This would again provide parity with the dumpdata
command, which prints data in its default format, JSON, when a format is
not explicitly selected by the caller.  In either case, it would be best
for some sort of internal check to occur before loaddata does anything
with the stream of data.

My inclination would be for it to adopt the POSIX convention of reading
from a particular file if one is specified on the command line, from
standard input if the filename specified on the command line is "-",
and from standard input if no file is specified on the command line.
Thus, the rules would be:

if filename specified on cmdline:
if that filename is "-":
read from stdin
else:
read from file with name specified
else:
read from stdin

Note that this means anything on standard input is ignored if the caller
provides a filename.  This maintains backwards-compatibility with the
current behavior.

Once the program decides where to get input, it can move on to deciding
what to do with that input based on all the information available to it.
These seem to be very different tasks, and I think it's important to
maintain a distinction between them.

For an example of the usefulness of using loaddata with standard input,
consider the act of loading the database of a Django-based Web
application with the content of the database of an instance of the same
application running elsewhere:

ssh remotehost /path/to/manage.py dumpdata | /path/to/local/manage.py 
loaddata

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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 can I create a Python source code file? [was: .py!]

2009-04-17 Thread Phil Mocek

On Fri, Apr 17, 2009 at 12:53:29AM -0700, 83nini wrote:
> guys how do i create a .py file?
>
> I am working on the tutorial and i don't know how to create views.py

First, for your own good and that of other subscribers to this mailing
list, please see Eric S. Raymond's essay, "How To Ask Questions The
Smart Way" [1], particularly the section, "Use meaningful, specific
subject headers" [2].

There's really no such thing as a ".py file".  ".py" is a suffix
typically used in the names of files that contain source code written in
the Python programming language.  They can be created the same ways that
any other files are created.  Typically, you'd do so using a text
editor.

A text editor, sometimes called a programmer's editor, is simply a
program that allows one to create and modify plain text.  Source code is
plain text.  E-mail is plain text (unless you stuff something else, like
HTML in it, but please don't do that).

Although all modern word processors can export a document as plain text
and although some are able to edit in a special plain text mode, they
are generally not the best tool for editing plain text, as they are
designed primarily for dealing with complicated formatting and page
layout.

GNU Emacs [4] and Vim [5] (a clone of the ancient vi editor) are very
powerful and widely-used editors with steep learning curves.  Though
their roots are in Unix, they are now available on any platform for
which an ANSI C compiler exists, so they run almost everywhere.

The bare-bones but ubiquitous Notepad is included with Windows operating
systems.  It has very few features -- it's a text editor, but hardly
adequate as a programmer's editor -- but it is small, fast, and familiar
to Windows users.  Notepad2 [6] seems to be a good replacement.

On Mac OS, TextEdit is included with the operating system and is similar
in functionality to Windows' Notepad.  BBEdit [7] and SubEthaEdit [8] are
very popular text editors for Macs.

jEdit [9] is written in Java, so it runs on all the above operating
systems.

For more advanced editing with the addition of features like code
completion, syntax highlighting, syntax analysis, refactoring, and
debugging, some people prefer to use an IDE (integrated development
environment).  An excellent one is Eclipse [10].  It runs anywhere Java
is available.  PyDev [11] is a Python plugin for Eclipse.

On an Ubuntu or Debian GNU/Linux system, to install vim and any
prerequisites, you'd run "apt-get install vim" from the command line.
Similarly, to install PyDev (and Eclipse, and all their prerequisites)
you'd run "apt-get install eclipse-pydev".  On Mac OS, things are a bit
more complicated.  On Windows, things are a lot more complicated.


References:

 [1]: <http://www.catb.org/~esr/faqs/smart-questions.html>
 [2]: <http://www.catb.org/~esr/faqs/smart-questions.html#bespecific>
 [3]: <http://www.python.org/>
 [4]: <http://www.gnu.org/software/emacs/>
 [5]: <http://www.vim.org/>
 [6]: <http://www.flos-freeware.ch/notepad2.html>
 [7]: <http://www.barebones.com/products/bbedit/index.shtml>
 [8]: <http://www.codingmonkeys.de/subethaedit/>
 [9]: <http://www.jedit.org/>
[10]: <http://www.eclipse.org/>
[11]: <http://pydev.sourceforge.net/>

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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: .py!

2009-04-17 Thread Phil Edwards

Ionut G. Stan wrote:
> I guess you're coding in Notepad, in which case I'd recommend to look 
> for another editor.

Yup - my favourite for code editing on Windows is PSPad. Free download 
from here:

http://www.pspad.com/en/

Compatible with XP, Vista and Windows7



-- 

Regards

Phil Edwards   |  PGP/GnuPG Key Id
Brighton, UK   |  0x68393AEE


--~--~-~--~~~---~--~~
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: Registration

2009-04-19 Thread Phil Mocek

On Sun, Apr 19, 2009 at 02:28:39AM -0700, TP wrote:
> Still having the same problem if anyone can help?

I can't help with your problem, but it's likely that I can help you find
people who are willing and able to help you.  Please see this essay,
"How To Ask Questions The Smart Way," by Eric S.  Raymond:

<http://www.catb.org/~esr/faqs/smart-questions.html>

In particular, see the section, "Use meaningful, specific subject
headers":

<http://www.catb.org/~esr/faqs/smart-questions.html#bespecific>

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



verdjn.com down; alternative location or replacement for TemplatePages? [was: verdjnlib templatepages vs django static content server]

2009-04-21 Thread Phil Mocek

On Mon, Jan 15, 2007 at 04:02:02PM -0800, cwurld wrote:
> I was reviewing the code for two different ways of serving static
> webpages:
> 
> 1) verdjnlib templatepages ( http://www.verdjn.com/wiki/TemplatePages )
> 
> 2) django static pages (
> http://www.djangoproject.com/documentation/static_files/ )

www.verdjn.com has not been responding to HTTP requests for the past
several days.  Is TemplatePages available elsewhere?

Can someone suggest another project which aims to allow users to modify
both content and templates for flat pages via Web interface?

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Does 1and1 Hosting provide Django prerequisites? [was: installing a development environment on a 1and1.com shared hosting.]

2009-04-21 Thread Phil Mocek

On Tue, Apr 21, 2009 at 11:16:06PM +0200, Didine wrote:
> Is there any way to install & deploy a django application on a
> 1and1.comshared hosting ?

By asking this question, you seem to assume that subscribers to the
django-users list are already aware of how this service in which you
have expressed interest works.  That is not a safe assumption.

I suspect what you meant to ask was, "Does 1and1 Hosting have all the
prerequisites for running a Django application?"  That is a question
better suited for 1and1 staff than for the general population of users
of Django.

Friendly advice: in order to get more help from subscribers to the list,
you should read
<http://www.catb.org/~esr/faqs/smart-questions.html#bespecific>

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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: Can I use the django test server for this?

2009-04-21 Thread Phil Mocek

On Tue, Apr 21, 2009 at 05:15:00PM -0700, Kevin Audleman wrote:
> I've been moving forward with [my experimentation with using Django's
> development Web server for more than just development] and have come
> across an oddity: while I can access my site on the resident machine
> via http://localhost:8000, if I try to access it from another machine
> on the network via http://10.0.0.66:8000 I get an error in my browser:
> 
> Failed to Connect Though the site seems valid, the browser was unable
> to establish a connection.
> 
> If I can get this problem resolved, then I've found my lowest barrier
> solution. Any thoughts?

Yes.  RTFM:

<http://docs.djangoproject.com/en/1.0/ref/django-admin/#runserver>

Also, the usage help that is built into the manage utility you're asking
about explains how to specify the IP address and port number the server
should listen on:

$ ./manage.py help runserver
Usage: manage.py runserver [options] [optional port number, or ipaddr:port]

Starts a lightweight Web server for development.

Options:
  --settings=SETTINGS   The Python path to a settings module, e.g.
"myproject.settings.main". If this isn't provided, 
the
DJANGO_SETTINGS_MODULE environment variable will be
used.
  --pythonpath=PYTHONPATH
A directory to add to the Python path, e.g.
"/home/djangoprojects/myproject".
  --traceback   Print traceback on exception
  --noreloadTells Django to NOT use the auto-reloader.
  --adminmedia=ADMIN_MEDIA_PATH
Specifies the directory from which to serve admin
media.
  --version show program's version number and exit
  -h, --helpshow this help message and exit

See also: <http://www.catb.org/~esr/faqs/smart-questions.html#rtfm>

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



meaning of localhost & loopback interface [was: Can I use the django test server for this?]

2009-04-21 Thread Phil Mocek

On Wed, Apr 22, 2009 at 08:25:43AM +0800, Russell Keith-Magee wrote:
> ./manage.py runserver will attempt to bind to localhost:8000 by
> default. This address isn't visible to any outside machine (by
> definition - it's the _local_ host).

Localhost [1] is a hostname, not an address.  It typically resolves to the
IP address 127.0.0.1, which is the address of the loopback interface [2].


References:

[1]: <http://en.wikipedia.org/wiki/Localhost>
[2]: <http://en.wikipedia.org/wiki/Loopback>

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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: Changing MEDIA_ROOT while running tests (as in ./manage.py test)

2009-04-22 Thread Phil Mocek

On Tue, Apr 21, 2009 at 11:29:38PM -0700, J. Pablo Fern?ndez wrote:
> I need to change MEDIA_ROOT while running tests, so that the files
> pointed to in fixtures in ImageFields can be found. [...] Any ideas
> how can I achieve this?

I assume you've already searched the Web with terms like "django
multiple settings," "django alternative settings," and "django
development settings."  Among the top results returned by Google are:

"Django settings files for development and production - Martin Jansen"
<http://martinjansen.com/2008/10/20/django-settings-files-for-development-and-production/>

"Multiple django configurations for development and production ..."
<http://www.bearfruit.org/blog/2008/05/28/multiple-django-configurations-for-development-and-production>

"Ninjacipher » Blog Archive » django alternate development settings ..."
<http://www.ninjacipher.com/2008/03/02/django-alternate-development-settings-file/>

So that subscribers to this list can better assist you, please tell us
what you learned from the information that is easily found on the Web,
and what you have already tried based on that information.

Also, as you're probably a considerate person who respects other
people's time, it should be safe to assume that before you asked your
question on this list, you searched the list archives to determine
whether the topic has previously been discussed (because you'd be
wasting your time and that of other subscribers if you brought it up
again for any reason other than extending the discussion or requesting
clarification).

When I search <http://groups.google.com/group/django-users/> for
"testing settings", the *second* result is:

"media directory for testing"
<http://groups.google.com/group/django-users/browse_frm/thread/1e8ac12af67c2eb1/d08cf155ab2a025b?lnk=gst&q=testing+settings#d08cf155ab2a025b>

How did the answers people already provided to Faheem Mitha's 2007
question work out for you?


> I've tried settings.MEDIA_ROOT = "blah" in the test method and in the
> setUp method but still it tries to find the file in the wrong
> location. 

Since you're having difficulty making Django settings work the way you
want, I assume you've thoroughly read the related documentation:

<http://docs.djangoproject.com/en/1.0/topics/settings/>

In section "Altering settings at runtime" of that document:
<http://docs.djangoproject.com/en/1.0/topics/settings/#altering-settings-at-runtime>

is written:
>> You shouldn't alter settings in your applications at runtime. For
>> example, don't do this in a view:
>> 
>> from django.conf import settings
>> 
>> settings.DEBUG = True   # Don't do this!
>> 
>> The only place you should assign to settings is in a settings file.

What was your rationale for trying to do *precisely* what the Django
authors told you not to do?

See also: <http://www.catb.org/~esr/faqs/smart-questions.html>,
particularly this section:
<http://www.catb.org/~esr/faqs/smart-questions.html#rtfm>

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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: Webpy vs Django

2009-04-22 Thread Phil Mocek

On Wed, Apr 22, 2009 at 11:25:42PM +1000, Nick Lo wrote:
> I thought the initial reply/ies to a perfectly legitimate question was
> unnecessarily curt and wanted to reply then, but not having any web.py
> experience, I didn't have much to add.
> 
> There was nothing to indicate that the original poster hadn't already
> done the things he was immediately jumped on for.

There was a strong indication: the OP didn't mention in his post having
done any of those things.

Here's an appropriate response to the OP's list post:

<http://lmgtfy.com/?q=web.py+vs.+django>

See also: <http://www.catb.org/~esr/faqs/smart-questions.html#rtfm>

> I can understand why overly general questions like "what advantages
> and disadvantages" can be irritating to those who've spent hours
> trying to determine that for our/themselves.

They're most irritating when the post indicates that the poster has
*not* spent any time trying to find an answer before posing the question
to the list.

> However, if the aim of a curt reply to seemingly stupid questions is
> to force the person to think a bit more about what they are asking,
> then a simple "give us more details about what you are trying to
> build" is generally as effective.

Agreed.

See also: <http://www.catb.org/~esr/faqs/smart-questions.html#id308223>

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Python on Windows: how to pass a string of text to a PostgreSQL utility? [was: How to automatic backup Postgres on Windows?]

2009-04-22 Thread Phil Mocek

On Wed, Apr 22, 2009 at 07:10:41AM -0700, Zeal wrote:
> as [shown in the] above-posted [Python snippet], for windows system,
> how can I input postgresql's password by using some method like
> tochild[?]

This question is not at all related to Django.  You might find useful
information by searching or posing your question in places where people
discuss Python, PostgreSQL, and Windows development.

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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: Webpy vs Django [and how to ask questions the smart way]

2009-04-22 Thread Phil Mocek
t
>> this document is not intended to be a general guide to netiquette,
>> and we will generally reject suggestions that are not specifically
>> related to eliciting useful answers in a technical forum.)


>> Before You Ask
>> 
>> Before asking a technical question by e-mail, or in a newsgroup, or
>> on a website chat board, do the following:
>> 
>>1. Try to find an answer by searching the archives of the forum
>>   you plan to post to.
>>2. Try to find an answer by searching the Web.
>>3. Try to find an answer by reading the manual.
>>4. Try to find an answer by reading a FAQ.
>>5. Try to find an answer by inspection or experimentation.
>>6. Try to find an answer by asking a skilled friend.
>>7. If you're a programmer, try to find an answer by reading the
>>   source code.
>> 
>> When you ask your question, display the fact that you have done these
>> things first; this will help establish that you're not being a lazy
>> sponge and wasting people's time. Better yet, display what you have
>> learned from doing these things. We like answering questions for
>> people who have demonstrated they can learn from the answers.
>> 
>> Use tactics like doing a Google search on the text of whatever error
>> message you get (searching Google groups as well as Web pages). This
>> might well take you straight to fix documentation or a mailing list
>> thread answering your question. Even if it doesn't, saying "I googled
>> on the following phrase but didn't get anything that looked
>> promising" is a good thing to do in e-mail or news postings
>> requesting help, if only because it records what searches won't help.
>> It will also help to direct other people with similar problems to
>> your thread by linking the search terms to what will hopefully be
>> your problem and resolution thread.
>> 
>> Take your time. Do not expect to be able to solve a complicated
>> problem with a few seconds of Googling. Read and understand the FAQs,
>> sit back, relax and give the problem some thought before approaching
>> experts.  Trust us, they will be able to tell from your questions how
>> much reading and thinking you did, and will be more willing to help
>> if you come prepared. Don't instantly fire your whole arsenal of
>> questions just because your first search turned up no answers (or too
>> many).
>> 
>> Prepare your question. Think it through. Hasty-sounding questions get
>> hasty answers, or none at all. The more you do to demonstrate that
>> having put thought and effort into solving your problem before
>> seeking help, the more likely you are to actually get help.
>> 
>> Beware of asking the wrong question. If you ask one that is based on
>> faulty assumptions, J. Random Hacker is quite likely to reply with a
>> uselessly literal answer while thinking "Stupid question...", and
>> hoping the experience of getting what you asked for rather than what
>> you needed will teach you a lesson.
>> 
>> Never assume you are entitled to an answer. You are not; you aren't,
>> after all, paying for the service. You will earn an answer, if you
>> earn it, by asking a substantial, interesting, and thought-provoking
>> question — one that implicitly contributes to the experience of the
>> community rather than merely passively demanding knowledge from
>> others.
>> 
>> On the other hand, making it clear that you are able and willing to
>> help in the process of developing the solution is a very good start.
>> "Would someone provide a pointer?", "What is my example missing?",
>> and "What site should I have checked?" are more likely to get
>> answered than "Please post the exact procedure I should use." because
>> you're making it clear that you're truly willing to complete the
>> process if someone can just point you in the right direction.

Again, that's from "How to Ask Questions the Smart Way" by Eric S.
Raymond, which is available at
<http://www.catb.org/~esr/faqs/smart-questions.html>.

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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: Changing MEDIA_ROOT while running tests (as in ./manage.py test)

2009-04-22 Thread Phil Mocek

On Wed, Apr 22, 2009 at 12:22:08PM -0700, J. Pablo Fern?ndez wrote:
> I already know about how to separate settings between development and
> production; but that's not what I'm trying to do and I couldn't find
> how to adapt for separating settings between development and
> test-time. That is, I haven't found any way to make './ manage.py
> test' pick a different settings file or be able to customize settings.
> Do you know how?

Yes.

It's explained in the Django settings documentation that I referenced
earlier, that you apparently did not read before asking your question or
after I helpfully suggested that you read it.  It's also explained by
the in-built usage help that manage.py provides.  You never indicated
where you'd already searched for the information you seek, and it seems
that you haven't searched at all.

So with respect, for the second time, RTFM.  Before you do that,
*please* read <http://www.catb.org/~esr/faqs/smart-questions.html#rtfm>.

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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: Changing MEDIA_ROOT while running tests (as in ./manage.py test)

2009-04-22 Thread Phil Mocek

On Wed, Apr 22, 2009 at 12:46:32PM -0700, Phil Mocek wrote:
> [What you've repeatedly asked is] explained in the Django
> settings documentation that I referenced earlier, that you
> apparently did not read before asking your question or after I
> helpfully suggested that you read it.  It's also explained by
> the in-built usage help that manage.py provides.  You never
> indicated where you'd already searched for the information you
> seek, and it seems that you haven't searched at all.

Sheesh, it's also explained just five paragraphs into the second
Google search result I cited.

If you don't understand some part of the information that has been
presented to you (information that you could very easily have
found for yourself in the manner I demonstrated for you), by all
means tell us what you're struggling with and someone will likely
be willing to clarify for you.  But please don't waste people's
time by asking for things that you could easily have found before
posting to the list -- *and* that you were very considerately
directed to after you posted to the list.

Quoting ESR:
<http://www.catb.org/~esr/faqs/smart-questions.html#before>
>> Before asking a technical question by e-mail, or in a
>> newsgroup, or on a website chat board, do the following:
>> 
>>1. Try to find an answer by searching the archives of the forum
>>   you plan to post to.
>>2. Try to find an answer by searching the Web.
>>3. Try to find an answer by reading the manual.
>>4. Try to find an answer by reading a FAQ.
>>5. Try to find an answer by inspection or experimentation.
>>6. Try to find an answer by asking a skilled friend.
>>7. If you're a programmer, try to find an answer by reading the
>>   source code.
>> 
>> When you ask your question, display the fact that you have done
>> these things first; this will help establish that you're not
>> being a lazy sponge and wasting people's time. Better yet,
>> display what you have learned from doing these things. We like
>> answering questions for people who have demonstrated they can
>> learn from the answers.
>> 
>> Use tactics like doing a Google search on the text of whatever
>> error message you get (searching Google groups as well as Web
>> pages). This might well take you straight to fix documentation
>> or a mailing list thread answering your question. Even if it
>> doesn't, saying "I googled on the following phrase but didn't
>> get anything that looked promising" is a good thing to do in
>> e-mail or news postings requesting help, if only because it
>> records what searches won't help. It will also help to direct
>> other people with similar problems to your thread by linking
>> the search terms to what will hopefully be your problem and
>> resolution thread.
>> 
>> Take your time. Do not expect to be able to solve a complicated
>> problem with a few seconds of Googling. Read and understand the
>> FAQs, sit back, relax and give the problem some thought before
>> approaching experts. Trust us, they will be able to tell from
>> your questions how much reading and thinking you did, and will
>> be more willing to help if you come prepared. Don't instantly
>> fire your whole arsenal of questions just because your first
>> search turned up no answers (or too many).
>> 
>> Prepare your question. Think it through. Hasty-sounding
>> questions get hasty answers, or none at all. The more you do to
>> demonstrate that having put thought and effort into solving
>> your problem before seeking help, the more likely you are to
>> actually get help.
>> 
>> Beware of asking the wrong question. If you ask one that is
>> based on faulty assumptions, J. Random Hacker is quite likely
>> to reply with a uselessly literal answer while thinking "Stupid
>> question...", and hoping the experience of getting what you
>> asked for rather than what you needed will teach you a lesson.

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



rude, curt, and impatient, or direct, cut-through-the-B.S. communications? [was: Webpy vs Django]

2009-04-23 Thread Phil Mocek
se
>> you're a newcomer with a theatrically hypersensitive soul and
>> delusions of entitlement.
>> 
>> Sometimes people will attack you personally, flame without an
>> apparent reason, etc., even if you don't screw up (or have only
>> screwed up in their imagination). In this case, complaining is the
>> way to really screw up.
>> 
>> These flamers are either lamers who don't have a clue but believe
>> themselves to be experts, or would-be psychologists testing whether
>> you'll screw up. The other readers either ignore them, or find ways
>> to deal with them on their own. The flamers' behavior creates
>> problems for themselves, which don't have to concern you.
>> 
>> Don't let yourself be drawn into a flamewar, either. Most flames are
>> best ignored -- after you've checked whether they are really flames,
>> not pointers to the ways in which you have screwed up, and not
>> cleverly ciphered answers to your real question (this happens as
>> well).

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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: rude, curt, and impatient, or direct, cut-through-the-B.S. communications

2009-04-23 Thread Phil Mocek

On Fri, Apr 24, 2009 at 10:46:46AM +0800, Russell Keith-Magee wrote:
> On Thu, Apr 23, 2009 at 10:19 PM, Phil Mocek
> > On Thu, Apr 23, 2009 at 06:58:53AM -0700, joeygartin wrote:
> > > Their inner sorrow is projected out in a form of rage and that
> > > usually (hopefully) only comes out as rude, curt and inpatient.
> >
> > That's a common misperception.
> >
> > <http://www.catb.org/~esr/faqs/smart-questions.html#keepcool>
> 
> Phil - I can tell that you _really_ like ESR

My frequent referral to his writing doesn't indicate much about the
degree to which I like him.  His is simply *the* essay that people refer
to when teaching newbies how to deal with technical discussions on
Usenet, mailing lists, and Web forums.  It has been for almost a decade.

"How to Ask Questions the Smart Way" is a distillation of many lessons
learned and norms established over a quarter-century of discussions in
computer-related discussion forums.  It's better, I think, to point to
something written by someone with a whole lot more seniority than I have
than to simply express my own opinion as if it were mine alone.  My
opinions hold little weight.  Not so for uber-hackers in the class of
ESR, RMS, John Gilmore, Linus Torvalds, Allan Cox, Larry Wall, and Guido
van Rossum.

> 1) We'd be much obliged if you'd stop reposting great chunks of ESR's
> essays. A link is fine.

Roger that.  In my defense, it seemed that posting a link wasn't
effective.  Sometimes peoples' appetites need to be whetted.  But I will
concede that this was poor form.

> 2) If you would stop changing the subject line of discussions every
> time you respond, that would be just dandy, too. Rapid-fire subject
> changes don't help anyone keep track of what is going on.

I didn't do that.  I only change the subject line when the topic of
discussion changes.  It would be nice if more other people did as well.

When the topic of discussion in a thread changes, it's good etiquette to
change the subject header to reflect the change.  Customarily, the first
person to reply after the change trims the "was:" portion.  This
well-established custom [1] allows subscribers who have stopped reading
the discussion (likely because of disinterest in the topic at hand) to
know that the topic has changed.  It also allows people who are still
following the discussion to know that the new topic is one that branched
from the old one.

[1]: 
<http://www.google.com.mx/search?q="mailing+list"+etiquette+topic+"change+the+subject";>

How is the conveyance of such information preferred on this list?
Neither this message nor that to which I am replying is at all related
to a comparison of Django and web.py, it's courteous to avoid indicating
that they are.

> It doesn't take much effort to write in a way that won't be
> interpreted as insulting. Hackers don't get a special pass to treat
> other people like crap simply because they have 133t skillz. 

Agreed.  And "AOLamers", their modern equivalents, and newbies of all
sorts, should only get one pass to treat a thousand others like their
personal research assistants because they haven't yet discovered man
pages, documentation, mailing list archives, and Google.  Once they've
been introduced to those things; there's no excuse.  Continued similar
behavior is at best inconsiderate, and at worst, insulting to fellow
subscribers.

> The correct response to the perception of insult isn't to direct
> someone to an essay as to why they are wrong in their perception - the
> correct response is to apologize for any perceived insult, indicate
> that the insult wasn't intended, and to rephrase your point in a way
> that isn't insulting.

I didn't intend to be insulting.  I apologize for any perceived insult.

When someone here suggested that I had been insulting, I acknowledged
that his misperception was a common one -- so common, in fact, that one
of the fathers of the free software movement wrote a whole section of
his famous essay about how to effectively communicate on lists like this
one *about* such misperceptions.  These aren't just my feelings, they're
those that many, many, people have felt over the years, and the only way
to avoid having to repeatedly feel them is to explain to people that
they could communicate a whole lot more effectively and waste a whole
lot less of other people's time if they looked at the traditions that
we've developed over many years of conducting these discussions.

The "correct response" can only be repeated so many times before it
makes sense for people to write down all the things that people keep
asking and implore them to read it before posting their own question.
We call this a FAQ.  Is it rude to point people to 

Re: Django development on OS X. Accessing development server from local network

2009-04-28 Thread Phil Mocek

On Tue, Apr 28, 2009 at 02:03:45PM +0300, Oleg Oltar wrote:
> I just wanted to make tests on development server from other PC
> (with IE installed), on my local network. How can I do it?

The information you seek is easily accessible to you via a number
of methods that require no specific knowledge of Django.  I'll
answer your question and also explain how you could have found the
answer yourself so that you can more easily find the answer to
future questions you may have.

You will need to make the development server listen on a network
interface that is accessible from other hosts on your network.  By
default it listens on the loopback interface [1], which is only
accessible from the host on which it is running.  You can specify
the IP address of a particular network interface or you can use
"0.0.0.0" which will cause it to listen on all available
interfaces.

Instructions for specifying the IP address to use can be found in
the documentation of the development server [2].  This
documentation can be found by searching the Web for "django
development server" [3].  That documentation states:

>> runserver
>> 
>> django-admin.py runserver [port or ipaddr:port]
>> 
>> Starts a lightweight development Web server on the local machine.
>> By default, the server runs on port 8000 on the IP address
>> 127.0.0.1. You can pass in an IP address and port number
>> explicitly.
>> 
>> [...]
>> 
>> Note that the default IP address, 127.0.0.1, is not accessible
>> from other machines on your network. To make your development
>> server viewable to other machines on the network, use its own IP
>> address (e.g. 192.168.2.1) or 0.0.0.0.

[1]: <http://en.wikipedia.org/wiki/Loopback>
[2]: <http://docs.djangoproject.com/en/1.0/ref/django-admin/#runserver>
[3]: <http://lmgtfy.com/?q=django+development+server>

Such information is also provided by the in-built help for
django-admin.py and manage.py.  If you run either of them without
arguments, it will print a message suggesting that you run it
again with the argument "help".  If you run "manage.py help" or
"django-admin.py help" (or if you run them with the --help switch)
a list of topics will be presented.  One of those topics is
"runserver".  If you run "manage.py help runserver" or
"django-admin.py help runserver" usage information specific to the
development server will be shown.

>> $ ./manage.py help runserver
>> Usage: manage.py runserver [options] [optional port number, or ipaddr:port]
>> 
>> Starts a lightweight Web server for development.

It is very common for command line utilities to print usage
information when you run them with the --help switch or without
any arguments.  It's a good idea to try this when you are unsure
about how to use such a utility.

When you are using UNIX or a a UNIX-like operating system (e.g.,
GNU/Linux or Apple Mac OS X) this information is also available as
a manual page [4] for django-admin.py.  To see that page, run "man
django-server.py".  On such operating systems, manual pages are
available for nearly all installed programs.

In many technical forums (e.g., mailing lists, newsgroups, and Web
forums) it is considered courteous to explore all of the
aforementioned sources of information prior to posing a question
such as yours to other people [5], and also to indicate in your
message to others what attempts you have already made at finding
your answer.  This shows that you respect other people's time and
that you are not simply being lazy.  Failing to do so is
relatively common for people who are new to such technical
discussions on the Internet, and it's common in places other than
the django-users list for experienced participants to ignore such
requests for help or to simply reply with "RTFM" [6].  Sometimes
this is rudeness, and sometimes it is simply the result of busy
people moving on to help solve problems that people cannot be
expected to solve for themselves by simply reading documentation
and searching the Web.

[4]: <http://en.wikipedia.org/wiki/Man_page>
[5]: <http://www.catb.org/~esr/faqs/smart-questions.html#before>
[6]: <http://www.catb.org/~esr/faqs/smart-questions.html#rtfm>

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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: Admin menu not logging in

2009-04-29 Thread Phil Mocek

On Wed, Apr 29, 2009 at 09:34:55AM -0700, Jordash wrote:
> How would I go about creating a super user?

What I would do is use Google to search the Web for "django create
superuser":

<http://lmgtfy.com/?q=django+create+superuser>

and follow the link to the very first result:

<http://docs.djangoproject.com/en/1.0/ref/django-admin/>

Or see the in-built help for the Django management utility or the
manage.py by running:

django-admin.py help

or

manage.py help


Or, assuming you're on a UNIX-like operating system such as
GNU/Linux or Apple Mac OS X, check the man page for the admin
util:

man django-admin.py



You need to run either:

manage.py createsuperuser

or:

django-admin.py createsuperuser

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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: How to deal with problem about ForeignKey

2009-04-29 Thread Phil Mocek

On Wed, Apr 29, 2009 at 03:06:37PM +0800, Vincent wrote:
> The situation is, i have model A and model B, B has a foreignkey
> point to A,.
> 
> now i find that i wanna delete records of A without deleting
> records of B which pointing to A.

You're trying to do something that a relational database
management system is specifically designed to prevent you from
doing.  This would be a violation of referential integrity.

If you delete the foreign key, then the records of B which refer
to it would cease to be valid, destroying the integrity of your
database, so the DBMS shouldn't allow you to do so.  Typically,
you'd configure your DBMS to disallow the deletion from A, cascade
the deletion to B, or update the record in B to NULL or some
default foreign key.

See: <http://en.wikipedia.org/wiki/Foreign_key#Referential_Actions>

This information is not specific to Django, but applies to all
relational databases.  Maybe someone else can tell you how to
select one of the aforementioned options using Django's ORM.

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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: export the html data in table format to CSV or excel file format using javascript

2009-04-30 Thread Phil Mocek

On Thu, Apr 30, 2009 at 01:41:01AM -0700, Nalini wrote:
> Does any one give me the source to export the html data in table
> format to CSV or excel file format using javascript.

Your question does not seem to be related to Django, which is the topic
of this mailing list.

You'd be more likely to find help if you posed your question somewhere
that people discuss javascript programming, such as the
comp.lang.javascript newsgroup [1].  Prior to doing that, you'd be well
off to search for prior discussion of the topic in that group [2] and
elsewhere on the Web so that you can show in your message that you have
done so and thus are able to think for yourself and not simply being
lazy [3].


References:

[1]: <http://www.jibbering.com/faq/>
[2]: <http://groups.google.com/group/comp.lang.javascript/search?q=excel+csv>
[3]: <http://www.catb.org/~esr/faqs/smart-questions.html#before>

-- 
Phil Mocek

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



  1   2   3   >