Admin Error

2007-06-09 Thread Christopher

Hi, I am using Django SVN version updated today.  I have made a model
and done the Admin code so I can see it in the Admin section of my
site and it all looks fine.  When I try to save something in there I
get the following error:

Django version 0.97-pre, using settings 'totalimpact.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[09/Jun/2007 17:21:02] "GET /admin/competitions/competition/add/ HTTP/
1.1" 200 3678
[09/Jun/2007 17:21:02] "GET /admin/jsi18n/ HTTP/1.1" 200 801
[09/Jun/2007 17:21:05] "POST /admin/competitions/competition/add/ HTTP/
1.1" 302 0
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/django/core/servers/
basehttp.py", line 272, in run
self.result = application(self.environ, self.start_response)
  File "/usr/lib/python2.5/site-packages/django/core/servers/
basehttp.py", line 614, in __call__
return self.application(environ, start_response)
  File "/usr/lib/python2.5/site-packages/django/core/handlers/
wsgi.py", line 189, in __call__
response = self.get_response(request)
  File "/usr/lib/python2.5/site-packages/django/core/handlers/
base.py", line 126, in get_response
return callback(request, **param_dict)
  File "/usr/lib/python2.5/site-packages/django/views/defaults.py",
line 88, in server_error
t = loader.get_template(template_name) # You need to create a
500.html template.
  File "/usr/lib/python2.5/site-packages/django/template/loader.py",
line 79, in get_template
source, origin = find_template_source(template_name)
  File "/usr/lib/python2.5/site-packages/django/template/loader.py",
line 72, in find_template_source
raise TemplateDoesNotExist, name
TemplateDoesNotExist: 500.html
[09/Jun/2007 17:21:06] "GET /admin/competitions/competition/ HTTP/1.1"
500 1126

Can anyone help me?


--~--~-~--~~~---~--~~
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: Admin Error

2007-06-09 Thread Christopher

looks like it's not when i am saving but rather trying to list the
one's I have saved.

On Jun 9, 5:26 pm, Christopher <[EMAIL PROTECTED]> wrote:
> Hi, I am using Django SVN version updated today.  I have made a model
> and done the Admin code so I can see it in the Admin section of my
> site and it all looks fine.  When I try to save something in there I
> get the following error:
>
> Django version 0.97-pre, using settings 'totalimpact.settings'
> Development server is running athttp://127.0.0.1:8000/
> Quit the server with CONTROL-C.
> [09/Jun/2007 17:21:02] "GET /admin/competitions/competition/add/ HTTP/
> 1.1" 200 3678
> [09/Jun/2007 17:21:02] "GET /admin/jsi18n/ HTTP/1.1" 200 801
> [09/Jun/2007 17:21:05] "POST /admin/competitions/competition/add/ HTTP/
> 1.1" 302 0
> Traceback (most recent call last):
>   File "/usr/lib/python2.5/site-packages/django/core/servers/
> basehttp.py", line 272, in run
> self.result = application(self.environ, self.start_response)
>   File "/usr/lib/python2.5/site-packages/django/core/servers/
> basehttp.py", line 614, in __call__
> return self.application(environ, start_response)
>   File "/usr/lib/python2.5/site-packages/django/core/handlers/
> wsgi.py", line 189, in __call__
> response = self.get_response(request)
>   File "/usr/lib/python2.5/site-packages/django/core/handlers/
> base.py", line 126, in get_response
> return callback(request, **param_dict)
>   File "/usr/lib/python2.5/site-packages/django/views/defaults.py",
> line 88, in server_error
> t = loader.get_template(template_name) # You need to create a
> 500.html template.
>   File "/usr/lib/python2.5/site-packages/django/template/loader.py",
> line 79, in get_template
> source, origin = find_template_source(template_name)
>   File "/usr/lib/python2.5/site-packages/django/template/loader.py",
> line 72, in find_template_source
> raise TemplateDoesNotExist, name
> TemplateDoesNotExist: 500.html
> [09/Jun/2007 17:21:06] "GET /admin/competitions/competition/ HTTP/1.1"
> 500 1126
>
> Can anyone help me?


--~--~-~--~~~---~--~~
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: Admin Error

2007-06-09 Thread Christopher

I got it, no worries :)

On Jun 9, 5:30 pm, Christopher <[EMAIL PROTECTED]> wrote:
> looks like it's not when i am saving but rather trying to list the
> one's I have saved.
>
> On Jun 9, 5:26 pm, Christopher <[EMAIL PROTECTED]> wrote:
>
> > Hi, I am using Django SVN version updated today.  I have made a model
> > and done the Admin code so I can see it in the Admin section of my
> > site and it all looks fine.  When I try to save something in there I
> > get the following error:
>
> > Django version 0.97-pre, using settings 'totalimpact.settings'
> > Development server is running athttp://127.0.0.1:8000/
> > Quit the server with CONTROL-C.
> > [09/Jun/2007 17:21:02] "GET /admin/competitions/competition/add/ HTTP/
> > 1.1" 200 3678
> > [09/Jun/2007 17:21:02] "GET /admin/jsi18n/ HTTP/1.1" 200 801
> > [09/Jun/2007 17:21:05] "POST /admin/competitions/competition/add/ HTTP/
> > 1.1" 302 0
> > Traceback (most recent call last):
> >   File "/usr/lib/python2.5/site-packages/django/core/servers/
> > basehttp.py", line 272, in run
> > self.result = application(self.environ, self.start_response)
> >   File "/usr/lib/python2.5/site-packages/django/core/servers/
> > basehttp.py", line 614, in __call__
> > return self.application(environ, start_response)
> >   File "/usr/lib/python2.5/site-packages/django/core/handlers/
> > wsgi.py", line 189, in __call__
> > response = self.get_response(request)
> >   File "/usr/lib/python2.5/site-packages/django/core/handlers/
> > base.py", line 126, in get_response
> > return callback(request, **param_dict)
> >   File "/usr/lib/python2.5/site-packages/django/views/defaults.py",
> > line 88, in server_error
> > t = loader.get_template(template_name) # You need to create a
> > 500.html template.
> >   File "/usr/lib/python2.5/site-packages/django/template/loader.py",
> > line 79, in get_template
> > source, origin = find_template_source(template_name)
> >   File "/usr/lib/python2.5/site-packages/django/template/loader.py",
> > line 72, in find_template_source
> > raise TemplateDoesNotExist, name
> > TemplateDoesNotExist: 500.html
> > [09/Jun/2007 17:21:06] "GET /admin/competitions/competition/ HTTP/1.1"
> > 500 1126
>
> > Can anyone help me?


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



Error Handling

2007-06-09 Thread Christopher

Is there a way that I can do something like this in Python?

try:
  # Do something
except not MyModel.DoesNotExist:
  # Handle it...

I want to handle all exception except if it's a DoesNotExist one.
Then I don't care.


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



ForeignKey

2007-06-26 Thread Christopher

Hi,

I am pretty new to both Python and Django and have a quick and
hopefully easy question.  Is it possible to create a Model with a link
back onto itself?

Check the code below which does not seem to work.

class Menu(models.Model):
  display_text = models.CharField(maxlength=50)
  url = models.URLField(verify_exists=False)
  parent_menu_item = models.ForeignKey(Menu)

I get the following error when I try to manage.py syncdb

Error: Couldn't install apps, because there were errors in one or more
models:
totalimpact.menu: name 'Menu' is not defined


Thanks

Christopher


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

2007-06-26 Thread Christopher

That was it :)

Thanks a lot


On Jun 26, 4:15 pm, Horst Gutmann <[EMAIL PROTECTED]> wrote:
> Christopher wrote:
> > Hi,
>
> > I am pretty new to both Python and Django and have a quick and
> > hopefully easy question.  Is it possible to create a Model with a link
> > back onto itself?
>
> > Check the code below which does not seem to work.
>
> > class Menu(models.Model):
> >   display_text = models.CharField(maxlength=50)
> >   url = models.URLField(verify_exists=False)
> >   parent_menu_item = models.ForeignKey(Menu)
>
> > I get the following error when I try to manage.py syncdb
>
> > Error: Couldn't install apps, because there were errors in one or more
> > models:
> > totalimpact.menu: name 'Menu' is not defined
>
> Try something like this: models.ForeignKey("self") :-)
>
> There are some examples for this available with many-to-one
> relationships [1]
>
> [1]http://www.djangoproject.com/documentation/models/m2o_recursive/
>
> - Horst


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



Multiple Edit

2007-07-20 Thread Christopher

I've been looking for a way to have a model and in the Admin be able
to edit a couple at one.  Is this even possible?  I know models that
have Foreign keys etc to each other this can be done.

I want one model, stand-alone, and edit multiple.

class Test(models.Model):
name = models.CharField(maxlength=30)
description = models.CharField(maxlength=200)

etc etc... and then have an Admin option or something for multiple
edits like the form would look something like:

name: | |  decription:
||
name: | |  decription:
||
name: | |  decription:
||
name: | |  decription:
||
name: | |  decription:
||

| save |

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



Re: Multiple Edit

2007-07-21 Thread Christopher

Can no one out there help me with this or is this just a really stupid
question?


On Jul 20, 1:44 pm, Christopher <[EMAIL PROTECTED]> wrote:
> I've been looking for a way to have a model and in the Admin be able
> to edit a couple at one.  Is this even possible?  I know models that
> have Foreign keys etc to each other this can be done.
>
> I want one model, stand-alone, and edit multiple.
>
> class Test(models.Model):
> name = models.CharField(maxlength=30)
> description = models.CharField(maxlength=200)
>
> etc etc... and then have an Admin option or something for multiple
> edits like the form would look something like:
>
> name: | |  decription:
> ||
> name: | |  decription:
> ||
> name: | |  decription:
> ||
> name: | |  decription:
> ||
> name: | |  decription:
> ||
>
> | save |
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Logout when Leaving

2008-07-07 Thread Christopher

Is there a way to automatically log a user out when leaving the
website?

At the moment when the user logs in and leaved the site and comes back
the user is still logged in.

What is the best way to overcome this?  I want the user to have to log
in each time they come to the website.

Thanks for the help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Logout when Leaving

2008-07-07 Thread Christopher

Not sure how I missed that :)

Thanks

On Jul 7, 11:22 am, rui <[EMAIL PROTECTED]> wrote:
> I think the option: SESSION_EXPIRE_AT_BROWSER_CLOSE on settings.py
> would help you.
> Give it a try.
>
> More information on this 
> here:http://www.djangoproject.com/documentation/sessions/
>
> --
> The world is just awesome. Boom De Yada!
>
> On Mon, Jul 7, 2008 at 6:17 AM, Christopher <[EMAIL PROTECTED]> wrote:
>
> > Is there a way to automatically log a user out when leaving the
> > website?
>
> > At the moment when the user logs in and leaved the site and comes back
> > the user is still logged in.
>
> > What is the best way to overcome this?  I want the user to have to log
> > in each time they come to the website.
>
> > Thanks for the help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Beginner needing help with a TemplateDoesNotExist exception, when the file does exist.

2011-06-05 Thread Christopher
OK. I have read many other accounts of this happening, and they were
always solved when the question asker correctly modified their
TEMPLATE_DIRS setting. None of these suggestions have worked for me.
The strange thing is that the template loads when using the Django web
server, but errors out when using mod_wsgi. I think django is maybe
throwing an incorrect exception, because the TemplateDoesNotExist
error simply can not apply given my settings.

My code:

my app/views/view.py (yes, i have my views in a subfolder)

  8 def index(request):
  9 return render_to_response('pages/home/base_home.html')

Here is my settings.py located at root (standard location)

106 TEMPLATE_DIRS = (
107 # Put strings here, like "/home/html/django_templates" or "C:/
www/django/templates".
108 # Always use forward slashes, even on Windows.
109 # Don't forget to use absolute paths, not relative paths.
110 "/home/foobar/templates",
111 )

And finally, here is my view located at /home/foobar/templates/pages/
home/

  1 {% extends 'base.html' %}
  2
  3 {% block navigation %}
  4 {% include 'modules/navigation/navigation.html' %}
  5 {% endblock %}
  6
  7 {% block slideshow %}
  8 {% include 'modules/slideshow/slideshow.html' %}
  9 {% endblock %}

Also, here is an ls -l proving that the file does exist

foo@bar:~$ ls -l templates/pages/home/
total 12
-rwxr-xr-x 1 foo foo 205 2011-06-05 12:37 base_home.html
foo@bar:~$

Here is the postmortem report that Django gives me:

Template-loader postmortem

Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
/home/foobar/templates/pages/home/base_home.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/usr/local/lib/python2.6/dist-packages/django/contrib/admin/templates/
pages/home/base_home.html (File does not exist)

Thank you for any insight, as I am baffled and stuck!

-- 
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: Beginner needing help with a TemplateDoesNotExist exception, when the file does exist.

2011-06-05 Thread Christopher
>From what I understand, the location of my templates is supposed to go
in the TEMPLATE_DIRS block of the settings.py file.  This directory is
located in my home/foobar/, thus the /home/foobar/templates.

Is there something wrong with this?

On Jun 5, 4:38 pm, Mike Dewhirst  wrote:
> On 6/06/2011 6:51am, Christopher wrote:
>
> > 110     "/home/foobar/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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Beginner needing help with a TemplateDoesNotExist exception, when the file does exist.

2011-06-05 Thread Christopher
Hi Martin

Thanks for this insight.  I saw them placing templates outside the
project directory in the tutorial, so I thought that might be a common
thing to do.  I am switching from php to python, so I'm learning a
lot.  What you say does make sense from a SCM point of view.  I am
assuming that most django'ers put their templates inside of the
project?  The thing that really bugs me is that the site works
perfectly using the django web server, but when I deploy to apache
wsgi, it gives me that exception.  I am almost thinking that it is my
apache virtual host config.  Here it is if this can help anyone shine
some light onto this issue.

  1 NameVirtualHost *
  2 
  3
  4 ServerName foo
  5 DocumentRoot /media/PENDRIVE/Projects/foo/
  6
  7 
  8 Order allow,deny
  9 Allow from all
 10 
 11
 12
 13 ErrorLog ${APACHE_LOG_DIR}/foo-error.log
 14
 15 # Possible values include: debug, info, notice, warn, error,
crit,
 16 # alert, emerg.
 17 LogLevel warn
 18
 19 CustomLog ${APACHE_LOG_DIR}/foo.log combined
 20
 21 WSGIDaemonProcess foo python-path=/media/PENDRIVE/Projects/foo
 22 WSGIProcessGroup foo
 23 WSGIScriptAlias / /media/PENDRIVE/Projects/foo/deploy/
pinax.wsgi
 24
 25 

Thanks again

Cheers!

On Jun 5, 6:58 pm, Martin  wrote:
> It's a bit weird that you have your templates in your home folder.
> I would expect them to be in your project's folder.
>
> For example: /home/foobar/projects/yourproject/templates
>
> If you were using some version control software like git you would want to
> have everything that belongs to yout project inside your project folder.
> Otherwise you would have to create several repositories (one for your apps
> and views and one for your templates) which doesn't really make sense.
>
> But in the end that is probably up to you.
>
> Best regards,
> Martin
>
> On Mon, Jun 6, 2011 at 9:47 AM, Christopher  wrote:
> > From what I understand, the location of my templates is supposed to go
> > in the TEMPLATE_DIRS block of the settings.py file.  This directory is
> > located in my home/foobar/, thus the /home/foobar/templates.
>
> > Is there something wrong with this?
>
> > On Jun 5, 4:38 pm, Mike Dewhirst  wrote:
> > > On 6/06/2011 6:51am, Christopher wrote:
>
> > > > 110     "/home/foobar/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
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

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



Re: Beginner needing help with a TemplateDoesNotExist exception, when the file does exist.

2011-06-05 Thread Christopher
Martin

Just to let you know, moving the templates directory to the root of my
project did indeed work.  I no longer get that exception.  However, I
would still like to know why django was telling me that the file does
not exist when it clearly does.  I posted my virtual host config so if
you, or anyone else is interested...

It has to be my apache config...

Cheers

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



Does using the IPython shell add "LIMIT" to Django ORM discussion (using SQLite)

2009-01-08 Thread Christopher Mutel

Hello all-

I recently filed a bug about incorrect SQL generation, and Malcom
Tredinnick said that the example SQL I provided couldn't be correct,
because there was an extra LIMIT clause that shouldn't be there. After
poking around for a bit, I realized that everytime I was executing my
query in the IPython shell, it was appending a LIMIT 21 to the SQL,
but this limit clause wasn't being appended if the query was part of a
regular python process. Both queries are run against SQLite 3.

I uploaded a small test case here that demonstrates this behaviour:

http://www.bitbucket.org/cmutel/extra_limit_21/

It is possible that I have poor python-fu, or is this known behaviour?
Is it possible that Django is truncating the result list because
IPython won't show all results anyway?

I have tried searching the Django codebase, and the mailing list, but
to no avail.

-Chris

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



Aggregation across foreign keys / complex aggregation and annotation

2009-01-16 Thread Christopher Mutel

Following the general rule that no good deed goes unpunished, I have a
question about complex aggregation / annotation or annotation across
foreign keys.

I have the following simplified model:

class Unit(models.Model):
unit = models.TextField()

class Process(models.Model):
process = models.TextField()
unit = models.ForeignKey(Unit)

class Exchange(models.Model):
input = models.ForeignKey(Process)
output = models.ForeignKey(Process)
amount = models.FloatField()

Is there a way for me to get a queryset for Process outputs which have
a sum of inputs greater than one kilogram?

You can do this (painfully) now by looping:

foo = []
for p in Process.objects.all():
if sum(Exchange.objects.filter(ouput=p,
input__unit__unit="kilogram").values_list('amount', flat=True)) > 1:
foo.append(p)

Sorry if this is a basic question, but I have been trying to figure it
out for a while, and without success.

-Chris

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



User-expandable models and admin stuff?

2009-07-27 Thread Christopher Hart

I'm interested in writing a personal database Django app that allows
users to create additional models through the admin site, running
automatic syncdb and then having a layer which allows them to create
admin forms for those models. Either that or the app would just
automatically generate really beefy admin.py's for all new models and
the user would just select how the inlines show up.

Maybe there should be a model-model then? With attributes like name,
[[fields,field-types],etc.], admin template, etc.

Has anyone had a chance to design a Django app that is self-reflective
in this way?

--~--~-~--~~~---~--~~
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 use InlineModelAdmin for ManyToMany without an Intermediary model?

2009-04-09 Thread Christopher Dodd

InlineModelAdmin needs a model that has foreign keys that define the
relationship.
Since the relationship is kept in a table that has no (explicit)
model, I'm not sure how to do this.

I've got it working in the cases where I use an Intermediary model,
but am stumped in the cases where I don't have one.

Here is the example from
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#working-with-many-to-many-intermediary-models
without the Intermediary table.

class Person(models.Model):
name = models.CharField(max_length=128)

class Group(models.Model):
name = models.CharField(max_length=128)
members = models.ManyToManyField(Person)

How would I create a TabularInline to edit the Groups on the Person
interface?

-- Christopher Dodd

--~--~-~--~~~---~--~~
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 use InlineModelAdmin for ManyToMany without an Intermediary model?

2009-04-10 Thread Christopher Dodd

I realized my question was just a bit off. What I really want is to
create a TabularInline to edit the members relationship on the Group
interface.  This is what you get when you use an intermediary model,
as well as the ability to edit the other members of that model.

I could, of course, create a bogus intermediary model and get what I
want, but it would be really unfortunate if I had to change my (valid)
Model to clean up my Admin interface.

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



custom Field for Model choice

2009-04-15 Thread Christopher Dodd

Once I populated my database with thousands and thousands of rows the
widgets available for manipulating the data on the Admin site became
virtually unusable.

So I have written a custom forms.Field that is a simple TextField that
maps to a (hopefully) unique char field on a Model. The Field
validates that the text maps to a single entry in the model, and
provides a function that can be called from the Form that will reset
the field's initial value to be the unique field (rather than the pk
id).

This has major speed and some usability advantages over the existing
widgets/fields.

It works pretty well, but I'm not so keen on the code and would
appreciate advice for cleaning it up and making it easier to use. I
especially don't like having to call fix_initial_form_value() from the
form. Are there better ways to do this?

Here is the custom Field code, followed by an example using it.

#
# A Field that acts as a TextField but must match an entry in the
given
# queryset/field.
#
class ModelChoiceTextField(forms.Field):
def __init__(self, model, unique_field_name, attrs=None, *args,
**kwargs):
kwargs['widget'] = forms.widgets.TextInput(attrs)
super(ModelChoiceTextField, self).__init__(*args, **kwargs)
self.queryset = model.objects
self.unique_field_name = unique_field_name

def clean(self, value):
if not value and not self.required:
return None
try:
return self.queryset.get(**{self.unique_field_name: value})
except self.queryset.model.DoesNotExist:
raise forms.ValidationError("Please enter a valid %s." %
(self.queryset.model._meta.verbose_name,))
except self.queryset.model.MultipleObjectsReturned:
raise forms.ValidationError("Please enter a unique %s." %
(self.queryset.model._meta.verbose_name,))

#
# Change the form's intial value for this field to it's chosen
# member of the object.
#
# This assumes the field is for a Foriegn key and the initial
value will
# be a pk.
#
def fix_initial_form_value(self, form, field_name):
if field_name in form.initial and form.initial[field_name]:
obj = self.queryset.get(**{'pk': form.initial[field_name]})
form.initial[field_name] = getattr(obj, self.unique_field_name)

Example usage:

class PackageFileForm(forms.ModelForm):

file = ModelChoiceTextField(OSFile,
unique_field_name='file_name',
attrs={'size':'60'})

def __init__(self, *args, **kwargs):
super(ArgusPackageFileForm, self).__init__(*args, **kwargs)

self.fields['file'].fix_initial_form_value(self, 'file')


I'd also like for the field to set the 'required' flag automagically
based on its field's 'blank' flag. But that may not be doable in the
Field?
Advice, comments and ideas welcome.

Thanks,
Chris Dodd
--~--~-~--~~~---~--~~
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 widget for filter_vertical and filter_horizontal slow

2009-04-16 Thread Christopher Dodd

Yeah, this is a known issue. http://code.djangoproject.com/ticket/3202
I ran into it myself and have been trying all kinds of things to work
around it.
Once you get enough rows in a table the default controls are no longer
feasible.

Have you looked into the raw_id_fields option? It wasn't an option for
me but it might help you.
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-options


On Apr 16, 3:40 am, maco  wrote:
> My model has two Foreign Keys. Each FK has 4000 entries or more. In
> admin.py I use filter_horizontal for those FK.
>
> I noticed that JS widget is slow both on first render of admin page
> (add item) and on every selection of an FK item inside the widget. I
> takes 5 seconds AFTER admin page already loads for JS to render
> widget. In this time browser is unresponsive. Selection of an item
> takes even longer.
>
> I've tested this on various browsers and systems.
>
> I'm am fairly confident that the number of FK items is a major factor
> in slowing down the render of the widget because I tried deleting FK
> items and browser was starting to show improvements in speed. When the
> number of FK items dropped under 1000 admin site become much faster
> (and actually usable).
>
> I've also completely removed filter_horizontal just to be sure nothing
> is wrong with admin on a general and all seemed good and super fast.
>
> So, I recon, some revision of JS for filter in admin is needed or sth.
>
> Thanks for any thoughts on that.
--~--~-~--~~~---~--~~
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 raw_id_field from 'id'

2009-04-16 Thread Christopher Dodd

I do something similar in 
http://groups.google.com/group/django-users/browse_thread/thread/14e580f3dd32e87d#

Do you want a comma delimited list of barcodes? Assuming the barcode
value is another field, you may be able to reuse some of my code but
override the RawIdField instead of Field.


On Apr 15, 9:19 am, Alfonso  wrote:
> Is there an easy way to change the raw_id_field in a foreign key
> relationship?  I'd like to change an inline formset to display not the
> item pk id alongside the raw_id_field 'magnifying glass' but a barcode
> field instead.
>
> 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: How to use InlineModelAdmin for ManyToMany without an Intermediary model?

2009-04-16 Thread Christopher Dodd

I can almost see how forms.models.inlineformset_factory could be
tweaked to follow ManyToMany relationships to create inline formsets,
perhaps with a parameter telling it which ManyToMany field to use.

Am I barking up the wrong tree? Are these questions better off in the
developer's group?

On Apr 10, 2:06 pm, Christopher Dodd  wrote:
> I realized my question was just a bit off. What I really want is to
> create a TabularInline to edit the members relationship on the Group
> interface.  This is what you get when you use an intermediary model,
> as well as the ability to edit the other members of that model.
>
> I could, of course, create a bogus intermediary model and get what I
> want, but it would be really unfortunate if I had to change my (valid)
> Model to clean up my Admin interface.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



manage.py createsuperuser

2009-12-14 Thread Christopher Bird
has anyone else had trouble with creating a password with the
manage.py createsuperuser

I ran the command, then asks for my email and user name,
then it when it gets the password it wont let me type anything.

All i can do is press enter, and then returns

"passwords cannot be blank"

I've got  'django.contrib.admin' and 'django.contrib.contenttypes'
installed in my apps.

Please help!

--

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

2009-12-14 Thread Christopher Bird
Russ,

Yep your right, it worked

I was expecting to see something like this:

Password:***

Thanks for your quick response

Chris




On Dec 15, 2:56 pm, Russell Keith-Magee 
wrote:
> On Tue, Dec 15, 2009 at 11:34 AM, Christopher Bird
>
>  wrote:
> > has anyone else had trouble with creating a password with the
> > manage.py createsuperuser
>
> > I ran the command, then asks for my email and user name,
> > then it when it gets the password it wont let me type anything.
>
> Define "won't let me type anything".
>
> Do you mean - "When I type, I don't see anything on the screen"?
>
> In which case, it's working exactly as intended. When you're typing a
> password, Django (and for that matter, every other command line
> utility that accepts a password under Unix) doesn't display anything
> for each key press.
>
> It's still accepting keypresses though - if you type a password and
> press enter, it should register the password you type, and then prompt
> for you to repeat your password.
>
> If that isn't what you meant, we will need some more details to work
> out what is going on.
>
> Yours,
> Russ Magee %-)

--

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.




Oracle Database Other User Tables/Views

2010-10-20 Thread Christopher Conover
Hello,

I am using Django's multiple database support to connect to an existing Oracle 
database (10g). I do not have control of the schema nor do I have any other 
privileges beyond SELECT. Further, the tables and views that I have access to 
are owned by a different user. Because of this I'm having to refer to these 
tables in queries using the other_user.table syntax. 

This issue is that Django's Oracle backend wants to quote all table names. This 
does not work for the other_user.table syntax. To get this working for the 
moment, I have patched the quote_name method on line 192 of 
django/db/backends/oracle/base.py to forego the quoting. 

Does anyone have any suggestions of how to work around this without modifying 
the Django source? 

Thanks,
Chris

-- 
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: Oracle Database Other User Tables/Views

2010-10-21 Thread Christopher Conover
The quoting trick worked well. Thank You

Chris 
 
>>> Ian  10/20/10 2:48 PM >>> 
On Oct 20, 8:20 am, "Christopher Conover" 
wrote:
> Hello,
>
> I am using Django's multiple database support to connect to an existing 
> Oracle database (10g). I do not have control of the schema nor do I have any 
> other privileges beyond SELECT. Further, the tables and views that I have 
> access to are owned by a different user. Because of this I'm having to refer 
> to these tables in queries using the other_user.table syntax.
>
> This issue is that Django's Oracle backend wants to quote all table names. 
> This does not work for the other_user.table syntax. To get this working for 
> the moment, I have patched the quote_name method on line 192 of 
> django/db/backends/oracle/base.py to forego the quoting.
>
> Does anyone have any suggestions of how to work around this without modifying 
> the Django source?

Alternate schema support is the subject of ticket #6148 in the Django
ticket tracker.  When that finally lands, it will be as simple as
setting the db_schema Meta option.

In the meantime, the recommended workaround for Oracle is to create
synonyms within the Django schema for the external tables and views,
e.g.:

CREATE SYNONYM MY_SCHEMA.SOME_TABLE FOR OTHER_SCHEMA.SOME_TABLE;

This only requires the rather innocuous CREATE SYNONYM system
privilege.  If the DBA won't even let you have that, you can fall back
on specifying the schema and table in the db_table option with the
proper interior quoting, e.g.:

db_table = 'other_schema"."some_table'

This is sufficient to trick Django into doing the right thing in most
cases.

Cheers,
Ian

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


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



TypeError: 'float' object is not iterable

2010-01-19 Thread Christopher Bird
Hi

Im trying iterating over a dictionary.
i have no problem with this but when i get to the last key:value
( value is a list) i get the following error


value= list
TypeError: 'float' object is not iterable



django code


{% for states in prices_demand.items %}


{{ states.0 }}

{{ states.1.items.2.0 }}={{ states.1.items.2.1 }}

{{ states.1.items.0.0 }}={{ states.1.items.0.1 }}

{{ states.1.items.3.0 }}={{ states.1.items.3.1 }}

{{ states.1.items.5.0 }}={{ states.1.items.5.1 }}

{{ states.1.items.7.0 }}={{ states.1.items.7.1 }}



{{ states.1.items.6.0 }}




{% for x in states.1.items.6.1 %}

{{ x }}

{% endfor %}
{% endfor %}


Am i asking django to do too much??

Regards

Chris
-- 
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: problem with session persistence

2007-07-26 Thread Christopher Flynn
Ok, now my python newbness is going to show...

I figured out what was causing it. (but I don't know why it wasn't working
before)

I can do the following:
request.session['question_list'].append(question.id)
but not:
request.session['question_list'] = request.session['question_list'].append(
question.id)

at least it seems to work now. Also, just to note, this is without setting
the session save every request or explicitly stating that the session has
been modified. I'm going to continue to play with it and if it does break
I'll report but it seems to be working well so far.
-Chris



On 7/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> What about setting session variable to None, then setting it back to a
> new list object with the questions in it, just to see if it's a
> problem with it not realizing that the list has been modified?
>
> I don't think this is the best solution either, but would be a good
> test to see if it's just not realizing that the variable has changed,
> and possibly another workaround if it works.
>
>
>
> On Jul 26, 1:09 pm, flynnguy <[EMAIL PROTECTED]> wrote:
> > Thanks for responding, I should have mentioned previously that I did
> > try putting 'SESSION_SAVE_EVERY_REQUEST=True' in my settings file but
> > that didn't work. Now that I read your e-mail, I also tried setting
> > request.session.modified = True right after my append but that didn't
> > work either.
> >
> > I meant to reply to the list a while ago to tell my work around but I
> > forgot, I guess now is as good a time as any...
> >
> > I ended up just using a string that I concatenate the new values to in
> > a comma separated list:
> > request.session['questions_asked'] += ','+str(question.id)
> > (obviously you would have to initialize it for the first question)
> >
> > Then to convert that string to an actual list I do the following:
> > for item in csv.reader([request.session['questions_asked']]):
> > question_list = item
> >
> > I tried doing just: csv.reader([request.session['questions_asked']])
> > [0] but it's not a real list and in the interpreter, I get: TypeError:
> > unsubscriptable object. So if anyone knows of a cleaner, more pythonic
> > way, I'm all ears. (Because I'm guessing it's not very pythonic)
> >
> > So that's how I'm getting around it for now, I'd love to hear anyone
> > else's thoughts on the subject.
> > -Chris
> >
> > On Jul 26, 12:23 pm, "[EMAIL PROTECTED]"
> >
> > <[EMAIL PROTECTED]> wrote:
> > > You might want to try adding:
> > > request.session.modified = True ( or modify your settings file to save
> > > every request by setting the SESSION_SAVE_EVERY_REQUEST to True )
> >
> > > Because from this note from DjangoSessiondocs:
> > > #Sessionis modified.
> > > request.session['foo'] = {}
> >
> > > # Gotcha:Sessionis NOT modified, because this alters
> > > # request.session['foo'] instead of request.session.
> > > request.session['foo']['bar'] = 'baz'
> >
> > > On Jul 9, 10:50 am, flynnguy <[EMAIL PROTECTED]> wrote:
> >
> > > > Ok, I upgraded to the development version of django and that didn't
> > > > help. I then started to try and trim out the code so it was of a
> more
> > > > manageable size to post here. It's still rather large but if it
> helps
> > > > anyone visualize what I'm talking about, here it is:
> >
> > > > ## test_indexs.html
> > > > Take the Test
> > > > 
> > > > 
> > > > {{ form }}
> > > > 
> > > > 
> > > > 
> >
> > > > ## take_tests.html
> > > > {{ questions_asked }}
> >
> > > > {% if score_page %}
> > > > {{ num }}
> > > > Your score is: {{ score|floatformat:2 }}%
> > > > ({{ num_correct }}/{{ total }})
> > > > 
> > > > {% else %}
> >
> > > > {{ question.id }} {{ question.question }}
> > > > 
> > > >  >
> > > > 
> > > > {% for answer in answers %}
> > > >  > > > value="{{ answer.1 }}" />
> > > > {% endfor %}
> > > > 
> > > > 
> > > > {% endif %}
> >
> > > > ## views.py
> > > > def sessiontest(request):
> > > > if 'questionlist' inrequest.session:
> > > > questions_asked =request.session['questionlist']
> > > > if request.method == "POST":
> > > > ifrequest.session.get('num_questions',False):  # If
> there
> > > > is a GET var called num_questions
> > > > ifrequest.session['current_question']  ['num_questions']:
> > > >request.session['current_question'] += 1
> > > > question = Question.objects.order_by('?')[0]#
> Get
> > > > a random question
> > > >request.session['previous_question'] = question
> > > > answers = list(enumerate([question.correct_answer,
> > > > question.other_answer_1, question.other_answer_2]))
> > > > shuffle(answers)
> > > > try:
> > > >request.session['questionlist'] =
> > > > questions_asked.append(int(question.id))
> > > > except AttributeError:
> > > >request.session['questionlist'] =
>

A twist on cross importing models

2008-05-07 Thread Christopher Mutel
Hello all-

I have tried a couple of tips found on the list to solve my problem
with circular model imports, but with no lucks. Here is my basic
schema:

#foo/models.py

from bar.models import Formula

class Variable(models.Model):
  amount = models.FloatField(null=True)
  is_formula = models.BooleanField(default=False)
  formula = models.OneToOneField(Formula, null=True,
related_name="variable_formula")

  def get_amount(self):
if self.is_formula:
  return self.formula.evaluate()
else:
  return self.amount

#bar/models.py

from foo.models import Variable

class Formula(models.Model):
  formula = models.TextField() # Where formula is a text string like
'var:1337*var:42', and the numbers are id numbers.

  def calculate(self):
# re stuff
for each_found_variable in groups(): # Simplified to show process
- this obviously doesn't work.
  raw_string.append(Variable.objects.get(id=this_id).get_amount())
return eval(raw_string, stuff_to_make_eval_safe)

In this case, the circular reference occurs only in a method of the
class - I don't know if this makes a difference. How can I structure
my import statements so that this is possible? I should note that
there are more than one variable, so that combining everything into
one models file is not really possible (and doesn't really address the
chicken/egg problem either).

I thought I saw a recent svn commit that addressed this problem, but
can't find it now.

Any help would be greatly appreciated?


-- 

Chris Mutel
Ökologisches Systemdesign - Ecological Systems Design
Institut f.Umweltingenieurwissenschaften - Institute for Environmental
Engineering
ETH Zürich - HIF C 42 - Schafmattstr. 6
8093 Zürich

Telefon: +41 44 633 71 45 - Fax: +41 44 633 10 61


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



Using a Custom Manager for date based generic views??

2008-07-06 Thread Christopher Clarke
Hi Guys
I'm  building a django based system for a company that monitors the  
mutuals funds industry
We have Mutual Funds Companies (Issuer) who have one or more funds  
(Fund) and every month the funds submit a volume report
Here is a simplified version

class Issuer(models.Model):
name=models.CharField(max_length=100,unique=True)
--
--
--

class Fund(models.Model):
 issuer = models.ForeignKey(Issuer)
 symbol = models.CharField(max_length=15,unique=True)
 --
 --

class FundVolumeReport(models.Model):

 fund= models.ForeignKey(Fund)
 period_ending=models.DateField()
  
units_purchased_individuals 
=models.FloatField(verbose_name="Individuals",blank=True,null=True)
  
units_purchased_institutions 
=models.FloatField(verbose_name="Instutions",blank=True,null=True)
 --
 --

Now we need to produce totals for each Issuer by month   i implemented  
a date based generic view using a model (IssuerVolumeAggregates) which  
wrapped a database view which did the aggregation i.e

CREATE OR REPLACE VIEW core_issuervolumeaggregates AS
   select
   trim(to_char(i.id,'999'))|| 
trim(to_char(vd.period_ending_id::int,''))::int as id,
   i.id as issuer_id,
   max(i.name)as name,
   m.dateix as period_ending,
   count(*) as no_funds
   --
--
  from core_fundvolumedata vd,
   core_fund f, core_issuer i, freqdates_monthly m
   where f.id=vd.fund_id and f.issuer_id=i.id
   and m.id=vd.period_ending_id
   group by i.id,vd.period_ending_id,m.dateix
   order by i.id,m.dateix;

This works pretty well but its kind a clunky so i was wondering if i  
could do the same thing with a custom manager

==
class IssuerManaager(models.Manager):

 def with_aggs(self):
 from django.db import connection
 cursor=connection.cursor()
 cursor.execute("""
 select i.id,max(i.name), m.dateix AS period_ending,
 count(*) AS no_funds,
 sum(vd.total_units_issued_outstanding) as  
total_units_issued_outstanding,
 sum(vd.total_unit_holders) as no_unit_holders,
 sum(vd.tt_total_net_assets_under_management) AS  
net_assets_under_management,
 sum(vd.tt_value_redemptions) AS total_redemptions,
 sum(vd.tt_value_sales) AS total_sales
 FROM core_fundvolumedata vd, core_fund f, core_issuer i,  
freqdates_monthly m
 WHERE f.id = vd.fund_id AND f.issuer_id = i.id AND m.id =  
vd.period_ending_id
 GROUP BY i.id, m.dateix, vd.period_ending_id
 ORDER BY i.id, m.dateix;
 """)
 results_list= []
 for each in cursor.fetchall():
 p= self.model(id=each[0],name=each[1])
 p.period_ending=each[2]
 p.no_funds = each[3]
 p.units_issued_outstanding=each[4]
 p.no_unit_holders=each[5]
 p.net_assets_under_management=each[6]
 p.redemptions=each[7]
 p.sales=each[8]
 results_list.append(p)
 return results_list

class Issuer(models.Model):
 name = models.CharField(max_length=100)
   --
   --
   --
 objects = IssuerManaager()

   The manager works but when i try to use it in the generic view

  return archive_month(
  request,
  year=year,
  month=month,
  queryset = Issuer.objects.with_aggs(),
  date_field = 'period_ending',
I get
list' object has no attribute 'model'
Am i on the right track and how do i get this to work??
Thanks for any help
Regards
Chris
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



custom manager method example return a queryset instead of a list

2008-07-07 Thread Christopher Clarke

Hi Guys
In the example 
http://www.djangoproject.com/documentation/model-api/#manager-names
there custom method with_counts() returns a list
How do i get it to return a queryset
Regards
Chris

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



ANN: Chesspark - A django based online chess community.

2006-10-19 Thread Christopher Zorn

I would like to announce a django based online game called Chesspark.

Chesspark is an online chess community.  You can chat, play games,
meet new friends, do puzzles, and many other things.  The whole
system is built upon Jabber and uses Django for its website.

Django is also used extensively in the components database layer.

In addition, we have built a web client (which also works as a normal
Jabber client).  This client allows you to play games, chat, and
pretty much anything the native client can do.  It even supports
avatars.

There is also a Windows client in case you don't like using web
applications.

You can visit Chesspark here: http://www.chesspark.com
and try the webclient here:
http://www.chesspark.com/webclient/client.xhtml

Of course, this is only the start.  There is much more to come, and
hopefully even more games than just Chess.

I hope you like it,
Christopher Zorn


--~--~-~--~~~---~--~~
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: ANN: Chesspark - A django based online chess community.

2006-10-24 Thread Christopher Zorn

orestis wrote:
> Very nice indeed! Maybe you can make a write up describing some
> design/implementation issues? I'm particularly interested in the Jabber
> integration and the cool DHTML in the web client...

This is in the works. Basically there are some jabber components that
handle different parts. There is a match component that handles
matching up users and then it hands off to an arbiter. The arbiter
creates a chat room and sends state to the users. The users can then
play a game. There are other parts that use pubsub to update each
other, etc. The components are done in python and use the django db
api. We will have a more complete description. We will also document
the protocol to encourage people to write their own clients.

The webclient uses http binding to connect to a jabber server.
http://www.xmpp.org/extensions/xep-0124.html


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django Trac Spam

2005-11-24 Thread Christopher Lenz


Am 24.11.2005 um 05:31 schrieb Jacob Kaplan-Moss:

On Nov 23, 2005, at 10:12 PM, Adrian Holovaty wrote:

On 11/23/05, Tom Tobin <[EMAIL PROTECTED]> wrote:
Someone's been spamming the Django Trac today, screwing up  
tickets and

whatnot.  Is there any way to fix and/or prevent this?
I've been deleting 'em as they come in. Maybe we can hack Trac so  
that

it silently ignores comments that include naughty words.


I've also been keeping an eye on it.  FYI, this is ticket #454 in  
Trac itself (http://projects.edgewall.com/trac/ticket/454); I'm  
about to jump in #trac and bug people about it.


I'll have some time next month to implement some extensible link spam  
prevention measures in Trac... those would hopefully make it into  
Trac 0.9.1 (although probably as an optional plugin).


Until we have a permanent solution, you may want to check out an  
emergency patch by Matt Good for the recent mass spamming (at least  
on Trac's on site):


  http://permalink.gmane.org/gmane.comp.version- 
control.subversion.trac.general/5529


The patch could probably be adapted to blacklist other domains.

However, as I said, I hope we'll have a more robust solution for 0.9.1.

Cheers,
Chris
--
Christopher Lenz
  cmlenz at gmx.de
  http://www.cmlenz.net/



Re: ANN: New document: How to serve static files

2005-11-27 Thread Christopher Lenz


Am 27.11.2005 um 15:48 schrieb Adrian Holovaty:

A commonly asked question is how to serve static files with Django.
Here's the answer, finally documented.

How to serve static files
http://www.djangoproject.com/documentation/static_files/


Can you maybe elaborate on why this approach is considered insecure?

Thanks,
Chris
--
Christopher Lenz
  cmlenz at gmx.de
  http://www.cmlenz.net/



Re: mod_python log

2005-11-27 Thread Christopher Lenz


Am 27.11.2005 um 14:53 schrieb Adrian Holovaty:

On 11/27/05, stava <[EMAIL PROTECTED]> wrote:

But what I'm really looking for is DEBUG capabilities when using
mod_python, i.e. I would like to be able to see my print statements
embedded in "if DEBUG:" and especially the db queries timings (which
are available somehow?). I do most of the debugging using the
django-admin runserver, but on occasion, it might be useful to do  
some

of it on a live site, if nothing else: when doing final verification
and testing before deployment. So, when using mod_python and  
turning on

DEBUG, where do the print statements end up?


When you use mod_python, print statements don't end up anywhere. The
best way to print out debugging statements is to either "assert False,
'hello world'" or add the debug output to the outputted page.

I've updated the mod_python docs page to reflect this.


Actually, AFAIK, you can do:

  print >> sys.stderr, "Hello"

to get messages into the Apache error log.
I.e. print to stderr instead of stdout.

Cheers,
Chris
--
Christopher Lenz
  cmlenz at gmx.de
  http://www.cmlenz.net/



Re: mod_python log

2005-11-28 Thread Christopher Lenz


Am 27.11.2005 um 22:06 schrieb stava:
Well, thanks for the input, couldn't get it to work though. I put a  
few

"print >> sys.stderr..." in there, shows up as per usual when running
the django server, but they don't show up anywhere in the apache logs.
Maybe there's some httpd.conf dependency, I'm running SuSE 9.3 with
minimal tweaks.


You need to explicitly flush the output as it's being buffered:

  print >> sys.stderr, "Hey"
  sys.stderr.flush()

Cheers,
Chris

--
Christopher Lenz
  cmlenz at gmx.de
  http://www.cmlenz.net/




Re: Update Trac?

2006-02-19 Thread Christopher Lenz

Am 19.02.2006 um 07:31 schrieb Greg:
> Would it make sense to upgrade the version of Trac that
> http://code.djangoproject.com is running?

Very much sense, considering that the Trac version deployed on  
djangoproject.com contains a number of security issues that have  
since been fixed.

If any help is needed, please let me know... would be glad to help out.

Cheers,
Chris (Trac developer and new Django user)
--
Christopher Lenz
   cmlenz at gmx.de
   http://www.cmlenz.net/


--~--~-~--~~~---~--~~
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: URLField Limit 200 maxlenght

2006-03-07 Thread Christopher Lenz

Am 07.03.2006 um 08:17 schrieb favo:
> URLField is limit to 200 maxlenght, and not expose a agrument to
> change, hope that fix in next version of Django.

You should file a ticket for this:

   <http://code.djangoproject.com/newticket>

Cheers,
Chris
--
Christopher Lenz
   cmlenz at gmx.de
   http://www.cmlenz.net/


--~--~-~--~~~---~--~~
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: Arbitrage bot

2023-03-13 Thread Christopher Lucero
Why create your own crypto bot when there is a crypto arbitrage team cat 
 who pay a percentage of the investment and protect 
your assets, that is, you are guaranteed to receive your money with 
interest.

воскресенье, 21 июня 2020 г. в 23:17:16 UTC+2, turing machine go brrr: 

> see https://github.com/rosshochwert/arbitrage/blob/master/README.md
>
> On Sun, Jun 21, 2020, 2:33 PM Wai Xian Wu wu  wrote:
>
>> Good afternoon, I was looking at the code, where did you get information 
>> from? I was searched on the internet and there is not much and those who 
>> know do not share
>>
>> El El dom, 21 de jun. de 2020 a la(s) 12:15 p. m., nerdfiles <
>> nerd...@gmail.com> escribió:
>>
>>> sure, i tried one 
>>> https://github.com/nerdfiles/arby/blob/master/analyzer/arby.py
>>>
>>> On Saturday, June 20, 2020 at 2:23:44 PM UTC-5 grim...@gmail.com wrote:
>>>
 Hi guys, someone here has programmed a cryptocurrency arbitrage bot???
>>>
>>> -- 
>>> 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 view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/57951a8b-5dc0-4053-8e61-300e1c98a205n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAK6tqkfpFzvedL4XFxMM0vr2OHPOqLENPzLOjdKSaAQUr4-32w%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/288e75fc-dee7-42d0-98c4-e36cbe853600n%40googlegroups.com.


Re: New to Django, need help starting

2012-06-21 Thread Christopher Downard
It's useful to use virtualenv despite a slight learning curve. I didn't do
that at first and now I'm going back and using virtualenv now because I've
learned that the version of Django does matter depending on what you want
to do and it's easier to be able to isolate versions.

i.e. Django1.4 doesn't play nicely with Django-CMS.

On Wed, Jun 20, 2012 at 9:07 AM, Kurtis Mullins wrote:

> Try "easy_install django" or "pip install django".
>
> Really, though -- I recommend going with a combination of Mac Brew (or
> ports or whatever third-party distribution) to install Python and pip then
> install virtualenv and virtualenvwrapper to create a virtual environment,
> then inside of the virtual environment, install Django and your
> MySQL-Python (or whatever database driver you need)
>
> It *sounds* like a lot of work but it will make things considerably easier
> for you in the long run.
>
> If not, just download django (from git) and then run its setup.py and you
> should be all good to go with runserver and sqlite
>
>
> On Wed, Jun 20, 2012 at 9:19 AM, Harjot Mann wrote:
>
>> do one thing open ur terminal and run the following command
>> python
>> then u will get
>> Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
>> [GCC 4.5.2] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> then type
>> >>> import  django
>> >>> print django.get_version()
>> if you have version 1.4 then it will print 1.4
>> It is just a verification that ur django is installed or not.
>>
>>
>> On Wed, Jun 20, 2012 at 5:23 PM, Diego pascual lopez 
>> wrote:
>>
>>>
>>>
>>> On Wed, Jun 20, 2012 at 1:49 PM, kenneth gonsalves <
>>> law...@thenilgiris.com> wrote:
>>>
>>>> On Wed, 2012-06-20 at 13:15 +0200, Diego pascual lopez wrote:
>>>> > > try typing /path_to_django/bin/django-admin.py startproject
>>>> > >
>>>> >
>>>> > If you don't know the path of the django-admin.py, you can type
>>>> >
>>>> > #which django-admin.py
>>>>
>>>> it will say 'no django-admin.py'
>>>>
>>>
>>> Yes, you have reason.
>>>
>>> Sorry.
>>>
>>> --
>>>> regards
>>>> Kenneth Gonsalves
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To post to this group, send email to django-users@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> django-users+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/django-users?hl=en.
>>>>
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> 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.
>



-- 

Christopher Downard

**

*Software Engineer*

Blue Sun Technologies

E-Mail: ch...@bluesuntechnologies.com

Mobile: 720-434-9792

www.bluesuntechnologies.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: Static website generator.

2012-07-19 Thread Christopher Hinds
Is this the sort of thing you're looking for?
http://datadesk.latimes.com/posts/2012/03/introducing-django-bakery/


-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of fernando iocca
Sent: 19 July 2012 18:56
To: django-users@googlegroups.com
Subject: Static website generator.

Hi all! I'm learning python-django and I really like. Can anyone recommend a 
"static website generator" for use with python-django?

Greetings and thank you very much from now.

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

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



Re: Newbie question about accesing my development Django instance from other computers in my LAN

2012-07-27 Thread Christopher Downard
Try python manage.py runserver 192.168.1.116 where that address is your
computer's address.
On Jul 27, 2012 7:15 AM, "Miguel Lavalle"  wrote:

> Hi,
>
> I am new to Django. I am developing my first app on a Windows 7 laptop. I
> want other people to be able to connect to this app. As indicated in the
> documentation, I start the server with:
>
> python manage.py runserver 0.0.0.0:8000
>
> And then I try to access my app from another laptop pointing the browser
> to:
>
> 192.168.1.116:8000/myapp/
>
> Where 192.168.1.116 is the ip address of the laptop where my app resides
>
> 1) Am I using the correct URL?
> 2) Is there anything in Windows 7 that I have to change for other laptops
> to be able to access my app?
>
> 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/-/oGLm8GM7-e8J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Newbie question about accesing my development Django instance from other computers in my LAN

2012-07-27 Thread Christopher Downard
Assuming both laptops are connected to the same local network (192.168.1.*)
then it should be able to access the server.

Are you getting a page not found or are you getting an error with the URLs?

My server starts up just fine with python manage.py runserver
192.168.1.149:8020 (my lan's info).

If you're getting page not found I'd guess it's something related to your
network (try ipconfig/all on both computers to make sure). If you're
getting a urls error then you can post your URLs file to dpaste or the
like.

On Fri, Jul 27, 2012 at 10:35 AM, Miguel Lavalle wrote:

> Thanks. It didn't work, though. In the development laptop I started the
> server with python manage.py runserver  
> 192.168.1.116:8000<http://192.168.1.116:8000/myapp/>
>
>
> In the laptop where I am trying to access the app, I typed in the
> browser:  192.168.1.116:8000 <http://192.168.1.116:8000/myapp/>/page/
> where page is what I am trying to access
>
> Regards
>
> Miguel
>
>
> On Friday, July 27, 2012 8:29:07 AM UTC-5, Christopher Downard wrote:
>>
>> Try python manage.py runserver 192.168.1.116 where that address is your
>> computer's address.
>> On Jul 27, 2012 7:15 AM, "Miguel Lavalle"  wrote:
>>
>>> Hi,
>>>
>>> I am new to Django. I am developing my first app on a Windows 7 laptop.
>>> I want other people to be able to connect to this app. As indicated in the
>>> documentation, I start the server with:
>>>
>>> python manage.py runserver 0.0.0.0:8000
>>>
>>> And then I try to access my app from another laptop pointing the browser
>>> to:
>>>
>>> 192.168.1.116:8000/myapp/
>>>
>>> Where 192.168.1.116 is the ip address of the laptop where my app resides
>>>
>>> 1) Am I using the correct URL?
>>> 2) Is there anything in Windows 7 that I have to change for other
>>> laptops to be able to access my app?
>>>
>>> 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/-/oGLm8GM7-**e8J<https://groups.google.com/d/msg/django-users/-/oGLm8GM7-e8J>
>>> .
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users+unsubscribe@*
>>> *googlegroups.com .
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en>
>>> .
>>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/64QQ-6lO7fQJ.
>
> 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.
>



-- 

Christopher Downard

**

*Software Engineer*

Blue Sun Technologies

E-Mail: ch...@bluesuntechnologies.com

Mobile: 720-434-9792

www.bluesuntechnologies.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: Step up to the plate

2012-09-07 Thread Christopher Downard
Alex,

I'd love to get involved.

christopherdown...@gmail.com or ch...@bluesuntechnologies.com

-Christopher Downard

On Thu, Sep 6, 2012 at 4:32 PM, Steven Elliott
wrote:

> Hi alex
>
> I'm down as well email me at srichardelliot...@gmail.com
> On Sep 6, 2012 6:28 PM, "andrea mucci"  wrote:
>
>> Hi Alex
>>
>> if you need some help contact me to and.mu...@gmail.com
>>
>> have a nice day
>> El 07/09/2012, a las 00:18, Alex Glaros  escribió:
>>
>> *Dear Django Group,
>>
>> Can you spare a few lines of code?
>>
>> Our nonprofit has a great idea to help the unemployed and spur innovation
>> at the same time.
>>
>> All we need is a simple app to let users register.
>>
>> Can I get a community effort from this great Django community to write
>> the registration app?
>>
>> I’ll can do the data modeling, just a few tables, you only need to write
>> the CRUD for it.  Easy Peasy
>>
>> It would be great to get a few volunteers to help innovation and the
>> unemployed.
>>
>> App will be open source.  Detailed info below.
>>
>> Thanks!
>>
>> Alex
>>
>>
>> --
>>
>> EMPLOYMENT AND INNOVATION PROGRAM
>>
>> The nonprofit Center for Government Interoperability (CFGIO) is seeking
>> programming assistance for an employment and innovation program.*
>>
>> *BACKGROUND
>>
>> 1. There are thousands of startup ideas that cannot be implemented due to
>> software developer costs
>> 2. There are millions of unemployed, many of whom could learn programming
>> from free sources
>>
>> BASIC CONCEPT - Employment Program managed by CFGIO
>>
>> 1. Unemployed novice programmers learn from free sources and start
>> writing beginner apps in one year, and write moderately well after 2 years.
>> College students majoring in computer science/MIS would be ready
>> immediately.
>> 2. Unemployed novice programmers offer services to startups with simple
>> app or web-design requirements.
>> 3. CFGIO sets up centralized database to match learning programmers with
>> startups, and creates processes to help them work effectively together.
>> 4. Startups offer equity or delayed transaction-based payments to
>> learning programmers.
>> 5. For startups, the purpose is to give them an affordable prototype that
>> allows investors to evaluate and fund production version of their idea. For
>> students, it gives them real-world learning experience and qualifies them
>> to apply for entry-level programming positions, or to start their own
>> startup.
>>
>> BENEFITS
>>
>> 1. Backlog of programmer positions that need filling is addressed
>> 2. Unemployed become employable with high-paying future-proof skills.
>> They also learn project management and SDLC.
>> 3. Startup ideas are enabled
>> 4. Nationwide innovation is expanded
>>
>> IMPLEMENTATION – Request assistance from crowdsourced volunteers to:
>>
>> 1. Design curriculum – basically identify Youtube and other free training
>> materials (which now days are great) for each programming language
>> 2. Mentor students
>> 3. Create environment where students learn from each other
>> 4. Design certification process
>> 5. Design processes to enhance programmer/startup collaboration
>>
>> RESOURCES
>>
>> 1. Programming environments are cheap or free:
>> https://developers.google.com/appengine/docs/billing and
>> https://openshift.redhat.com/app/
>> 2. Programming forums already provide assistance to newbies
>>
>> Any ideas or comments would be greatly appreciated,
>>
>> Alex Glaros
>> Center for Government Interoperability
>> www.gov-ideas.com
>> Contact: http://gov-ideas.com/contact.htm*
>>
>> --
>> 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/-/TSMxZ0ZKlnoJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to dja

HTTP_Authorization Striped

2012-09-21 Thread Christopher Hartfield
I am using Tastypie and I am trying to use their ApiKey Authentication 
method.  When send a curl post to my api the HTTP_Authorization header is 
sent correctly, however when I look at the request.META dictionary I notice 
that the HTTP_Authorization has been stripped.

I am using uWSGI and Nagios for this, not mod_wsgi (which I know has this 
problem)

Any ideas why?

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



content_type in Client() post doesn't correctly encode

2012-10-13 Thread Christopher Hartfield
I think I may have a bug in the client test class in the post method. 
 Normally you can call:
url_data = {'something': 'something'}
response = c.post(ip, url_data, content_type='application/xml')

When I do this I get a 401 response and this data:
Content-Type: text/html; charset=utf-8

That's it. I don't get any actual data. If I remove the content_type 
argument the problem goes away (but I have the default content type which I 
don't want

I have come across this problem because I am testing an api and it requires 
the content-type to be application/xml.

How do I specify content_type correctly in Django's testing client with 
post data?  



-- 
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/-/iCT4nxbil_QJ.
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: Most widely used documentation source for Django Projects?

2012-10-13 Thread Christopher Hartfield
I would say read the docs looks the best visually.  Tastypie uses it and 
has really pretty documentation with read the docs.

On Saturday, October 13, 2012 8:54:35 PM UTC-7, Surgemcgee wrote:
>
> Hey Gang, is there a standard documentation page for new/existing 
> Django projects? 
> I was going to use https://read-the-docs.readthedocs.org/en but it 
> will not let me create an account (500 whale). It seems to be common 
> in the projects 
> I've used. Any suggestions? 
>
>
>
> -- 
> Bust0ut, Surgemcgee: Systems Engineer --- 
> surgemcgee.com 
> BudTVNetwork.com 
> RadioWeedShow.com 
> "Bringing entertainment to Unix" 
>

-- 
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/-/73lth-fhKf0J.
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: Regarding the sub domains

2012-10-13 Thread Christopher Hartfield
You would have to yes first configure your name servers and allow your 
website example.com to resolve each of those subdomains.  So hopefully your 
number of users won't be too high :(  If your allowed you might find it 
easier to do example.com/moris/, but I would assume you can't do that.

Setting up multiple databases isn't too hard and you can use RAW SQL to 
help you with it. 

Django can handle subdomains with certain plugins 
like: http://django-subdomains.readthedocs.org/en/latest/index.html
But you still have to configure the name servers.  

So your goal would be to sign up a new user and then make a database for 
the user, add the tables and insert into the tables

Django supports multiple databases (but I'm not sure you can use Django to 
create a new db on the fly):
https://docs.djangoproject.com/en/dev/topics/db/multi-db/

Hopefully this gets you started

On Saturday, October 13, 2012 4:25:36 AM UTC-7, Monty0nWeb wrote:
>
> Hi, 
>
> We have multiple users and each user needs to have a subdomain along with 
> a separate database for each one of them, 
>
> Like *moris.example.com*  .  to have a database by name moris or 
> something like that,
> and so on for different customers.
>
> Having multiple databases is necessary because of policy they have. 
>
> What is the best approach to do this, i just saw many discussions on 
> stackoverflow, where they said having such a set up is not advisable. But 
> here i cant really go with it. 
>
> What is the best way to go about this? Please advice. 
>
>
>
> 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/-/GsNLRKmZjnoJ.
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.



File Storage help

2012-10-19 Thread Christopher Meng
Hi all,

I want to know who has an example for  file sharing service written in 
Django...

Recently I have to write a file sharing project for students sharing their 
files in order to improve the usability and experience...

So can anyone help me?

-- 
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/-/TWs_0yLc_wUJ.
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: Request for comments on a new Open Source Paas platform for Django

2013-03-02 Thread Christopher Glass
Hi Patrick,

Great to hear you're interested in writing a Django charm for juju! I have 
toyed around with the idea, but never got around to implementing something 
good.
I started looking at the current Django charm a little while ago, and while 
it works to some extend I think we could make really great things happen 
with a little work.

As far as feedback for your point goes, here are a few points and 
suggestion I'd like to add to the discussion:

- Most of the Django websites will likely live in private git/bzr/whatever 
repositories, and so in the workflow you outlined, you need to somehow push 
the *private identifier* to the running juju instance. In the "standard" 
scenario that means pushing your private ssh key to the instance, so it can 
git clone from a private repository on github... I think it's safe to say 
that most people will at least frown at the idea :)
Maybe we should instead make this a "push" process?

- It seems a little strange to me to run gunicorn on another machine. Most 
of the Django project I have encountered run Django with gunicorn on the 
webservers themselves (add gunicorn to INSTALLED_APPS and then "manage.py 
run_gunicorn"). Perhaps we should be a little more opinionated about things 
and for the sake of scaling simplicity deploy nginx or apache locally too 
(wither with a charm subordinate or at install), so that we can 
load-balance to all of the servers easily with any frontend (that means all 
webservers would serve static files, which might not be optimal, but we can 
refine that later).

- We should absolutely define a cache relation (redis or memcached).

Theses points would make the whole workflow look like the following (the 
juju syntax might be a little wrong, but please bear with me :) )

  juju bootstrap

  juju deploy --config my_django_conf.yaml cs:django_server my_django_site
  juju deploy cs:postgresql # or mysql,mongodb, etc
  juju deploy cs:memcached # or redis if that's still popular
  juju deploy cs:haproxy

  juju add-relation my_django_site postgresql
  juju add-relation my_django_site memcached
  juju add-relation my_django_site haproxy # strictly speaking that's 
optional if you have only one django machine

  juju expose haproxy

  # when needed (I hope we all need it someday!)
  juju add-unit my_django_site
  juju add-unit memcached
  juju add-unit postgresql

So now we would have a running django server with no code.
But if it's a push process, we can implement many of the config changes as 
git hooks, which makes the workflow continue with:

  cd my-django-site
  git init . # If that's not done already of course
  git add .
  git commit -m "produciton push yay!"
  git remote add production 
git+ssh://my_django_site/some_configurable_url.git
  git push production master # or of course whatever branch you put in the 
config.yaml

Of course, that requires a non-trivial amount of git triggers to be 
written, and we should put some requirements.pip.txt file and 
requirements.apt.txt or whatever in the project tree, but I think that's 
acceptable.
The whole thing basically follows what many PaaS providers already do, so I 
guess most Django developers with some sites in production probably are 
familiar with the workflow. 

This would just add the juju coolness to it :)

Hope this fuels the discussion,

- Chris

On Friday, March 1, 2013 8:13:36 PM UTC+1, Patrick wrote:
>
> Hi,
>
> I'm building a Juju based Open Source Paas platform for Django and
> I need your help because it is a hard task to make a PAAS system
> that is flexible enough to deploy any projects and at the same time
> simple to use.
>
> For the ones that don't know Juju, it's a service orchestration software
> compatible with LXC (local), EC2, HPCloud, OpenStack and Baremetal/Maas
> developed by Canonical (the company that makes Ubuntu).
>
> Check out the web site for more details: https://juju.ubuntu.com/
>
> So quickly, here's how it would works:
>
> After installing Juju and configuring it with for your favourite cloud 
> provider you
> will need to create a configuration file in the YAML format named 
> my_django_conf.yaml
> in this example::
>
>   my_django_site:
>   vcs: git
>   repos_url: https://github.com/my_username/my_site.git 
>   site_secret_key: abcdefgh123456789
>   use_virtualenv: True
>
> Then you will need these commands to bootstrap and launch all the servers::
>
>   juju bootstrap
>
>   juju deploy --config my_django_conf.yaml my_django_site
>   juju deploy postgresql # or mysql,mongodb, etc
>   juju deploy gunicorn # Or mod_wsgi, etc
>
>   juju add-relation my_django_site postgresql
>   juju add-relation my_django_site gunicorn
>
>   juju expose gunicorn # Open the tcp port in the firewall
>
> You will end up with 3 servers running. One will be the controller
> and one for each service (django and the database). 
> Gunicorn will be a special charm that will be installed on your Django 
> server.
> After that, adding a new Django node would be a

Re: Request for comments on a new Open Source Paas platform for Django

2013-03-05 Thread Christopher Glass
For what it's worth, "other PaaS solutions" solve this by letting people
call a python function from settings.py

I think it's a good solution.
On Mar 5, 2013 8:04 PM, "Bruno Girin"  wrote:

>
>
> On Tuesday, 5 March 2013 13:35:41 UTC, Dave Murphy wrote:
>>
>> On Tuesday, March 5, 2013 1:17:13 PM UTC, Michael wrote:
>>>
>>> Are there other better options that wouldn't force people to change
>>> their code to use the charm?
>>>
>>
>> For the charm to be of sufficient value, it needs to be opinionated,
>> otherwise it's going to suffer from trying to work out-of-the-box for
>> everyone.
>>
>
> True but using environment variables only moves the problem somewhere
> else: it means that you still need to auto-generate the part of the startup
> script that sets the environment variables. Besides, as said above, it
> would force django app developers to explicitly use those environment
> variables and if they forget one of misspell it, the danger is that it
> would fail silently. Then the risk is that it's hard to debug because
> you're hunting setting values in two places: the django settings and the
> startup scripts that sets the environment variables.
>
> So I'd much rather have the charm auto-generate part of the config in a
> sensible way and then tell people: if you use Juju, don't provide those
> settings in your config, the charm will do it.
>
> Bruno
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/979lJojyxs0/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, 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.
>
>
>

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




question about django tutorial

2013-04-30 Thread Christopher Spears
Hi!

I am a Django newbie, so please bear with me.  I am working on part 2 of 
the Django tutorial.

I started my server with the following:

python manage.py runserver


Then I logged into my admin site.

Earlier in the tutorial, I had created a model called Polls.  I selected 
Polls from the Site administration menu and then selected the 'What's up?' 
version of Polls to change.  However, when I clicked on the 'Save and 
Continue Editing' Button, I got this traceback:

Environment:


Request Method: POST
Request URL: http://127.0.0.1:8000/admin/polls/poll/1/

Django Version: 1.5.1
Python Version: 2.7.4
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'polls')
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 "C:\Python27\lib\site-packages\django\core\handlers\base.py" in 
get_response
  115. response = callback(request, *callback_args, 
**callback_kwargs)
File "C:\Python27\lib\site-packages\django\contrib\admin\options.py" in 
wrapper
  372. return self.admin_site.admin_view(view)(*args, 
**kwargs)
File "C:\Python27\lib\site-packages\django\utils\decorators.py" in 
_wrapped_view
  91. response = view_func(request, *args, **kwargs)
File "C:\Python27\lib\site-packages\django\views\decorators\cache.py" in 
_wrapped_view_func
  89. response = view_func(request, *args, **kwargs)
File "C:\Python27\lib\site-packages\django\contrib\admin\sites.py" in inner
  202. return view(request, *args, **kwargs)
File "C:\Python27\lib\site-packages\django\utils\decorators.py" in _wrapper
  25. return bound_func(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\utils\decorators.py" in 
_wrapped_view
  91. response = view_func(request, *args, **kwargs)
File "C:\Python27\lib\site-packages\django\utils\decorators.py" in 
bound_func
  21. return func(self, *args2, **kwargs2)
File "C:\Python27\lib\site-packages\django\db\transaction.py" in inner
  223. return func(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\contrib\admin\options.py" in 
change_view
  1108. self.log_change(request, new_object, change_message)
File "C:\Python27\lib\site-packages\django\contrib\admin\options.py" in 
log_change
  546. change_message  = message
File "C:\Python27\lib\site-packages\django\contrib\admin\models.py" in 
log_action
  19. e.save()
File "C:\Python27\lib\site-packages\django\db\models\base.py" in save
  546.force_update=force_update, 
update_fields=update_fields)
File "C:\Python27\lib\site-packages\django\db\models\base.py" in save_base
  650. result = manager._insert([self], fields=fields, 
return_id=update_pk, using=using, raw=raw)
File "C:\Python27\lib\site-packages\django\db\models\manager.py" in _insert
  215. return insert_query(self.model, objs, fields, **kwargs)
File "C:\Python27\lib\site-packages\django\db\models\query.py" in 
insert_query
  1661. return query.get_compiler(using=using).execute_sql(return_id)
File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py" in 
execute_sql
  937. cursor.execute(sql, params)
File "C:\Python27\lib\site-packages\django\db\backends\util.py" in execute
  41. return self.cursor.execute(sql, params)
File "C:\Python27\lib\site-packages\django\db\backends\sqlite3\base.py" in 
execute
  366. six.reraise(utils.DatabaseError, 
utils.DatabaseError(*tuple(e.args)), sys.exc_info()[2])
File "C:\Python27\lib\site-packages\django\db\backends\sqlite3\base.py" in 
execute
  362. return Database.Cursor.execute(self, query, params)

Exception Type: DatabaseError at /admin/polls/poll/1/
Exception Value: no such table: django_admin_log

Was I supposed to set up this table earlier in the tutorial?  When I went 
back in the tutorial, I didn't see any mention of it.  I am working on a 
Windows laptop.

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




Some basic questions from somebody learning Django/Python

2013-05-06 Thread Christopher Winter
Hi all,

   I have some (possibly dumb) questions about Django.  I've been through 
the great "Writing your first app" tutorial on the DjangoProject site, and 
now my plan is to explore in detail some existing apps from GitHub: get 
them installed, go through the code line by line, make some mods and see 
what happens, etc.  But actually getting one installed is a challenge. 
 Many are old and don't seem to work with newer Django, or they do not 
contain setup.py or any installation instructions.

   So my basic question is: how do I install an app if there is no 
setup.py?  I've googled around and tried many things (manage.py install, 
adding it to Installed Apps in settings.py, trying to modify the urls.py to 
point to the new app's urls.py file, running manage.py syncdb, etc)...but 
without much success.

   My more general question is: any suggestions on how to proceed learning 
Django?  I'm happy to read docs from the Project website, but I wanted to 
combine that with some doing, too.  Can someone suggest a good/instructive 
GitHub app to install?  I'd like to learn about Facebook integration, 
tracking user preferences, pulling information about books or movies, etc.

   Thanks in advance for any suggestions.

-c

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




define BASE_DIR?

2013-05-21 Thread Christopher Spears
I am working my way through the Django tutorial, and I have reached the 
part where I am supposed to customize the look and feel of the admin.  I am 
supposed to do that using the mysite\settings.py file (working on a Windows 
laptop).  I have two questions.

At first, I just typed the following into the file:

TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]

I got an error message stating that os.path was not recognized.  I solved 
this by putting 'import os.path' at the top of the file.  Does this mean 
there is a bug in the tutorial's documentation?  I do not recall seeing any 
instructions that told me to add this.

After I solved the first problem, I now get this error message:

  File "C:\Users\Chris\Documents\django_dev\mysite\mysite\settings.py", 
line 7,
in 
TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
NameError: name 'BASE_DIR' is not defined

Am I supposed to now define BASE_DIR?

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




custmoizing admin using template files

2013-05-22 Thread Christopher Spears
Hi!

I am working through the Django tutorial, and I have reached the part where 
I want to customize my admin.  Basically,  I want 'Chris Spears App' to 
appear at the top of the page instead of 'Django administration'.

I copied the base_site.html file from its home to 
C:\Users\Chris\Documents\django_dev\mysite\templates\admin.

I then modified the file like so:

{% extends "admin/base.html" %}
{% load i18n %}

{% block title %}{{ title }} | {% trans 'Django site admin' %}{% endblock %}

{% block branding %}
{% trans 'Chris Spears App' %}
{% endblock %}

{% block nav-global %}{% endblock %}

I then modified the settings.py file:

import os

# Django settings for mysite project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

BASE_DIR = 'C:\Users\Chris\Documents\django_dev\mysite'
#BASE_DIR = os.path.dirname(os.path.dirname(__file__))

TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]

For some reason, I can't get the change to work.  I'm pretty sure that I am 
referencing the wrong file, but I can't figure out how to print the value 
of TEMPLATE_DIRS.  Any advice?

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




DjangoCon 2011 student ticket available for $175

2011-07-24 Thread Christopher Adams
I'm a student and django user who booked to attend DjangoCon in haste,
as now my academic schedule is less flexible than I thought! They told
me I should sell it. So if you want it for $175 (orig. value $250)
just drop me a line. Many thanks.

Chris

-- 
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: select_related() / prefetch_related() and sharding

2015-05-21 Thread Ash Christopher
Hi David,

*select_related* does a JOIN under the hood, and you can't do
cross-database joins in the databases supported by Django. For
prefetch_related, there is no way out of the box to perform a
cross-database join in Python (which is what prefetch_related is doing) but
perhaps there is some way to programatically make that happen. I haven't
put any effort into exploring that idea.

Thanks,

On Thu, May 21, 2015 at 3:42 PM, David  wrote:

> Dear List,
>
> I came about conflicting information (to my mind) concerning the use of
> select_related() and prefetch_related().
> My question is whether you can combine select_related() and
> prefetch_related() with sharding techniques. If so, how are you doing it?
>
> Background:
> I was watching various videos on Django under load and Django scaling,
> generally there comes a point at which they point at database sharding.
> Ash Christopher (https://www.youtube.com/watch?v=frlsGUHYu04) points out
> that as you use multiple databases with your Application,
> select_related() and prefetch_related() can no longer be used. In
> Christophe Pettus' videos I have not found such a comment, in fact
> select_related() and prefetch_related() seem to be habitually
> recommended to speed database connections up.
>
> Thanks for your insights!
>
> David
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJdxA4uqMB_-ovXehbiUnqaX6Co6LP7LPMKAf88fb-Zb6VW_%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Possible bug introduced in Django 1.7 admin/docs?

2014-09-18 Thread Christopher Welborn
I was just playing around after upgrading from 1.6.6, I made small 
changes to my source to make it compatible. It was using the old 
WSGIHandler() style for wsgi.py, so I switched to 
get_wsgi_application(). I upgraded django-debug-toolbar, because it was 
incompatible. Everything on my site works. The admin works. Some of the 
admin/doc stuff works. However, when visiting admin/doc/filters this 
happened:



Internal Server Error: /admin/doc/filters/
Traceback (most recent call last):
  File 
"/home/cjwelborn/lib/python3.3/django/core/handlers/base.py", line 111, 
in get_response
response = wrapped_callback(request, *callback_args, 
**callback_kwargs)
  File 
"/home/cjwelborn/lib/python3.3/django/views/generic/base.py", line 69, 
in view

return self.dispatch(request, *args, **kwargs)
  File "/home/cjwelborn/lib/python3.3/django/utils/decorators.py", 
line 29, in _wrapper

return bound_func(*args, **kwargs)
  File 
"/home/cjwelborn/lib/python3.3/django/contrib/auth/decorators.py", line 
22, in _wrapped_view

return view_func(request, *args, **kwargs)
  File "/home/cjwelborn/lib/python3.3/django/utils/decorators.py", 
line 25, in bound_func

return func.__get__(self, type(self))(*args2, **kwargs2)
  File 
"/home/cjwelborn/lib/python3.3/django/contrib/admindocs/views.py", line 
43, in dispatch

return super(BaseAdminDocsView, self).dispatch(*args, **kwargs)
  File 
"/home/cjwelborn/lib/python3.3/django/views/generic/base.py", line 87, 
in dispatch

return handler(request, *args, **kwargs)
  File 
"/home/cjwelborn/lib/python3.3/django/views/generic/base.py", line 154, 
in get

context = self.get_context_data(**kwargs)
  File 
"/home/cjwelborn/lib/python3.3/django/contrib/admindocs/views.py", line 
100, in get_context_data

load_all_installed_template_libraries()
  File 
"/home/cjwelborn/lib/python3.3/django/contrib/admindocs/views.py", line 
314, in load_all_installed_template_libraries

for p in os.listdir(os.path.dirname(upath(mod.__file__)))
AttributeError: 'module' object has no attribute '__file__'


It doesn't seem to touch any of my stuff, or any of the changes I 
mentioned previously. Only Django's stuff. Any ideas?


--
\¯\  /¯/\
 \ \/¯¯\/ / / Christopher Welborn (cj)
  \__/\__/ /  cjwelborn at live·com
   \__/\__/   http://welbornprod.com

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/lvg84v%24qqt%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Re: Possible bug introduced in Django 1.7 admin/docs?

2014-09-18 Thread Christopher Welborn
On 09/18/2014 10:32 PM, I wrote:
>  Internal Server Error: /admin/doc/filters/

> "/home/cjwelborn/lib/python3.3/django/contrib/admindocs/views.py", line 
> 314, in load_all_installed_template_libraries
>  for p in os.listdir(os.path.dirname(upath(mod.__file__)))
>  AttributeError: 'module' object has no attribute '__file__'

It does it for admin/doc/tags also. Not /models, /views, or /bookmarklets.
-- 
\¯\  /¯/\
 \ \/¯¯\/ / / Christopher Welborn (cj)
  \__/\__/ /  cjwelborn at live·com
   \__/\__/   http://welbornprod.com

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/lvg92k%242vq%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Re: Possible bug introduced in Django 1.7 admin/docs?

2014-09-18 Thread Christopher Welborn
On 09/18/2014 10:50 PM, James Bennett wrote:
> Are you using any third-party libraries which were installed as eggs?
> 

It looks like I have several...

Third-party extensions:
django-extensions 1.3.3
django-solo   1.0.5

Non-extensions, but dependencies of extensions:
sqlparse0.1.11 (django-debug-toolbar dependency)
user_agents 0.2.0 (local extension dependency)
ua_parser   0.3.5 (local extension dependency)

Non-extensions, but imported:
pyscopg2  2.5.2
pytidylib 0.2.3
twython   3.1.2

I am basing this on the fact that these all have [module-name].egg-info
in my /dist-packages/ dir. I have a couple others that have no .egg-info.

-- 
\¯\  /¯/\
 \ \/¯¯\/ / / Christopher Welborn (cj)
  \__/\__/ /  cjwelborn at live·com
   \__/\__/   http://welbornprod.com

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/lvga8q%24g1c%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Re: Possible bug introduced in Django 1.7 admin/docs?

2014-09-19 Thread Christopher Welborn
On 09/18/2014 10:50 PM, James Bennett wrote:
> Are you using any third-party libraries which were installed as eggs?
> 

Sorry, but was that supposed to be a hint to say "Don't use eggs"? I can
see why it may fail looking for '__file__', but I don't understand
why that is acceptable. Surely there should be some graceful error
handling in the case that '__file__' is not available, instead of a
hard 500 internal server error.

Like if a third-party extension errors while looking for tags and
filters, the extension would be skipped instead of halting.

This is what made me think it was a bug. I don't want to file one if
it's not though, so could someone enlighten me please? I am being
sincere. Maybe I could even offer a patch for it.

-- 
\¯\  /¯/\
 \ \/¯¯\/ / / Christopher Welborn (cj)
  \__/\__/ /  cjwelborn at live·com
   \__/\__/   http://welbornprod.com

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/lvhrv9%247v8%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Re: Possible bug introduced in Django 1.7 admin/docs?

2014-09-19 Thread Christopher Welborn
On 09/19/2014 08:26 PM, Russell Keith-Magee wrote:
> So - James' comment should be interpreted as "Are you using eggs? Well,
> there's your first problem". If you're actually using eggs, I'd strongly
> encourage you to consider why, because there's almost certainly a better
> way to distribute your code, and that way won't involve the random bugs
> that eggs introduce.
> 
> Also - to clarify; existence of an .egg-info file doesn't *necessarily*
> mean you're using an egg - for historical reasons, the .egg-info file is
> used for other packaging purposes.
> 
> Yours,
> Russ Magee %-)
> 

Thank you for that response. You spelled it out perfectly. I'll look
into my libraries and installation methods to see if there is something
I can do on my end to help with my error.

-- 
\¯\  /¯/\
 \ \/¯¯\/ / / Christopher Welborn (cj)
  \__/\__/ /  cjwelborn at live·com
   \__/\__/   http://welbornprod.com

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/lviq4j%24tau%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Get a memory profile for a django site?

2013-12-10 Thread Christopher Welborn
I have a small personal site that runs on django, it's not a 
money-maker, and doesn't get a lot of traffic. I'm not so much a 
web-developer as I am an all-around programming enthusiast. I would like 
to find out how much memory a certain page or template/view is using. I 
know how much the apache process is using, and I know there are ways to 
profile python applications, I just don't know exactly where to go to 
get a nice picture and breakdown of what my django apps/pages are using.


I've tried django-profiling-dashboard, but there were a couple issues I 
had to deal with and now I don't think I'm getting an accurate picture.
What I mean is, I'm running Django 1.6 and Python 3.3, and 
profiling-dashboard had a small error with that setup. It was using the 
old django.conf.urls.default. I fixed that easily by patching it myself, 
only to find out that one of its dependencies (django-query-exchange) 
had the same error, plus more errors related to Django >= 1.5 and Python 
> 2.7. I hacked around those too, and got the dashboard running, but 
its kinda buggy (I haven't put a lot of time into it, as I wanted to ask 
some pros first). It gives me a profile that says '15Mb total', which I 
don't think is true. I think it's giving me a profile for only part of 
my site, but I wouldn't know which part. On my dev machine I have 2 
apache processes that report ~8000 with the `ps` command fresh, and 
~45000 each when I connect locally and the landing page is served.

(thats with DEBUG==True, and debug-toolbar and all)

Does anyone know how to get a memory-profile/breakdown on a Django 
1.6/Python 3.3 site? Any help would be much appreciated. All of this 
doubles as a learning experience, and none of it is critical, so any and 
all ideas are welcome. Maybe even just a link to some reading material?


--

- Christopher Welborn 
  http://welbornprod.com

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/l88uvt%2451j%241%40ger.gmane.org.
For more options, visit https://groups.google.com/groups/opt_out.


Get memory-use serverside when rendering a view?

2013-12-12 Thread Christopher Welborn

My previous post was lengthy. I just need to find out how much memory
is being used server-side when a view is rendered. I know it's possible
to do this for regular python scripts, but I'm not sure how to measure
my Django site. Django 1.6, Python 3.3, apache2, postgresql.


Any help would be much appreciated, I won't mention it again if I
don't receive an answer.

--

- Christopher Welborn 
  http://welbornprod.com

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/l8di7q%24ig8%241%40ger.gmane.org.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Get memory-use serverside when rendering a view?

2013-12-12 Thread Christopher Welborn

On 12/12/2013 06:19 PM, Jonathan Baker wrote:

Django is just Python, after all, so you can use the same approach that
you would in "regular python scripts". "when a view is rendered" is a
pretty vague description of what you're aiming to profile. If your start
point is the request coming in to Django, and your stop point is the
rendered response exiting Django, then I'd write a piece of custom
middleware. If, on the other hand, you're aiming to profile a specific
method of a view (like rendering a template), then you'll want to target
the method itself. You could do this with a decorator if you're using
FBVs, or a abstract base class if you're using CBVs. This approach is
nice because you're abstracting away the profiling code which allows you
to easily reuse it.

Hope this helps a little,
JDB




--
Jonathan D. Baker
Developer
http://jonathandbaker.com



I appreciate your response, instead of using a lot of third-party apps
I have written everything on my site from scratch to get things
exactly the way I want them. I was actually hoping for a third-party
solution for this one, but if it takes me writing my own middleware
then thats just what I'll do. It is the whole request and response I
am trying to look at, but finer grain control would be good too.

Thanks again, I'm going to study up on middleware.
--

- Christopher Welborn 
  http://welbornprod.com

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/l8dtmt%241lm%241%40ger.gmane.org.
For more options, visit https://groups.google.com/groups/opt_out.


Model Design, Nesting by Year

2014-04-23 Thread Christopher Grande
I'm in the process of designing an internal system and I'm having trouble 
designing the model so that it will function as I need it.

The basic idea is that everything is "Season" based, where a season is a 
year (2014, 2015, etc)

>From the there we have Events and the the Seasons they are functioning in, 
(Event 1 (2014, 2015, etc) , Event 2 (2014, 2015, etc))

Then there are people who may be active any given year for a specific Event:

Bob Smith, 2014, Event 1 & Event 2
  2015, Event 2
  2016, Event 1

I have created a Season & Event Models:

class EventSeason(models.Model):
season = models.IntegerField(max_length=4, primary_key=True)

class Event(models.Model):
attraction = models.CharField(max_length=30, null=True, blank=False)
seasons = models.ManyToManyField(EventSeason)

I have created the base person model and all the other fields for them 
(Address, etc) but I'm not sire how I to tie them to the seasons and events 
so that each season and event pair is maintained going forward. So for 
example I could historically lookup people from Event 1, 2014, for example. 

Hope this makes sense, thank you for any help,
Chris

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cb81298e-b056-47fe-9b3a-4f4e2e3cfe18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Syntax highlighting using vim

2014-06-27 Thread Christopher Schenk


<https://lh3.googleusercontent.com/-DffF8O-GKkI/U61Av1sa6QI/AEM/iLTf1sXawkc/s1600/Sk%C3%A6rmbillede+2014-06-27+kl.+11.54.46.png>
Hi everybody.

I have recently started to use django and I really enjoy it. However, I 
can't seem to achieve the optimal syntax highlighting using vim. I 
installed the three scripts found from the following link:

http://www.vim.org/scripts/script.php?script_id=1487

However, the resulting highlighting is not great. The image above shows the 
problem. I would like the highlighting to assign different colors to the 
variable name "user_list" and the brackets "{%" and "%}". Ideal, the syntax 
highlighting when editing templates should be as found in this link from 
the djangoproject tutorial:

https://docs.djangoproject.com/en/1.6/intro/tutorial03/

I have researched and I have not found a solution. Any help would be 
appreciated.

Best regards,

Christopher


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/51b4a13b-e25d-41bc-a355-9816776ed37f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django URL pattern for an unusual address

2018-01-07 Thread christopher okoro
Which regular expression do I write in my URLs to give me this 
'host:8000/?page=1' in my browser address

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b8527e36-d43c-4af8-848c-794cc27757dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Channels also works when I have no Worker running.

2018-04-17 Thread Christopher Wittlinger
I am using Django Channels already quite a while (v2) and I just noticed 
that when I disable all my workers, that the consumers still work.

I am using the channels_redis.core.RedisChannelLayer and my Routing looks 
like that:
application = ProtocolTypeRouter({
"websocket": URLRouter([
url("^ws/chat/$", chat_consumers.ChatConsumer),
url("^ws/notifications/$", 
notifications_consumers.NotificationConsumer)
])
})

Any ideas in this regard?

BR,

Christopher

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7bf03af7-a192-48d6-9c19-369e3b88781e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Channels also works when I have no Worker running.

2018-04-17 Thread Christopher Wittlinger
When I am logging from within the consumers it is logged from my web 
process and not the worker process.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/be2c7e27-b173-480a-a585-2f0c658f5964%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Channels also works when I have no Worker running.

2018-04-17 Thread Christopher Wittlinger
I think I misunderstood the concept of the workers. I thought that all 
Requests (HTTP and Websocket) are delegated to some sort of consumers which 
is run in a Worker.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/aed6a302-2e41-4aa6-bedf-86b842b9181b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Flakey tests and django.db.utils.InterfaceError: connection already closed

2015-10-27 Thread Christopher R.
Have you been able to fix the problem? I am encountering the same issue on 
both Django 1.8.4 and 1.8.5.

Any help would be appreciated.

On Thursday, October 8, 2015 at 3:38:16 PM UTC+1, thinkwell wrote:
>
> I could use some assistance in troubleshooting a psycopg2.InterfaceError 
> problem that has erratic behavior. Here is the test module 
>  suite that I'm running to test these models 
> , and in this state all the tests in the 
> module pass. However, it's extremely easy to trigger a 
> psycopg2.InterfaceError, although not relating to the lines changed. For 
> example, if I change:
>
> class TestSilly(SimpleTestCase): 
>   
> def test_is_not_false(self): 
> self.assertTrue(False is not True)
>
>
> to 
>
> class TestSilly(TestCase): 
>   
> def test_is_not_false(self): 
> self.assertTrue(False is not True)
>
>   
>
> Then this error is raised, but referencing TestPolicyModel instead of 
> TestSilly!
>
> ==
> ERROR: test_toggle_autofix (accounts.tests.test_models.TestPolicyModel)
> --
> Traceback (most recent call last):
>   File 
> "/usr/local/lib/python3.4/dist-packages/django/db/backends/base/base.py", 
> line 137, in _cursor
> return self.create_cursor()
>   File 
> "/usr/local/lib/python3.4/dist-packages/django/db/backends/postgresql_psycopg2/base.py"
> , line 212, in create_cursor
> cursor = self.connection.cursor()
> psycopg2.InterfaceError: connection already closed
>
> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
>   File "apps/accounts/tests/test_models.py", line 174, in 
> test_toggle_autofix
> p = Policy.objects.first()
>   File 
> "/usr/local/lib/python3.4/dist-packages/django/db/models/manager.py", 
> line 127, in manager_method
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>   File "/usr/local/lib/python3.4/dist-packages/django/db/models/query.py", 
> line 490, in first
> objects = list((self if self.ordered else self.order_by('pk'))[:1])
>   File "/usr/local/lib/python3.4/dist-packages/django/db/models/query.py", 
> line 162, in __iter__
> self._fetch_all()
>   File "/usr/local/lib/python3.4/dist-packages/django/db/models/query.py", 
> line 965, in _fetch_all
> self._result_cache = list(self.iterator())
>   File "/usr/local/lib/python3.4/dist-packages/django/db/models/query.py", 
> line 238, in iterator
> results = compiler.execute_sql()
>   File 
> "/usr/local/lib/python3.4/dist-packages/django/db/models/sql/compiler.py", 
> line 838, in execute_sql
> cursor = self.connection.cursor()
>   File 
> "/usr/local/lib/python3.4/dist-packages/django/db/backends/base/base.py", 
> line 164, in cursor
> cursor = self.make_cursor(self._cursor())
>   File 
> "/usr/local/lib/python3.4/dist-packages/django/db/backends/base/base.py", 
> line 137, in _cursor
> return self.create_cursor()
>   File "/usr/local/lib/python3.4/dist-packages/django/db/utils.py", line 
> 97, in __exit__
> six.reraise(dj_exc_type, dj_exc_value, traceback)
>   File "/usr/local/lib/python3.4/dist-packages/django/utils/six.py", line 
> 658, in reraise
> raise value.with_traceback(tb)
>   File 
> "/usr/local/lib/python3.4/dist-packages/django/db/backends/base/base.py", 
> line 137, in _cursor
> return self.create_cursor()
>   File 
> "/usr/local/lib/python3.4/dist-packages/django/db/backends/postgresql_psycopg2/base.py"
> , line 212, in create_cursor
> cursor = self.connection.cursor()
> django.db.utils.InterfaceError: connection already closed
>
>
> For another example, if I change 
>
> TestPolicyModel(TestCase)
>
>
> to
>
> TestPolicyModel(SimpleTestCase)
>
>
> then, I get the following error regarding TestRedwoodModel
>
> ==
> ERROR: setUpClass (accounts.tests.test_models.TestRedwoodModel)
> --
> Traceback (most recent call last):
>   File 
> "/usr/local/lib/python3.4/dist-packages/django/db/backends/base/base.py", 
> line 137, in _cursor
> return self.create_cursor()
>   File 
> "/usr/local/lib/python3.4/dist-packages/django/db/backends/postgresql_psycopg2/base.py"
> , line 212, in create_cursor
> cursor = self.connection.cursor()
> psycopg2.InterfaceError: connection already closed
>
> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
>   File "apps/accounts/tests/test_models.py", line 195, in setUpClass
> cls.ru = RedwoodUsers.objects.first()
>   File 
> "/usr/local/lib/python3.4/dist-packages/django/db/models/manager.py", 
> line 127, in manager_method
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>   File "/usr/local/lib/python3.4/dist-packages/djang

Re: Django Courier Management System Project

2018-11-12 Thread Christopher Medlin
https://www.djangoproject.com/start/

On Mon, Nov 12, 2018 at 11:38 AM sakkhar saha 
wrote:

> Dear All,
> I am Sakkhar form Bangladesh. Now I have a project idea. And i am a single
> man. My Project is Courier Management in Djnago. Please help for the idea.
> How i start my project. And How i Design my database table.
> My Project Feature.
>
> 1. User Can Add Your Order and Track his order.
> 2. Admin Can Add Order and Order complete and pending.
> 3. Admin Approve User.
> 4. When user order confirm than user give an email notification.
> 5. And Finally when Admin deliver the order than user give an email
> notification.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cea6f464-55fb-43c8-bef6-b438212235e9%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOOJAOw3_UjOWBxtnvL-LWa2-19Ounak5qfwmXnPQ4qbw4bu6g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Question about permissions for django.git

2020-10-31 Thread Christopher Keith
Folks -

I am following the instructions from 
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/working-with-git/
 
.

However, when I try to 'git fetch' the source repo, I get 'Permission 
denied'

PS C:\Users\chris\Documents\Github>  git clone 
https://github.com/chrisxkeith/django.git
Cloning into 'django'...
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 465879 (delta 0), reused 0 (delta 0), pack-reused 465878
Receiving objects: 100% (465879/465879), 197.61 MiB | 3.93 MiB/s, done.
Resolving deltas: 100% (339992/339992), done.
Updating files: 100% (6412/6412), done.
PS C:\Users\chris\Documents\Github> cd django
PS C:\Users\chris\Documents\Github\django> git remote add upstream 
g...@github.com:django/django.git
PS C:\Users\chris\Documents\Github\django> git fetch upstream
g...@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I have tried this on Linux Mint also, and get the same error. Do I need to 
be added to some permissions list?

Thanks in advance for any help.
- Chris

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bef4b33d-e989-4c94-9278-9a9c862283ccn%40googlegroups.com.


Re: Question about permissions for django.git

2020-10-31 Thread Christopher Keith
Hey Kasper-

Many thanks! Tried your suggestion and it works.

Does this mean that my specific git configuration is such that the 'git' 
URL will not work? If so, it is possible that 
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/working-with-git/
 
could be updated to show both ways of setting up the remote?

Best regards,
Chris
On Saturday, October 31, 2020 at 10:39:44 AM UTC-7 Kasper Laudrup wrote:

> Hi Chris,
>
> On 31/10/2020 17.02, Christopher Keith wrote:
> > Folks -
> > 
> > I am following the instructions from 
> > 
> https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/working-with-git/
>  
> > .
> > 
> > However, when I try to 'git fetch' the source repo, I get 'Permission 
> > denied'
> > 
> > PS C:\Users\chris\Documents\Github>  git clone 
> > https://github.com/chrisxkeith/django.git
>
> Here you are using an https URL (https://github.com/chrisxkeith/django.git
> )
>
> > g...@github.com:django/django.git
> > PS C:\Users\chris\Documents\Github\django> git fetch upstream
> > g...@github.com: Permission denied (publickey).
> > fatal: Could not read from remote repository.
>
> Here you are using a "git" URL (g...@github.com:django/django.git).
>
> Instead of:
>
> # git remote add upstream g...@github.com:django/django.git
>
> Try:
>
> # git remote add upstream https://github.com/django/django.git
>
> Or something similar.
>
> Hope you see the difference.
>
> Kind regards,
>
> Kasper Laudrup
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3f79206c-e65c-4c03-94f6-51be34a079a2n%40googlegroups.com.


Questions about code coverage.

2020-11-09 Thread Christopher Keith
 

Folks-
I ran coverage and massaged the data a bit to get a better idea what areas 
weren’t covered. Here is a Google Sheet 

 
with the results, sorted by coverage% low-to-high.

It looks like the gis files aren't covered. Is there any way to run tests 
and coverage on this code?
The other uncovered areas look to be primarily database specific (Postgres, 
Oracle, etc.). Are these covered in an automated build somewhere (e.g., in 
the CI system)?

Thanks,

Chris

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/df2a15e1-7819-4000-affd-bc5c4c50b1a9n%40googlegroups.com.


Re: Exciting Opportunity: Join Our Django WhatsApp Bulk Messaging Project!

2024-02-20 Thread Christopher Esiso
I'm interested to join you guys.

Best regards!

On Sun, Feb 18, 2024, 18:47 SURAJ TIWARI  wrote:

> 🚀 Join Our Django WhatsApp Bulk Messaging Project!
>
> 👋 Hello everyone,
>
> Are you looking for an exciting opportunity to gain hands-on experience in
> Django development? Do you want to work on a meaningful project that
> leverages WhatsApp for bulk messaging? We're thrilled to invite you to join
> our dynamic team!
>
> 🌟 Benefits:
>
>- Get hands-on experience working on a real-world Django project.
>- Learn how to leverage WhatsApp for bulk messaging, a valuable skill
>in today's digital landscape.
>- Opportunities for hybrid work, allowing flexibility in your schedule.
>- Collaborate with experienced developers and gain valuable mentorship.
>- Access to cutting-edge tools and technologies.
>
> 💼 Opportunities Available:
>
>- Django developers
>- Frontend developers
>- UI/UX designers
>- Quality assurance testers
>
> 🤝 How to Join: Simply reply to this message expressing your interest,
> and we'll provide you with all the necessary details to get started on our
> project.
>
> Let's work together to create something amazing and gain valuable
> experience along the way! 💻✨
>
> Best regards,
>
> Suraj Tiwari
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e8a705fd-10d9-4c1a-b4ba-0a7b896dbfean%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADUkj_D0fgwRak9o3%3DOtMjs1FcpM2dxRRZew0tWGQgqWXuEWgQ%40mail.gmail.com.


So, we're trying to hire a front-end Django developer (Kansas City, Missouri)

2010-11-18 Thread Alan Christopher Thomas
I'm a Django guy in Kansas City, MO, and work at a company called
Liquid 9.

Liquid 9 has its roots as a video company, in the entertainment
industry.. music videos, etc. However, over the last year or so, the
Interactive department here (consisting of Travis, the designer, and
myself), has taken off and we've moved to Django as our primary
technology, put our projects under git, and focused on developing the
highest quality of work we can.

Liquid 9 is a small company, about 20 people, and the atmosphere is
vibrant and collaborative. There isn't much of a management level, so
everyone takes responsibility for their work and owns it. For web,
it's important to be self-motivated.

So, the skill set we're looking for right now has an emphasis on front-
end development:

- HTML/CSS/JS (preferably jQuery)
- Django templates
- Django backend code - almost required, if not at least the ability
to learn quickly... will need at the least to have had experience
coding entire websites/admin elegantly in SOME framework or language.

Currently, Travis and I take turns filling this middle role between
his design and my backend code, but we'd love to fill the niche right
in between with someone who is passionate about UI, accessibility, and
excellent markup/css/js.

This person would, however, need to be able to cross over deeper into
the programming side of things, and would need to be able to build a
Django site from start to finish, excluding design, but including
admin, at a high level of quality.

If you're in the area or willing to relocate for full-time hire,
please get in touch with me as soon as possible.

Reach me by e-mail at alan.tho...@liquid9.tv.

-- 
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: Pre-processing and preparing data in a separate thread or process?

2008-04-15 Thread Christopher Allan Webber

We developed something that did something similar here.  The import
process spawned a daemon which imported the data.  However, in our
system only one import could be done at a time (that was actually part
of the spec, not bad programming!), so spawning one daemon per import
wasn't such a bad idea.

If you need to, you could build a persistent daemon that occasionally
checked for new data to import (say, once every 30 seconds) and would
spawn a separate thread for each bit of data to be imported.

Of course, you'll have to develop a good workflow so that either your
user is notified on that page when the import is completed (possibly
through some ajax-y interface either by polling or using a Comet
system) or, the easy way out, just provide a page that provides a
status, where your user can refresh as they like.  All depends on your
situation.

Hope that helps,
Christopher Allan Webber

"Daryl Spitzer" <[EMAIL PROTECTED]> writes:

> I have a view that takes approximately 5 minutes (plus or minus 4 or
> so) to put together data (culled from other sources, such as our SCM
> and a web service that wraps our bug database) to be passed on to a
> template. Some form of caching may (mostly) solve this problem, but
> I'm worried about two things:
>
> 1) The unlucky user who is the first to go to this page after the
> cached data has expired will have a long wait.
>
> 2) What happens when other users go to other pages, or this page,
> while the view is gathering data?
>
> I don't have any experience deploying Django projects (yet) nor do I
> have any with Apache.  But from what I've read so far, I'm under the
> impression that Apache can be configured to run multiple processes,
> each with its own invocation of Django...right?  (These processes
> will, of course, be unaware of each other unless I take steps to
> synchronize them.)
>
> I think the proper solution is to have a separate process periodically
> put together the data that my view does now, and serialize (pickle) it
> or put it in the database. Then my view will just read and display the
> most-recently generated data.
>
> Do you agree?  Do you have any advice?  Should I run this separate
> process from within Django (somehow), or as a cronjob?
>
> --
> Daryl Spitzer
>
> 

--~--~-~--~~~---~--~~
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: Pre-processing and preparing data in a separate thread or process?

2008-04-15 Thread Christopher Allan Webber

"Daryl Spitzer" <[EMAIL PROTECTED]> writes:

>>  If you need to, you could build a persistent daemon that occasionally
>>  checked for new data to import (say, once every 30 seconds) and would
>>  spawn a separate thread for each bit of data to be imported.
>
> I think this is what I'll do.  I can't quickly check whether there is
> new data to import, so I think I'll have the daemon pickle the data
> into a temporary file (and when done, replace the existing file).  My
> view can then unpickle from that file.  (I'll probably have it run
> every 10 minutes or so, unless it gets a signal to start ASAP.)
>
> The daemon has to read from the Django project's database; is it
> possible (and safe) to have it use Django's ORM to do so?

We haven't had any problems yet.  I think you should be fine.

>> ...or, the easy way out, just provide a page that provides a status,
>> where your user can refresh as they like.
>
> I'll have the daemon include a datetime value in the pickled data
> which can be displayed in the page, and add a refresh button that will
> trigger the signal I describe above.
>
> Thanks Christopher.
>
> --
> Daryl
>
>
> On Tue, Apr 15, 2008 at 10:17 AM, Christopher Allan Webber
> <[EMAIL PROTECTED]> wrote:
>>
>>  We developed something that did something similar here.  The import
>>  process spawned a daemon which imported the data.  However, in our
>>  system only one import could be done at a time (that was actually part
>>  of the spec, not bad programming!), so spawning one daemon per import
>>  wasn't such a bad idea.
>>
>>  If you need to, you could build a persistent daemon that occasionally
>>  checked for new data to import (say, once every 30 seconds) and would
>>  spawn a separate thread for each bit of data to be imported.
>>
>>  Of course, you'll have to develop a good workflow so that either your
>>  user is notified on that page when the import is completed (possibly
>>  through some ajax-y interface either by polling or using a Comet
>>  system) or, the easy way out, just provide a page that provides a
>>  status, where your user can refresh as they like.  All depends on your
>>  situation.
>>
>>  Hope that helps,
>>  Christopher Allan Webber
>>
>>
>>
>>  "Daryl Spitzer" <[EMAIL PROTECTED]> writes:
>>
>>  > I have a view that takes approximately 5 minutes (plus or minus 4 or
>>  > so) to put together data (culled from other sources, such as our SCM
>>  > and a web service that wraps our bug database) to be passed on to a
>>  > template. Some form of caching may (mostly) solve this problem, but
>>  > I'm worried about two things:
>>  >
>>  > 1) The unlucky user who is the first to go to this page after the
>>  > cached data has expired will have a long wait.
>>  >
>>  > 2) What happens when other users go to other pages, or this page,
>>  > while the view is gathering data?
>>  >
>>  > I don't have any experience deploying Django projects (yet) nor do I
>>  > have any with Apache.  But from what I've read so far, I'm under the
>>  > impression that Apache can be configured to run multiple processes,
>>  > each with its own invocation of Django...right?  (These processes
>>  > will, of course, be unaware of each other unless I take steps to
>>  > synchronize them.)
>>  >
>>  > I think the proper solution is to have a separate process periodically
>>  > put together the data that my view does now, and serialize (pickle) it
>>  > or put it in the database. Then my view will just read and display the
>>  > most-recently generated data.
>>  >
>>  > Do you agree?  Do you have any advice?  Should I run this separate
>>  > process from within Django (somehow), or as a cronjob?
>>  >
>>  > --
>>  > Daryl Spitzer
>>  >
>>  >
>>
>>  >
>>
>
> 

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



Adding a custom admin view to the admin app listing

2007-09-19 Thread Christopher Allan Webber

Hello,

For a project we're working on, we need a custom view that's available
only to administrators.  It's not the traditional add/edit/delete
stuff, and the generic admin interface doesn't cut it.  That's fine, I
can write my own view.  (They need to upload a CSV file, which adds
and updates some rows in the database.)

But I want it to be listed along with the rest of the admin listing
for that app.  Like this:

++
|AppName |
++
|Model1  +add /change|
++
|Model2  +add /change|
++
|Upload CSV file | <- add this row
++

See what I mean?  Is this possible?  I can't seem to figure this one
out.

--~--~-~--~~~---~--~~
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: Adding a custom admin view to the admin app listing

2007-09-19 Thread Christopher Allan Webber

Sure, we can do this, but this doesn't provide a nice
application-level way of adding this to the admin listing.

At the company I work for, we have over 100 websites we deploy for
(and we are just starting to transition to Django).  We deploy each
application individually depending on a client's need... X client may
need a survey tool, a news tool, and so on.  We install them as they
purchase them from us.  We have a very automated way of deploying
things, and to have to add this functionality to the admin's index
template for each application every time we deploy the application is
going to become a nightmare.

I'm actually working on a ticket related to the newforms admin, though
I've only made a small amount of progress so far (this has been the
week from hell at work):
http://code.djangoproject.com/ticket/2292

And yes, it's pretty obvious from the work I've done so far that there
doesn't seem to be a nice way to do this that's built in.  I was
hoping there was some other clean workaround, but I guess that's a bit
silly.

Maybe my work on the current ticket will give me enough experience so
that I can suggest a nice, official way to get admin actions (that
aren't just adding, updating, or deleting data in a model) listed in
the admin interface.  It's definetly going to be a critical need for
our company.

olivier <[EMAIL PROTECTED]> writes:

> Hi,
>
>> But I want it to be listed along with the rest of the admin listing
>> for that app.
>
>
> I may not have understood what you have in mind, but why don't you add
> something after the line 39 of contrib/admin/templates/index.html (or
> actually your copy of it):
>
> {% for model in app.models %}
>   ... regular admin stuff
> {% endfor %}
> 
>  upload CSV file 
>
> Olivier
>
>
> 

--~--~-~--~~~---~--~~
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: How to display if a user is logged in? Do I develop a custom template tag?

2007-11-26 Thread Christopher Allan Webber

Why not use django's builtin Authentication models?  It handles most
of this for you.

from django.contrib import auth

authenticate with:
user = auth.authenticate(username=username,
 password=password)
then log the user in:
auth.login(request, user)


and presto, in your request object, you'll always have a request.user.
You can then also always put the request in your context (or even use
RequestContext).  Just add it to the context dictionary..

http://www.djangoproject.com/documentation/authentication/

Greg <[EMAIL PROTECTED]> writes:

> Hello,
> I have a website where people can login and keep track of their
> favorite products.  Whenever they login I create a session variable:
> 'request.session['member_id']'.  If this session variable is set then
> I know that a user is logged in.  In order to get this to work I have
> to send the session variable in the return statement of every view.
> Then in my template I have an if statement that either displays
> 'Login' or 'Welcome, User' depending on if
> 'request.session['member_id']' is True or False.
>
> I've created custom tags before where I bring back data from a a
> class.  However, I'm not sure how I create a custom tag to send a
> session variable.  Because the session variable is part of a request
> object, and i don't know how to have my custom tag have access to the
> 'request'.
>
> Anybody know how I can develp this so that I don't have to send my
> session variable in the return statement of every view?
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



conflicts with six.moves

2015-06-22 Thread Christopher L. Trudeau
I've been using django to interface with a couple of data source libraries,
both of which use six. There appears to be some sort of conflict problem
between six and django.utils.six which causes ImportErrors.

For example, using the Reddit library "praw":

> from six.moves.urllib.parse import parse_qs, urlparse, urlunparse

ImportError: No module named urllib.parse

or from Google-API:

>>> from apiclient.discovery import build

from six.moves import urllib

ImportError: cannot import name urllib

When looking around the web for problems with six, the common answer is to
change the order of the import so that the more recent copy is first,
obviously I can't do that if things are wrapped inside of django.  I have
tried six v1.4, 1.8 and 1.9, none of which work.

I have tried explicitly removing django.utils.six's _SixMetaPathImporter
from sys.meta_path before doing the imports and it still fails.  In
debugging I have found that anything in six that is a MovedModule will fail
to import but those things that are MovedAttribute objects still work.

I have django installed in a virtualenv.  I have tried this with Django
1.7.5 and 1.8.2 with no luck.  If I run the import commands from the python
interpreter directly they work, but if I run the same import command from
"./manage.py shell" the import fails.

In playing around I instrumented the non-django copy of six and was able to
get it to list all of its module values including those it can't import.
So on one hand the module thinks it is there, but the import hook fails.

I'm not even 100% sure this is a django problem and not a conflict with
some other library in the virtualenv, I do know that something that
"manage.py" brings into the path is causing issues.  Any help would be
greatly appreciated.  My head is sore from banging against this particular
wall.
...ct

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANk-4bi7S5GPPpZNNLGY%3DzFge4u_2cL4R7eGdK8h2pVx5gHbpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.