Awesome - thanks for the description.
On Jan 18, 9:45 am, Tom Evans wrote:
> On Wed, Jan 18, 2012 at 1:50 PM, Stodge wrote:
> > I have a particular use case where the default permissions don't work
> > for me. I know I can create a custom auth backend, but if I do that,
I installed django-cas-provider and django-cas-consumer. I configured
the consumer to use the CAS service offered by the provider and I
added a base.html template for the consumer. Is this base template
supposed to contain the login form? Or is the login form supposed to
be available on teh provide
vice with django-cas-provider.
>
> On Fri, Apr 29, 2011 at 7:30 PM, Stodge wrote:
> > django-cas-consumer
>
> --
> Alex Kamedov
> skype: kamedov www: kamedov.ru
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
I have a Page model, with a generic foreign key. I have a Story model,
which has a generic relation to Page. If I do:
sp=StaticPage.objects.get(id=1)
I have to do this to get the Page object:
sp.content.all()[0]
However, there will only ever be on Story linked to one Page model. Is
there anyway
Is there any interest in changing the inclusion template functionality
to let the function return the template name in the dictionary to the
inclusion_tag decorator? This would let the developer override the
template filename:
{{{
@register.inclusion_tag('block/render_region.html')
def render_reg
I have the following models:
class Category(models.Model):
type = models.CharField(max_length=128)
class CategoryTerm(models.Model):
term = models.CharField(max_length=128)
type = models.ForeignKey(Category, related_name='terms')
class CategoryMap(models.Model):
term = models.For
Quick form wizard question. I create my wizard with one form. When
that one is submitted, I add a second form to the form list. This
second form/step is displayed. When I submit this one, the wizard
suddenly thinks it only has one form, not two. I realise that when I
create the form wizard in my vi
nough to ensure a user remains logged in. Typically with my site,
requests are sent at least every minute to refresh displayed data.
On Dec 10, 10:45 am, Daniel Roseman wrote:
> On Dec 10, 3:07 pm, Stodge wrote:
>
>
>
>
>
>
>
>
>
> > I'm trying to limit
I need to let client applications, primarily written in Java and Python
login to my Django site. What's the best way? Request the form, parse it and
POST the username, password and csrf token? Or provide an Ajax login view?
--
You received this message because you are subscribed to the Google G
I need to know who changed a particular model through the admin site so I
can create a log entry. The post_save signal has no knowledge of the user
that changed the model and overriding the model's save method won't tell me
the user either. Is there a way to know which user changed a particular
Is there any way to get the ip address of the user in the post_save signal?
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
I'm adding map data from a new source that needs to be projected so I
transform the query set like this:
q =
Polyline.objects.filter(overlay='63979e90-a578-4d18-af0a-8bd75279d923').transform(93997).svg()
The resulting SVG attribute isn't transformed. The documentation says:
Attaches a SVG at
I have several Django websites and I want to create a centralized auth
provider. The auth provider site would contain the user accounts and be the
only repository for user details and passwords. Users would log into the
auth provider site and when they visit each satellite website for the first
I'm trying to port my Django project to Dango 1.7rc2 but I'm hitting the
app registry error. I know that this is mentioned in the Troubleshooting
section of the documentation but I don't understand why this is happening.
__init__.py", line 44, in register_layer
layer['verbose_name'] = model.
As explained in https://code.djangoproject.com/ticket/14952, Django doesn't
support custom management commands that are only provided as .pyc files. I
have a requirement with my project that I cannot distribute the .py files -
only the .pyc. It's a roundabout way of not providing the source code
Thanks - there are some great suggestions here. Much appreciated.
--
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 p
I've had good success with placing the import at the end of the models file.
On Tuesday, 12 August 2014 20:06:41 UTC-4, chedi toueiti wrote:
>
> Hi Neto,
>
> Just make sure that your callback is loaded, the most easy way to do it is
> to import the function in models.py if you have a single model
We implemented a simple SOAP service using SoapLib 0.8 in our Django
project a long time ago. We think he created an API document that we want
to send to clients. I have a vague recollection that he somehow
auto-generated the APIs from the source code. However, we can't find the
document and th
I have the following to model a calendar entry (recurring event). I need
the ability to retrieve all events from the database between a start and
end date. This has to include one off events and also recurring "virtual"
events that occur because of an event in the database. Do you think this is
I will read this thanks. Does it cover this issue?
django.core.exceptions.AppRegistryNotReady: The translation infrastructure
> cannot be initialized before the apps registry is ready. Check that you
> don't make non-lazy gettext calls at import time.
>
I don't know if this has been a pain to m
I'm trying to create fixtures for my Django application. We have our own
app that provides per-object permissions. It uses a GenericForeignKey to
assign permissions to many different models. I need the ability to define
fixtures for these custom permissions. However, I'm having trouble
understa
I have a separate daemon running as root that generates cached image tiles
per user for a map. For now it creates them under /tmp/tile_cache. When it
creates a new tile cache it changes the UID and GID to the apache user (on
Fedora) and also gives everyone access to the directory, e.g. permissio
I'll see if the python code under Apache can stat /tmp. Thanks.
On Thursday, 6 November 2014 10:56:39 UTC-5, Tom Evans wrote:
>
> On Thu, Nov 6, 2014 at 3:54 PM, Tom Evans > wrote:
> > On Thu, Nov 6, 2014 at 3:08 PM, Stodge >
> wrote:
> >> I have a s
I'm debug printing the directory I'm trying to delete, so I'm sure it's
correct. But you raise a valid point!
I also change permissions and ownership of /tmp/tile_cache.
Thanks.
On Thursday, 6 November 2014 10:59:35 UTC-5, Bruno Barcarol Guimarães wrote:
>
> > os.path.exists fails to see the di
root 1380 Nov 6 11:07 ..
> drwxrwxrwx 2 apache apache 860 Nov 6 11:07 mike
Oh but I just noticed that the total is '0'. Weird.
On Thursday, 6 November 2014 11:02:15 UTC-5, Stodge wrote:
>
> I'll see if the python code under Apache can stat /tmp. Thanks.
>
> O
Tom, you might be right about the sticky bit. If I store the tile cache
elsewhere, the signal can successfully delete it.
On Thursday, 6 November 2014 10:55:03 UTC-5, Tom Evans wrote:
>
> On Thu, Nov 6, 2014 at 3:08 PM, Stodge >
> wrote:
> > I have a separate daemon ru
Yes it is possible - think of the actions that need to take place.
* The user clicks the button in the browser.
* The browser sends an Ajax request to Django
* The Django view processes the Ajax request, updates the database and
sends a response to the browser
These are web fundamentals and I
My settings for languages are:
LANGUAGE_CODE = 'en'
USE_I18N = True
LANGUAGE_COOKIE_NAME='django_language'
ugettext = lambda s: s
LANGUAGES = (
('en', ugettext('English')),
('de', ugettext('German')),
('fr', ugettext('French'))
)
I have a post-save signal that creates instances of a
.
On Wednesday, 18 June 2014 12:48:47 UTC-4, Stodge wrote:
>
> My settings for languages are:
>
> LANGUAGE_CODE = 'en'
>
> USE_I18N = True
> LANGUAGE_COOKIE_NAME='django_language'
> ugettext = lambda s: s
> LANGUAGES = (
> ('en', ugettext(
Even when I override the language code in my custom command get_language()
still returns "en-us". Weird. Guess I'll have to use settings.LANGUAGE_CODE
instead of get_language().
On Wednesday, 18 June 2014 13:02:37 UTC-4, Stodge wrote:
>
> Oh.
>
>
> https://docs.
http://www.jetbrains.com/pycharm/
> "Develop with pleasure!"
>
>
> >-Original Message-
> >From: django...@googlegroups.com
> >[mailto:django...@googlegroups.com ] On Behalf Of Stodge
> >Sent: Wednesday, June 18, 2014 9:21 PM
> >To: djan
jango IDE)
> http://www.jetbrains.com/pycharm/
> "Develop with pleasure!"
>
>
> >-Original Message-
> >From: django...@googlegroups.com
> >[mailto:django...@googlegroups.com ] On Behalf Of Stodge
> >Sent: Wednesday, June 18, 2014 9:42 PM
nt command still returns "en-us".
On Wednesday, 18 June 2014 13:58:05 UTC-4, James Bennett wrote:
>
> On Wed, Jun 18, 2014 at 10:21 AM, Stodge >
> wrote:
>
>> Even when I override the language code in my custom command
>> get_language() still
ing the functions provided by the I18N support code:*
Using the code:
# Activate a fixed locale, e.g. Russian
translation.activate('ru')
However, this doesn't appear to change anything.
On Thursday, 19 June 2014 08:38:31 UTC-4, Tom Evans wrote:
>
> O
Sorry, this is using Django 1.6.2.
On Wednesday, 18 June 2014 12:48:47 UTC-4, Stodge wrote:
>
> My settings for languages are:
>
> LANGUAGE_CODE = 'en'
>
> USE_I18N = True
> LANGUAGE_COOKIE_NAME='django_language'
> ugettext = lambda s: s
&g
Read the documentation:
https://docs.djangoproject.com/en/dev/ref/models/querysets/#order-by
On Wednesday, 18 June 2014 08:06:18 UTC-4, Ashu Singh wrote:
>
> Hello everyone. My doubt is how to fetch the recent two database entries
> in django. User may enter into database anytime but the query s
No that's the code from the Django documentation.
https://docs.djangoproject.com/en/1.6/howto/custom-management-commands/#management-commands-and-locales
On Thursday, 19 June 2014 09:39:34 UTC-4, Tom Evans wrote:
>
> On Thu, Jun 19, 2014 at 1:41 PM, Stodge >
> wrote:
> >
strap function calls loaddata management command (using
management.call_command)
* data created in DB, which triggers a post_save signal
* get_language() in post_save signal always returns "en-us"
On Wednesday, 18 June 2014 12:48:47 UTC-4, Stodge wrote:
>
> My settings for la
I'm trying to make a template and form to let a user define a recurring
event. I want to present different fields depending on whether they want
daily, weekly, monthly or yearly recurrence. I'm not sure how to define the
forms to do this so that the submitted data isn't duplicated or redundant.
>> Examples: it, de_AT, es, pt_BR. The language part is always in lower
>> case and the country part in upper case. The separator is an underscore.
>
>
> so 'en-gb' should not be recognized.
> 'en_GB' ought to be.
>
>
> On Thursday, June 19,
I have these models:
class EventEntry(models.Model):
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = generic.GenericForeignKey('content_type', 'object_id')
start_date = models.DateTimeField(...)
end_date = models.DateTim
I'm trying to add an extra directory for each app that will contain
Javascript/CSS files. I created a custom storage.py in my app containing a
copy of the code from Django's AppDirectoriesFinder class, but I changed
source_dir from "static" to "catalog". I'll include the Django code with
the mo
):
super(CatalogFinder, self).__init__(*args, **kwargs)
STATICFILES_FINDERS = (
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
"myapp.finders.CatalogFinder"
)
On Wednesday, 1 Novemb
There's a flaw in my plan as STATICFILES_STORAGE is a string and not a
tuple.
--
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...@googlegr
I'm porting a website from Django 1.6.x to 1.11 and I'm hitting a problem
with my custom router. Some models define a custom attribute defining which
database it will reside in:
class MyModel(models.Model):
DATABASE_NAME = "foo"
This worked in our custom router in 1.6.x but not in 1.11. The
I am porting an app from Django 1.6.x to 1.10.x and I'm hitting a problem
with URL namespaces. I don't specifically configure any namespaces in my
URLs but Django seems to think that all my app URLs are namespaced. The
documentation seems to imply that namespaces are optional and only
configure
y optional - you don't have to use it if you don't
> want to.
>
> What is happening that makes you think otherwise? What errors are you
> seeing?
>
> Regards,
>
> Andréas
>
> 2017-12-21 16:38 GMT+01:00 Stodge >:
>
>> I am porting an app from D
e I'm not using the
namespace parameter on include()?
On Thursday, 21 December 2017 10:38:36 UTC-5, Stodge wrote:
>
> I am porting an app from Django 1.6.x to 1.10.x and I'm hitting a problem
> with URL namespaces. I don't specifically configure any namespaces in my
>
the namespace in the call to reserve, so if you had setup the
> namespace like i wrote here, you would use:
> reverse("license:license_detail", args=(1, ))
>
> Hope I have explained it good enough :-)
>
> Regards,
>
> Andréas
>
> 2017-
Problem solved and apparently it was my silly mistake! While experimenting
I added app_name to my urls files. Apparently this enables namespace
support. So I removed them from my urls files and it works.
Thanks
On Thursday, 21 December 2017 10:38:36 UTC-5, Stodge wrote:
>
> I am porting
I want to add a custom pre-login signal (user_logging_in) that fires just
before Django's login function is called. This is a snippet from our custom
account app that may explain what I want:
from django.contrib.auth import login as real_login
def custom_login()
# Allow other apps to per
My website uses a combination of Django + Java apps to function. For this
particular problem, a record is deleted from the DB via a TastyPie resource
DELETE operation. A Django signal post_delete handleris invoked, which
submits a DELETE request to Jetty running in the Java app. The Java app
th
I have two models, Volume and Group. The Volume model has a foreign key to
Group.
When a user deletes a Volume the post_delete signal handler sends an HTTP
DELETE request (/volume) to another server process. This works great.
However, when the user deletes a Group, the cascading delete also del
Thanks Erik.
I forgot to say that the Group model has an "active" flag on it, so I'm
seeing if I can use this.
On Thursday, 1 September 2016 14:55:05 UTC-4, Erik Cederstrand wrote:
>
>
> > Den 1. sep. 2016 kl. 20.14 skrev Stodge >:
>
> >
> > I
I'm getting an exception during a TastyPie request for one of my resources.
The exception is:
Error: not all arguments converted during string formatting
I know what causes the exception, but I have no idea where it is happening,
as there is no trackback or indication of which module or functio
Ok, so I discovered after searching through lots of code that the problem
occurs because I haven't run compilemessages, so Django was trying to
format an error message that accepted parameters.
On Friday, 2 September 2016 11:06:58 UTC-4, Stodge wrote:
>
> I'm getting an ex
I have two Django servers A1 and S1, which sit behind a simplistic NodeJS
proxy. This is a silly attempt at single sign on.
I can log into and out of A1 (authentication server) just fine. If I log into
A1, visit S1 (without being logged in to S1) and then revisit A1, I am no
longer logged in. T
rmal
So the user is logged into both. It's a fairly naive attempt at reinventing
the wheel, but that's how we learn, right? :)
Cheers
Mike
On Friday, 30 September 2016 04:30:04 UTC-4, Michal Petrucha wrote:
>
> On Thu, Sep 29, 2016 at 01:50:22PM -0700, Stodge wrote:
> >
I discovered JSON Web Tokens after I posted my original question. So I'll
read about how they work.
Thanks
Mike
On Thursday, 29 September 2016 16:50:22 UTC-4, Stodge wrote:
>
> I have two Django servers A1 and S1, which sit behind a simplistic NodeJS
> proxy. This is a silly att
Thanks again. I set a different session cookie name for S1 and it seems to have
worked.
--
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...
Is there a way to get the maximum value that an ID can be for a model that
uses AutoField for its primary key? For example, in PostgreSQL I could do:
SELECT maximum_value FROM information_schema.sequences WHERE sequence_name =
'my_sequence_id_seq';
maximum_value
---
9
(1 row)
I have a model with a many to many relationship. I need to know when a
record is added to or removed from the many to many.
Is this possible? Thanks
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiv
when a
> record is added or removed.
>
> Nevertheless, you can make use of django signals (Thanks to melvyn). It
> will be of great help.
>
> Yingi Kem
>
> On 13 Jun 2017, at 12:54 PM, Stodge >
> wrote:
>
> I have a model with a many to many relationship. I ne
I have several Django sites and I need to synchronize user accounts across them
all. I need the ability to create the same user on all sites at the same time
and also to keep their info in sync. The servers are in different locations in
DMZs and can't open connections to external servers. So no
,
> the site authenticates them against the SSO, and fetches user data. See Stack
> Exchange sites (Stack Overflow, Server Fault, etc) as an example.
>
> On 8 Nov 2015 18:24, "Stodge" wrote:
> I have several Django sites and I need to synchronize user accounts across
> them a
I'm using Django 1.6.9. When the dev server (and hence Apache) starts, is
Django supposed to import models for apps that exist on disk, but aren't
enabled in the settings? I'm seeing this behaviour and I wasn't expecting
it. Thanks
--
You received this message because you are subscribed to the
Carl, thanks. You were right - I was experiencing "b".
Thanks again
Mike
On Tuesday, 5 January 2016 11:02:24 UTC-5, Carl Meyer wrote:
>
> Hi Stodge,
>
> On 01/05/2016 08:57 AM, Stodge wrote:
> > I'm using Django 1.6.9. When the dev server (and hence Apache) s
I'm trying to diagnose a problem where noone can login to my django site.
The login attempt times out as NGINX (proxy) gives up waiting for Apache to
respond. There are no errors in the logs anywhere. I copied the Django code
into my app to debug:
def this_real_login(request, user):
> """
>
The title is misleading; it should probably be "Session recycling stalls
during login".
I also noticed that logout stalls.
On Saturday, February 27, 2016 at 3:12:08 PM UTC-5, Stodge wrote:
>
> I'm trying to diagnose a problem where noone can login to my django site.
>
Is anyone aware of a Django app that adds multiple inheritance to Django
auth groups? I know about django-hierarchical-auth but I want the ability
to specify multiple parents for a group to make it easier to manage and
group permissions. Thanks
--
You received this message because you are subs
Let's say I take the following code from the Django documentatation:
class Student(models.Model):
FRESHMAN = 'FR'
SOPHOMORE = 'SO'
JUNIOR = 'JR'
SENIOR = 'SR'
YEAR_IN_SCHOOL_CHOICES = (
(FRESHMAN, 'Freshman'),
(SOPHOMORE, 'Sophom
he ones
> likely to define choices) and use the `is` operator to compare all
> of them to the field choices.
>
> This will perform badly and shouldn't be used for anything else
> than one off debugging reflection though.
>
> Best,
> Simon
>
> Le lundi 10 décembre 2
101 - 172 of 172 matches
Mail list logo