Re: Error: name 'include' is not defined

2023-03-22 Thread Robinson
import path, include


On Wed, Mar 22, 2023 at 4:49 PM Harouna Diallo 
wrote:

> You must Import include : from django.urls import path, include
>
> On Wed, Mar 22, 2023 at 12:53 PM Larry Stevens 
> wrote:
>
>> Hello,
>>
>> I'm brand new to Django taking an online course in Python.
>> I created a project named 'django_test' and I'm in the process of
>> creating a very simple app named 'Hello_World'.
>>
>> I'm trying to modify the urls.py file in my 'django_test' project for the
>> app 'hello_world'.
>> My code in urls.py follows:
>> from django.contrib import admin
>> from django.urls import path
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('hello_world/', include('hello_world.urls'))
>> ]
>>
>> The return error is name 'include' is not defined
>>
>> I tried to import include with the statement from django.conf.urls
>> import include
>> which also failed.
>>
>> Thank you for reading my post.
>>
>> Larry Stevens
>>
>> --
>> 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/4e2c7426-b451-4542-9629-52d4f4707a94n%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/CAO73PDopg--cbbBgX3OQuNwfp%3DyMpSf_Uzga894CXvzOAy1mAA%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/CAHs-6w6_shg-DEfGn_ASxdcXAJqFkZ3xO_YD7LTX1N-1U-CRnQ%40mail.gmail.com.


Re: Django/uWSGI/nginx under load

2021-02-20 Thread Andy Robinson
I'm unsure what you mean - do you mean "are we executing raw SQL queries 
and a Python db api, or using Django's ORM?"   If so, usually the latter 
but this is definitely not a problem of poorly written queries, we've 
profiled them.

- Andy

On Saturday, 20 February 2021 at 17:44:45 UTC jmccla...@gmail.com wrote:

> are you using django directly to run the queries or are you querying the 
> db. I had a similar problem a while back with a project and the load was 
> resolved by letting python do the work.
>
>
>
> On Sat, 20 Feb 2021 at 15:23, Andy Robinson  wrote:
>
>> Hi all,
>>
>> We're maintaining an application that is hitting scaling problems.   It 
>> helps run grass-roots sporting events all over Europe, so Saturdays can 
>> produce large and unpredictable loads, with both logged-in users and public 
>> viewers. Despite a powerful server seemingly being lightly loaded (htop 
>> suggests just 3-6 out of24 cores typically busy, and free memory 
>> available), it often "hangs" for long periods - simple requests return 
>> after 10sec, and at times we have had to restart nginx.   
>>
>> If anyone here has experience of this configuration under high loads, 
>> we'd be keen to hire an experienced expert to review and check we are not 
>> doing anything stupid with our nginx or uwsgi configuration.  
>>
>> Likewise, if you really know how to cache Django with nginx, and work 
>> around the various cookies and language settings so that logged-in pages 
>> still work but anonymous ones can be cached, we'd love to get a bit of 
>> help  
>>
>> Architecture is ubuntu 18.04, Django 3.0.12, with MariaDB and Mongo back 
>> ends used for slightly different things.
>>
>> Feel free to contact me by private email if you,
>>
>> Otherwise, if people have suggestions and questions here, I'll try to 
>> share what I can and am very grateful for any help...
>>
>> Best Regards
>>
>>
>> Andy Robinson
>>  
>>
>> -- 
>>
> 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/4fcc006e-37bb-4497-a692-45dfb99bfad1n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/4fcc006e-37bb-4497-a692-45dfb99bfad1n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
>
> -- 
> John McClain
>
> Cell: 085-1977-823
> Skype: jmcclain0129
> Email: jmccla...@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/1aa1c853-8028-4f58-8c40-bf966caa5e56n%40googlegroups.com.


Re: Django/uWSGI/nginx under load

2021-02-20 Thread Andy Robinson
Thanks for this.  27k file descriptors out of about 370k allowed.  I 
presume that means this isn't a problem?

(We run a lot of different virtual hosts on this box, each with a few 
Django processes)

- Andy
On Saturday, 20 February 2021 at 16:15:12 UTC mob...@aldian.net wrote:

> Check the number of open file descriptor when you experienced the slow 
> response.
>
> On Sat, Feb 20, 2021 at 10:23 PM Andy Robinson  
> wrote:
>
>> Hi all,
>>
>> We're maintaining an application that is hitting scaling problems.   It 
>> helps run grass-roots sporting events all over Europe, so Saturdays can 
>> produce large and unpredictable loads, with both logged-in users and public 
>> viewers. Despite a powerful server seemingly being lightly loaded (htop 
>> suggests just 3-6 out of24 cores typically busy, and free memory 
>> available), it often "hangs" for long periods - simple requests return 
>> after 10sec, and at times we have had to restart nginx.   
>>
>> If anyone here has experience of this configuration under high loads, 
>> we'd be keen to hire an experienced expert to review and check we are not 
>> doing anything stupid with our nginx or uwsgi configuration.  
>>
>> Likewise, if you really know how to cache Django with nginx, and work 
>> around the various cookies and language settings so that logged-in pages 
>> still work but anonymous ones can be cached, we'd love to get a bit of 
>> help  
>>
>> Architecture is ubuntu 18.04, Django 3.0.12, with MariaDB and Mongo back 
>> ends used for slightly different things.
>>
>> Feel free to contact me by private email if you,
>>
>> Otherwise, if people have suggestions and questions here, I'll try to 
>> share what I can and am very grateful for any help...
>>
>> Best Regards
>>
>>
>> Andy Robinson
>>  
>>
>> -- 
>> 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/4fcc006e-37bb-4497-a692-45dfb99bfad1n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/4fcc006e-37bb-4497-a692-45dfb99bfad1n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
>
> -- 
> Regards,
>
> Aldian Fazrihady
> http://aldianfazrihady.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/c2093676-90f5-4e69-b646-868102361d18n%40googlegroups.com.


Django/uWSGI/nginx under load

2021-02-20 Thread Andy Robinson
Hi all,

We're maintaining an application that is hitting scaling problems.   It 
helps run grass-roots sporting events all over Europe, so Saturdays can 
produce large and unpredictable loads, with both logged-in users and public 
viewers. Despite a powerful server seemingly being lightly loaded (htop 
suggests just 3-6 out of24 cores typically busy, and free memory 
available), it often "hangs" for long periods - simple requests return 
after 10sec, and at times we have had to restart nginx.   

If anyone here has experience of this configuration under high loads, we'd 
be keen to hire an experienced expert to review and check we are not doing 
anything stupid with our nginx or uwsgi configuration.  

Likewise, if you really know how to cache Django with nginx, and work 
around the various cookies and language settings so that logged-in pages 
still work but anonymous ones can be cached, we'd love to get a bit of 
help  

Architecture is ubuntu 18.04, Django 3.0.12, with MariaDB and Mongo back 
ends used for slightly different things.

Feel free to contact me by private email if you,

Otherwise, if people have suggestions and questions here, I'll try to share 
what I can and am very grateful for any help...

Best Regards


Andy Robinson
 

-- 
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/4fcc006e-37bb-4497-a692-45dfb99bfad1n%40googlegroups.com.


Best way to run a shell script, using input value from Django?

2019-01-02 Thread Chris Robinson

Hello, 

I'm going to attempt to generalize my question to make this easier to 
answer. 

Lets say I have a simple terminal based shell script (e.g. multiply_by_two) 
that takes a number argument, then multiplies that number by 2, and returns 
the result into a result.txt file. 

I would enter something like this:
multiply_by_two -n 6

The -n flag asks what number I would like to multiply by 2. The result of 
this would be a result.txt, containing the number 12 inside. 


What I would like to do is develop a simple Djano application that contains 
a text field allowing me to input the number 6, then click "Submit."

This job will start on the server by running my custom multiply_by_two 
application with my input parameter (6), but when the job is finished and 
the result.txt is available, the browser will automatically download the 
file. 

To make this a tad bit more complex, lets say that the job takes 2 minutes 
to run. What would be the best way to monitor the job? Maybe I accidentally 
close the window.

Not looking for anyone to solve this, I'm just new to Django and want to 
know if someone can give me any pointers on where to start. Are there any 
apps existing that will help me not need to write everything from scratch, 
especially if 'monitoring' is needed? Would Celery be ideal for this?

Thanks for any input!

Regards,
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7da4b068-ac58-4c26-a0bc-ed4925f8a4f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Best way to submit application cmd, then download a resulting file?

2019-01-02 Thread Chris Robinson
Hello, 

I'm going to attempt to generalize my question to make this easier to 
answer. 

Lets say I have a simple terminal based application (e.g. multiply_by_two) 
that takes a number argument, then multiplies that number by 2, and returns 
the result into a result.txt file. 

I would enter something like this:
multiply_by_two -n 6

The -n flag asks what number I would like to multiply by 2. The result of 
this would be a result.txt, containing the number 12 inside. 


What I would like to do is develop a simple Djano application that contains 
a text field allowing me to input the number 6, then click "Submit."

This job will start on the server by running my custom multiply_by_two 
application with my input parameter (6), but when the job is finished and 
the result.txt is available, the browser will automatically download the 
file. 

To make this a tad bit more complex, lets say that the job takes 2 minutes 
to run. What would be the best way to monitor the job? Maybe I accidentally 
close the window.

Not looking for anyone to solve this, I'm just new to Django and want to 
know if someone can give me any pointers on where to start. Are there any 
apps existing that will help me not need to write everything from scratch, 
especially if 'monitoring' is needed? Would Celery be ideal for this?

Thanks for any input!

Regards,
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6ba9ac84-366c-4c91-b068-3ecc65c27a9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django m2m_changed pk_set is empty

2017-06-10 Thread Jason Robinson
Hi everyone,

Django version 1.10.7, I have a problem where sometimes my receiving 
`m2m_changed` signal on a ManyToMany field has `pk_set` empty.

The model m2m part (note it's a `self` reference):

class Profile(TimeStampedModel):
following = models.ManyToManyField(
"self", verbose_name=_("Following"), related_name="followers"
)


Signal beginning part with logger:

@receiver(m2m_changed, sender=Profile.following.through)
def profile_following_change(sender, instance, action, pk_set, **kwargs
):
logger.debug("profile_following_change - sender %s, instance %s, 
action %s, pk_set %s, kwargs: %s",
 sender, instance, action, pk_set, kwargs)


Below an example log line with `pk_set` containing the added primary key:

DEBUG:socialhome:profile_following_change - 
sender , 
instance Profile A (profil...@a.domain.tld), 
action post_add, 
pk_set {2}, 
kwargs: {
'signal': , 
'model': , 
'using': 'default', 
'reverse': False
}

 
And an example with an empty `pk_set`.

DEBUG:socialhome:profile_following_change - 
sender , 
instance Profile B (profil...@b.domain.tld), 
action post_add, 
pk_set set(), 
kwargs: {
'model': , 
'reverse': False, 
'using': 'default', 
'signal': 
}


 
The two saves are both from the same code, using the following line. Note 
this code runs in an RQ background process, should that matter:

profile.following.add(user.profile)



Why is the `pk_set` sometimes empty, any ideas? Note that both `Profile` 
objects also exist before the RQ job is processed (event is triggered by 
doing a "follow" in the UI).

Also of note, added object *is* found in the ManyToMany field after the 
operation.

Thankful of any ideas,

Br,
Jason Robinson
https://jasonrobinson.me

-- 
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/4e409d43-f079-4031-8c1b-7b54e07bf3b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What are the active Django e-commerce frameworks right now (2014)?

2014-04-28 Thread Andy Robinson
I second the recommendation for Stripe.

I have no need for shopping carts but suffered for years dealing with 
credit card payments for license renewals.  Many solutions were running 
into problems with foreign banks blocking payments (which the payment 
solution can't do anything about), spurious rejections and so on.  I 
discovered Stripe and had it running in literally a couple of hours, and we 
have never had an issue with an incorrectly blocked payment.   
 Business-wise, the alternatives needed months of form-filling with payment 
providers, merchant accounts, PCI-DSS certificate vendors.  It is 
ridiculously easy to get up and running with Stripe and just make an HTML 
button for each product you want to sell.


On Saturday, April 26, 2014 5:44:21 PM UTC+1, Jared Nielsen wrote:
>
> Check out Stripe. Not a framework, but very easy to implement with Django. 
>
> On Saturday, April 26, 2014 4:57:51 AM UTC-6, Brutus Schraiber wrote:
>>
>> Thanks 'somecallitblues' I will definitely take a closer look at Mezzanine 
>> and Cartridge.
>>
>> But I'm kinda baffled. Only one answer after two weeks?
>>
>> Sure webshops might not be the hot topic anymore than they where a good 
>> couple of years ago, and most people just use PHP and Magento anyway, but 
>> still?
>>
>> Was my question too long? Is this the wrong place to ask such questions?
>>
>> I know I generally should use stackoverflow etc. first, but this is not 
>> the kind of question thats welcome there...
>>
>> Any chance I get some more opinions on this? Or hints where I can get 
>> such?
>>
>

-- 
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/da185c4c-5279-4b5b-92b8-2347bc9454a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ANN: ReportLab PLUS 3.1 - rapid PDF creation for Django sites

2014-04-28 Thread Andy Robinson
ReportLab are pleased to announce the release of the Python 3-compatible 
version of our PDF generation toolkit.   

After an extensive rewrite, our framework now runs under Pythons 2.7, 3.3 
and 3.4; and both the open source and commercial tools can be installed 
with pip and managed from requirements files.

We have been using Django ourselves for 8 years now, and our Django-powered 
solutions powers some of the biggest dynamic PDF generation solutions on 
the net.  See who ReportLab work with<http://www.reportlab.com/casestudies/>

Many of you will know the open source ReportLab PDF Toolkit.  ReportLab 
PLUS, which sits on top of it, lets you develop attractive documents very 
quickly directly from your Django solution.   
   - code PDF templates in a high level markup language, the same way you 
make your web templates
   - include professionally designed artwork and background pages with a 
single tag using our PageCather technology
   - create business and custom graphics with identical style in print and 
web using our Diagra charts


The ability to create personalised, publication quality PDF documents from 
a CMS in real time is a game-changer, opening new communication channels 
and allowing clients to streamline work and save on print.

ReportLab PLUS can be tried freely 
<http://www.reportlab.com/reportlabplus/>with a nag line, but needs an annual 
subscription before production use. We 
are happy to provide support, mentoring and a design-and-build service.  

Find out more... <http://www.reportlab.com/reportlabplus/>

Andy Robinson
CEO / Chief Architect
ReportLab

 

-- 
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/805adf45-f65e-45e8-bb69-e4e6ed24c360%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


FormWizard and "add to basket" problem

2011-11-16 Thread Andy Robinson
We need to code a 5-step form wizard.   The first step should let you
select products with various options, validate them, then add those
items to a basket, then proceed when you are ready.  The next few
steps are straightforward - personal details, delivery details,
payment.

The FormWizard in 1.3 makes all the later steps very easy, but we're
fighting it on step 1.  Has anyone done anything like this?

In more detail, Step 1 should have buttons on it for "add current item
to basket" (which has to validate a couple of fields with standard
error messages behaviour), "proceed to checkout", plus a 'delete'
button for each element in the basket.   The problem is that
FormWizard by default moves you to the next step when validation on
Form 1 succeeds.  Ideally I'd want to validate the new item and then
redisplay the current page, or (if they hit a Delete button) amend the
hidden variables storing the basket and redisplay the same page.

I'm looking at two options

1. Write a form-level clean() method which will proceed if the user
hit 'checkout' (i.e. if there is a key-value pair on the request
matching that button's name/value), and will fail if they hit 'add to
basket', but in the process of failing will create some extra numeric-
prefixed hidden fields to store the new basket item, then redisplay
the form.  In this case the Wizard code will not need touching.

2. Overriding the __call__ method of the 1.3 FormWizard, which
contains the following, to not always jump forward a step, but instead
maybe see if the form has a 'next_step' or 'finished' attribute.  Then
our Form for the first page could indicate that it is not ready to
move forwards yet.

if form.is_valid():
self.process_step(request, form, current_step)
next_step = current_step + 1

3. Any other ideas?

FormWizard is very nice in our case as it adds some very useful
security and validation features.  I'm hoping someone will tell me
there is an easy way around this!

Thanks,

Andy




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



Error filtering using bboverlaps

2011-01-25 Thread B. Heath Robinson
I am getting the following error when I try a complicated filter with a join
involving bboverlaps.

Join on field 'shape' not permitted. Did you misspell 'bboverlaps' for
the lookup type?


Here is the line that causes the problem.

saved_properties =
saved_properties.filter(property__parcel__shape__bboxoverlaps=mybbox)

Is this a legitimate way to use bboverlaps?

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



Fwd: PostGISAdapter error

2011-01-17 Thread Robinson B. Heath
It has been a couple of weeks without a reply.  Is there somewhere else I 
should post this or am I on my own?

Begin forwarded message:

> From: "Robinson B. Heath" <t...@edenicconfluence.com>
> Date: January 4, 2011 11:41:48 PM CST
> To: django-users@googlegroups.com
> Subject: PostGISAdapter error
> 
> I am getting the following error when the queryset tries to generate the SQL: 
> "'str' object has no attribute 'ewkb'"
> 
> Here is what I am doing that causes the problem:
>   shapes = Shape.objects.filter(geom__bboverlaps=bbx)
> shape_info = shape_info.filter(shape__in=shapes)
> 
> Models are:
>   class Shape(models.Model):
>   …
>   geom = models.PolygonField()
>   color = models.IntegerField()
> 
>   class ShapeInfo(models.Model):
>   …
>   name = models.CharField(max_length=25)
>   shape = models.ForeignKey(Shape)
> 
> The code causing the problem seems to be:
> 
> if (len(params) == 1 and params[0] == '' and lookup_type == 'exact'
> and connection.features.interprets_empty_strings_as_nulls):
> lookup_type = 'isnull'
> value_annot = True
> 
> Is this not an appropriate way to use this?
> 
> Here is the stacktrace:
> /Library/Python/2.6/site-packages/django/db/models/query.py in _result_iter
> self._fill_cache() ...
> ▶ Local vars
> /Library/Python/2.6/site-packages/django/db/models/query.py in _fill_cache
> self._result_cache.append(self._iter.next()) ...
> ▶ Local vars
> /Library/Python/2.6/site-packages/django/db/models/query.py in iterator
> for row in compiler.results_iter(): ...
> ▶ Local vars
> /Library/Python/2.6/site-packages/django/db/models/sql/compiler.py in 
> results_iter
> for rows in self.execute_sql(MULTI): ...
> ▶ Local vars
> /Library/Python/2.6/site-packages/django/db/models/sql/compiler.py in 
> execute_sql
> sql, params = self.as_sql() ...
> ▶ Local vars
> /Library/Python/2.6/site-packages/django/db/models/sql/compiler.py in as_sql
> where, w_params = self.query.where.as_sql(qn=qn, 
> connection=self.connection) ...
> ▶ Local vars
> /Library/Python/2.6/site-packages/django/db/models/sql/where.py in as_sql
> sql, params = child.as_sql(qn=qn, connection=connection) 
> ...
> ▶ Local vars
> /Library/Python/2.6/site-packages/django/db/models/sql/where.py in as_sql
> sql, params = self.make_atom(child, qn, connection) ...
> ▶ Local vars
> /Library/Python/2.6/site-packages/django/db/models/sql/where.py in make_atom
> if (len(params) == 1 and params[0] == '' and lookup_type == 'exact' 
> ...
> ▶ Local vars
> /Library/Python/2.6/site-packages/django/contrib/gis/db/backends/postgis/adapter.py
>  in __eq__
> return (self.ewkb == other.ewkb) and (self.srid == other.srid) ...
> ▼ Local vars
> Variable  Value
> other 
> ''
> self  
>  0x10663bf90>

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



PostGISAdapter error

2011-01-04 Thread Robinson B. Heath
I am getting the following error when the queryset tries to generate the SQL: 
"'str' object has no attribute 'ewkb'"

Here is what I am doing that causes the problem:
shapes = Shape.objects.filter(geom__bboverlaps=bbx)
shape_info = shape_info.filter(shape__in=shapes)

Models are:
class Shape(models.Model):
…
geom = models.PolygonField()
color = models.IntegerField()

class ShapeInfo(models.Model):
…
name = models.CharField(max_length=25)
shape = models.ForeignKey(Shape)

The code causing the problem seems to be:

if (len(params) == 1 and params[0] == '' and lookup_type == 'exact'
and connection.features.interprets_empty_strings_as_nulls):
lookup_type = 'isnull'
value_annot = True

Is this not an appropriate way to use this?

Here is the stacktrace:
/Library/Python/2.6/site-packages/django/db/models/query.py in _result_iter
self._fill_cache() ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/query.py in _fill_cache
self._result_cache.append(self._iter.next()) ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/query.py in iterator
for row in compiler.results_iter(): ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/sql/compiler.py in 
results_iter
for rows in self.execute_sql(MULTI): ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/sql/compiler.py in 
execute_sql
sql, params = self.as_sql() ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/sql/compiler.py in as_sql
where, w_params = self.query.where.as_sql(qn=qn, 
connection=self.connection) ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/sql/where.py in as_sql
sql, params = child.as_sql(qn=qn, connection=connection) ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/sql/where.py in as_sql
sql, params = self.make_atom(child, qn, connection) ...
▶ Local vars
/Library/Python/2.6/site-packages/django/db/models/sql/where.py in make_atom
if (len(params) == 1 and params[0] == '' and lookup_type == 'exact' ...
▶ Local vars
/Library/Python/2.6/site-packages/django/contrib/gis/db/backends/postgis/adapter.py
 in __eq__
return (self.ewkb == other.ewkb) and (self.srid == other.srid) ...
▼ Local vars
VariableValue
other   
''
self


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



Saving Child Records via ForeignKeyField

2010-04-29 Thread Robinson B. Heath
I believe I have done my due diligence, but point me in the right direction if 
I am missing something.

I am working on a generic importing engine to import various file formats(csv, 
fixed length, etc) into django models based on json formatted file definitions. 
 It needs to do something like the following, which I have actually tried in 
the shell.

zone_type = ZoneType()
zone_type.name = 'GrowthArea'
…
zone = Zone()
zone.type = zone_type
zone.name = 'TX-Region12'

#-save starts here
zone.save()
#-save ends here

Is this supposed to work?

I have also tried:

#-save starts here
zone_type.save()
zone.save()
#-save ends here

Both report that the foreign key field is null such as: " null value in column 
"type_id" violates not-null constraint".

This does work:

#-save starts here
zone_type.save()
zone.type = zone_type
zone.save()
#-save ends here

as does this:

#-save starts here
z.type.save()
z.type = z.type
z.save()
#-save ends here

I could do something like the last example in my code, but I'd rather not.  It 
seems like this would be simple to do inside the model save logic.  Am I 
missing something?

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



Please criticise this storage architecture...

2010-03-03 Thread Andy Robinson
I'm planning a self-service publishing/reporting system.  Django will
likely be the web framework.  I am considering a rather unusual
storage architecture, and would love to know where the pitfalls are.

Users will be companies in a small vertical space.  They want to let
their clients (effectively the public) pull certain kinds of reports.
Users will occasionally log in to 'design stuff' - controlling the
appearance of the reports - or to upload new content.  During this
period they will be working with a fairly rich object graph.The
report tools they have designed will then be available as web services
or web forms, 24x7, to let the public request content.  It ought to
scale up to multiple machines, but is not likely to be a web-scale
app.

Concrete example:  a tour operator logs in from time to time to update
hotel descriptions and destination guides, and to tweak the style of
their publications.  A member of the public can use the system to
input parameters and then get a brochure of all hotels meeting their
price/location/feature criteria.

It would be easy and natural to persist this as a few json objects (or
marshalled/pickled Python data).  It would be a huge PITA to decompose
it into an RDBMS, especially as the 'schema' is bound to evolve.
ACID is not important.

I would like an architecture which
 - is easy to work on.  A developer should be able to set up a working
copy fast, and it should be easy to set up on a new server.  The less
technologies apart from Python, the better.
 - is easy to support:  if a client is having problems, we want to
quickly be able to replicate their environment (content+code) on a
development machine
 - tracks history - maybe not everything, but makes it possible for
clients to save and undo at certain points
 - can provide redundancy later on if needed.

One solution seems absurdly simple and versatile:
 - each client gets a directory on the server(s)
 - their content (images/datasets) and configuration data live in
files under this.  Where possible we store data in line-oriented files
(Python objects saved as pretty-printed JSON or repr'd, tabular data
in delimited files).
 - When the user edits stuff in the web interface, we update a file on
the server.
 - we check everything which matters (app code and client content)
into Mercurial, Git or something similar.  Commit at midnight just in
case, and also when clients want to, or log out, or approve a set of
changes.
 - we can configure new servers through checking out
 - if we want a cluster to preserve transactional data, we could also
use rsync or unison running frequently
 - we can easily have multiple 'publishing' servers and one 'editing'
one, and control publishing/promotion
 - if we need to 'shard' and publish some clients to some servers,
that's easy.

I would still use a database for Django's auth application, but not
much else.  And if this architecture turns out to be wrong, we can
change the storage layer later.

I know that we need to take some precautions to make sure processes
don't clash trying to write files, but we're not talking about massive
concurrency.

So, why don't I hear about architectures like this?  Why would I want
to use more complex things (CouchDB, ZODB, blobs-in-RDBMS-tables)?
Has anyone built a nontrivial system this way, and what happened?

Thanks for all feedback.

Andy

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



Post-save hook after inline records saved?

2010-02-03 Thread Andy Robinson
I'm writing a bookkeeping system using Django latest code.   I would
like to make sure that when certain records are saved, changes are
made to other records.For example, when I save a Sale model in the
admin - or programmatic code - it may create (or update) a bunch of
records in the general ledger tables.  Overriding the model.save()
method worked well up to a point.

I have one model that uses inlines in a master-detail relationship.
Think of Orders, and Lines within them.  I enter an Order with 3
Lines.  Unfortunately, overriding Order.save() doesn't work, because
when the save event fires, none of the lines have been saved or hooked
up to it yet. post-save signals are no better.

(Ugly workaround in admin:  hit 'save and continue editing', then hit
'save'.  The second time I save, the order rows exist)

Can anyone suggest a strategy whereby, when an Order gets saved, I can
hook into some event AFTER the related Lines have been saved?



Thanks,

Andy




-- 
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: django_settings_module not being set by manage.py

2008-05-23 Thread David Robinson

Karen Tracey wrote:
> So what's changed, I'm guessing, to introduce this problem is you added this
> import to to your project's __init__.py file.

Karen,

Thanks - while I was trying to get my head wrapped around 
newforms-admin, I put some stuff in __init__.py and then forgot to take 
it out.  I'm back in business.

Dave




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



Re: django_settings_module not being set by manage.py

2008-05-23 Thread David Robinson

Karen Tracey wrote:
> manage.py doesn't set the environment variable, it just imports settings
> assuming it is in the current directory.  Since you don't get an error
> message that that failed, presumably it worked so the question is why is
> some subsequent code trying to use the environment variable even though
> settings has already been loaded.  To help answer that question, the full
> traceback from the error case would be helpful.

Karen,

Here is the traceback. What you said did help me make a little more 
sense out of what's going on - Django is clearly getting to the settings 
file. But, then I get lost.

Dave


/usr/web/myproject/> python manage.py shell
Traceback (most recent call last):
   File "manage.py", line 14, in 
 execute_manager(settings)
   File 
"/usr/local/lib/python2.5/site-packages/django/core/management/__init__.py", 
line 270, in execute_manager
 project_directory = setup_environ(settings_mod)
   File 
"/usr/local/lib/python2.5/site-packages/django/core/management/__init__.py", 
line 251, in setup_environ
 project_module = __import__(project_name, {}, {}, [''])
   File "/usr/web/myproject/../myproject/__init__.py", line 1, in 
 from apps import admin
   File "/usr/web/myproject/../myproject/apps/admin.py", line 1, in 
 from django.contrib import admin
   File 
"/usr/local/lib/python2.5/site-packages/django/contrib/admin/__init__.py", 
line 1, in 
 from django.contrib.admin.options import ModelAdmin
   File 
"/usr/local/lib/python2.5/site-packages/django/contrib/admin/options.py", 
line 5, in 
 from django.contrib.contenttypes.models import ContentType
   File 
"/usr/local/lib/python2.5/site-packages/django/contrib/contenttypes/models.py", 
line 1, in 
 from django.db import models
   File "/usr/local/lib/python2.5/site-packages/django/db/__init__.py", 
line 10, in 
 if not settings.DATABASE_ENGINE:
   File 
"/usr/local/lib/python2.5/site-packages/django/conf/__init__.py", line 
28, in __getattr__
 self._import_settings()
   File 
"/usr/local/lib/python2.5/site-packages/django/conf/__init__.py", line 
57, in _import_settings
 raise ImportError("Settings cannot be imported, because environment 
variable %s is undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable 
DJANGO_SETTINGS_MODULE is undefined.


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



django_settings_module not being set by manage.py

2008-05-23 Thread David Robinson

I have run into a problem that I don't understand - when I try to run 
"shell manage.py shell" I just started getting an error about the 
DJANGO_SETTINGS_MODULE environment variable not being defined.

I found the information I needed to work around the problem (on this 
list - thank you, Evert Rol).  I added these two lines to manage.py:

   import os
   os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'

and that took care of it. But it seems very strange that something like 
manage.py would stop working.

I did just switch to the newforms-admin branch, but toggling back to the 
Django trunk doesn't fix the problem. We are storing a few working 
copies of our code on the same development box so that a few of us can 
work on things without getting in each other's way. I don't know if 
something connected to that could mess things up.

I'm sorry for not posing a clear, concise question, but does anyone have 
any suggestions about what would keep manage.py from being able to set 
that environment variable?

Dave

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



newforms-admin and intermediary tables for m2m relationships

2008-05-19 Thread David Robinson

We are using our own intermediary table for a many-to-many relationship 
so that we can store additional information about the relationship 
itself, and we are just embarking on a thorough overhaul of this app's 
code. In the existing project, we heavily modified change-list and 
change-form templates to use in the admin, and we've got a big, clunky 
save function that grinds through everything well enough. But we have 
hopes of making the world a better place a few lines of code at a time.

Is there anything about the newforms-admin branch that might make it 
easier to do this sort of thing in a more Django-y way?  I just read 
through Steven Wilcox's presentation about the newforms-admin, and it 
seems like hooking up with that branch would be a good thing. But I was 
wondering if the situation we have with an independent intermediary 
table is enough of an outlier that we will still be doing a lot of 
things on our own.

Dave

--~--~-~--~~~---~--~~
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: Better Image Uploads: Fake Model Fields?

2008-05-14 Thread Andy Robinson

>
> Of course, one solution is to name your files after the pk of the
> record they're associated with, so new uploads will overwrite old
> ones.  This is a bit difficult to implement, but it's been 
> done:http://code.djangoproject.com/wiki/CustomUploadAndFilters

Also check out the (rather old) verdjnlib.PhotoField, referenced on
that page.
We borrowed the convention in this in many apps which let end users
upload
photos into a CMS (e.g. go to http://travel.reportlab.com and see the
'how it works' page).

It strictly enforces the name on the server so your image goes in,
e.g.,
  MEDIA/uploads/modelname/pk-fieldname.jpg

Thus, your image would go in
  MEDIA/uploads/userprofile/3-mugshot.png
for user 3.

This is a great default convention if you enforce it from the word go.
I wish it was Django's default behaviour.  User uploaded data is still
data which needs to be managed and backed up, and if it has
a structured naming convention, it really helps.

The only thing better would be storing BLOBS in the database table
directly
(he says, donning an asbestos suit and running for cover...;-)  )

- Andy Robinson, ReportLab
--~--~-~--~~~---~--~~
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: conditional block tag

2007-05-23 Thread David Robinson

I'm probably missing something about your question, and please excuse me 
if that's the case, but wouldn't you be able to do this:

{% if header %}

   {% block header %}Page Heading{% endblock %}

{% endif %}

Dave



Trey wrote:
> I have an interesting case that I would like to get some input on,
> perhaps I am just thinking about it incorrectly.
> 
> It seems useful to have a conditional statement which will check to
> see if a child template has populated a block.
> 
>   
> {% block header %}Page Heading{% endblock %}
>   
> 
> If the block header wasn't sent back, I would like to collapse the
> header field. Does this seem like something useful or am I going about
> it the wrong 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Creating graphs in Django application

2006-09-08 Thread Andy Robinson

Thanks Joseph.  You might find it interesting to take a look at our
Diagra product datasheet...  we've been in the financial charts
business since 2001
   http://www.reportlab.com/docs/diagra-ds.pdf

The engine and most chart types have been in the open source package
since 2001, but we've not really promoted it.  Now that we're getting
into Django, hopefully we'll get some nice examples out to inspire
people..

- Andy


--~--~-~--~~~---~--~~
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: Creating graphs in Django application

2006-09-08 Thread Andy Robinson

I have just added an article to the Wiki on how to create charts using
ReportLab's graphics library  I hope this helps!

http://code.djangoproject.com/wiki/Charts

Andy Robinson, CEO/Chief Architect, ReportLab Europe Ltd


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



Django under IIS with ISAPI

2006-09-08 Thread Andy Robinson

Has anyone actually got an app working with the PyISAPIe extensions?
The wiki gets as far as a Django error message, and we've reproduced
this on two machines (IIS 5.1 and 6.0) in the last 2 days.

The fundamentals clearly work, but the problem is that the default
pointy-clicky way of calling external handlers in IIS is based on file
extensions, and Django URLs don't end in .py or .cgi.  The graphical
IIS dialog will not actually permit you to associate '*' (i.e. all URLs
under a virtual directory, or the root) with pyisapie.dll; you have to
type a dot and an extension.

A colleague of mine has found a working approach for moinmoin here;
this uses the ISAPI hooks which have been in Pythonwin for years, and a
command-line script which registers the python code to handle all
extensions under a number of directories.  It also has some
neat-looking code to watch for and reload any changed Python modules.

   http://moinmoin.wikiwikiweb.de/MoinMoin_ISAPI

If anyone here already has Django running under IIS, please tell me -
otherwise we'll have a crack at this and update the wiki if it works.

- Andy Robinson, ReportLab


--~--~-~--~~~---~--~~
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: Configurable LDAP authentication

2006-08-15 Thread David Robinson

Guillaume Pratte wrote:
> I took the code from http://www.carthage.edu/webdev/?p=12, adapted it
> and generalized it so you can specify LDAP server and other
> configuration items in settings.py.

...

> There is no explicit copyright in the code found at
> http://www.carthage.edu/webdev/?p=12,
> so this code is released under public domain, hoping the original
> author agrees with that.
> ===


Guillaume,

Thanks for the acknowledgment and consideration. I agree that public 
domain for the code samples we publish at www.carthage.edu/webdev is 
appropriate. I'm glad that we're able to contribute something to this 
community, and that you were able to turn our LDAP code into something 
more generally usable. At this point in our experience and expertise, 
these small code samples illustrating how we have worked our way through 
various situations is something we are able to do.

Dave Robinson
Carthage

--~--~-~--~~~---~--~~
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: drag & drop for admin-interface

2006-08-02 Thread David Robinson

patrickk wrote:
> see http://demo.script.aculo.us/ajax/sortable_elements

>> On Wed, 2006-08-02 at 19:50 +0200, patrickk wrote:
>>> I´m just doing some dojo DnD-stuff for the django admin-interface.
>>> ...
>>> question: would you prefer instant saving?


The thing that I wasn't clear about was whether you were asking about 
our preferences rhetorically, as in what do we think people in general 
might prefer, or if you were planning to fix something for us and wanted 
to make sure your solution was the best fit. My own expectation is that 
we'll just add dnd (or whatever other ajax-y extras) ourselves when it 
will be helpful - there are enough idiosyncracies in each case that a 
custom solution seems to make the most sense.

I can't speak for adding drag-and-drop functionality to the built-in 
admin interface since we haven't tried that yet, but you can read about 
our no-frills instance of a Dojo drag-and-drop list at 
www.carthage.edu/webdev/?p=6.  That example is for an administrative 
page that we ended up building ourselves rather than tweaking the 
built-in admin pages.

Dave

--~--~-~--~~~---~--~~
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: Specify order of content items

2006-07-08 Thread David Robinson

[EMAIL PROTECTED] wrote:
> Interesting! Nice to see an example of how to integrate dojo and
> django, there aren't many...
> 
> Are you building a custom administration interface for Sputnik which
> allows for the reordering of news items by use of this technique?
> Did you try to implement this drag and drop functionality for the
> django admin interface as well?


It's a custom interface for managing news items. The reason for that is 
that there is a many-to-many relationship between news items and topics, 
and it's in the linking table that we need to do the sequencing. (Within 
any topic, news items can be sorted differently. For instance, we have a 
home page for people who are on-campus and one for people off-campus, 
and sometimes a story is a bigger deal internally than externally, or 
vice-versa.)

In order to add the sequence field to the linking table and still do 
some other things that we needed to do, we needed to build the admin 
interface ourselves.  We haven't tried adding drag-and-drop 
functionality to anything in the built-in admin interface yet.

I am hoping to flesh out the blog next week and over the coming weeks. 
We've been doing some interesting things with Django, and I would like 
to create the kind of "tales from the front" site that I was looking for 
a couple of months ago when we first started looking into using Django. 
  Thanks for the encouragement.

Dave

--~--~-~--~~~---~--~~
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: Specify order of content items

2006-07-07 Thread David Robinson

drakepad wrote:
> Thanks for clarifying the issue Arthur. Drag and drop support would be
> fantastic indeed... 

We've got the same sort of need to specify the order of news items.  And 
we have done it using Dojo's drag and drop. I'm not the one who did it, 
but the guy who did get it to work wrote about the experience on a blog 
we've just started to talk about what we're doing with Django: 
http://www.carthage.edu/webdev/

Dave

--~--~-~--~~~---~--~~
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: confused again: a "home page" can't be some special case

2006-06-06 Thread David Robinson

Douglas, James, Wilson, Rudolph:

Thanks - that clears things up. It's quite encouraging to see that we 
were pretty much headed in a viable direction.

Dave

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



sorry for the stupid noob question - kwarg?

2006-06-04 Thread David Robinson

Really, I've tried looking this one up myself (you wouldn't believe how 
many questions I *haven't* had to ask... (thanks for well-written docs 
everyone)). It seems almost obvious, but I am proving to be just dense 
enough to not get what is this "kwarg".

Dave

--~--~-~--~~~---~--~~
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: remedial django - what IS a "site" exactly?

2006-05-23 Thread David Robinson

Many thanks to James and Adrian for explaining sites. I'm expecting to 
have several more questions over the coming weeks as we get further into 
things, and it's nice to know that the Django community is so responsive.

Dave

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



remedial django - what IS a "site" exactly?

2006-05-20 Thread David Robinson


I'll try to be brief... We're just starting to work on replacing an 
existing home-grown content management system with one built with 
Django.  We've got lots of semi-autonomous departments (a small liberal 
arts college).  All of the content will be in one database. We'll be 
building a bunch of apps in one core project that will handle the admin 
side of things for everything and everyone.  Each department that 
chooses to have their pages managed through this CMS will be created as 
a project, where each project will have access to whichever apps that 
department needs.


My question is about the site ID in each project's settings.py file. 
What does that number mean in a situation like ours?  I appreciated the 
explanation of the difference between an app and a project, but I 
haven't been able to figure out how "site ID" ends up factoring into things.


I'm probably making a mountain out of a mole hill, but I'd feel much 
better about diving into a large-ish project with a better handle on a 
pretty basic concept. What would it mean (in terms of developing with 
Django) for me to think of this as *one large site* with lots of 
more-or-less free-standing pieces versus *a bunch of sites* that happen 
to have an awful lot in common? Or does each project simply need to have 
its own site ID?


Dave
X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.54.160.18 with SMTP id i18mr156641wre;
   Sat, 20 May 2006 16:59:55 -0700 (PDT)
Return-Path: <[EMAIL PROTECTED]>
Received: from carthage.edu (andre1.carthage.edu [198.150.93.70])
   by mx.googlegroups.com with ESMTP id v23si510935cwb.2006.05.20.16.59.54;
   Sat, 20 May 2006 16:59:55 -0700 (PDT)
Received-SPF: neutral (googlegroups.com: 198.150.93.70 is neither permitted nor 
denied by best guess record for domain of [EMAIL PROTECTED])
Received: from [69.81.200.165] (account drobinson HELO [192.168.0.100])
 by carthage.edu (CommuniGate Pro SMTP 4.2.10)
 with ESMTP id 9070 for django-users@googlegroups.com; Sat, 20 May 2006 
18:59:53 -0500
Message-ID: <[EMAIL PROTECTED]>
Date: Sat, 20 May 2006 18:59:33 -0500
From: David Robinson <[EMAIL PROTECTED]>
User-Agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923)
X-Accept-Language: en-us, en
Mime-Version: 1.0
Content-Type: text/plain
To: django-users <django-users@googlegroups.com>
Subject: remedial django - what IS a "site" exactly?

I'll try to be brief... We're just starting to work on replacing an 
existing home-grown content management system with one built with 
Django.  We've got lots of semi-autonomous departments (a small liberal 
arts college).  All of the content will be in one database. We'll be 
building a bunch of apps in one core project that will handle the admin 
side of things for everything and everyone.  Each department that 
chooses to have their pages managed through this CMS will be created as 
a project, where each project will have access to whichever apps that 
department needs.


My question is about the site ID in each project's settings.py file. 
What does that number mean in a situation like ours?  I appreciated the 
explanation of the difference between an app and a project, but I 
haven't been able to figure out how "site ID" ends up factoring into things.


I'm probably making a mountain out of a mole hill, but I'd feel much 
better about diving into a large-ish project with a better handle on a 
pretty basic concept. What would it mean (in terms of developing with 
Django) for me to think of this as *one large site* with lots of 
more-or-less free-standing pieces versus *a bunch of sites* that happen 
to have an awful lot in common? Or does each project simply need to have 
its own site ID?


Dave

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