Re: Part site under a dedicated domain

2011-10-02 Thread Alex Mandel
On 10/02/2011 04:12 PM, Michael Ludvig wrote:
> Hi guys and gals,
> 
> I maintain a Django-CMS website running on Django 1.2.5 with a couple of
> pages - one for selling houses, one buying houses, etc. At the moment
> it's all under one domain name (http://patmat.co.nz) with some other
> domains being redirected by Apache to specific pages on the main site,
> for example http://house-buyers.co.nz is redirected to
> http://patmat.co.nz/we-buy-houses/ 
> 
> Now, I would like to have the "We Buy Houses" part of the main website
> accessible directly at http://house-buyers.co.nz - i.e. when someone
> clicks on a link leading to house-buyers.co.nz I want them to get the We
> Buy Houses page without actually redirecting to patmat.co.nz/we-buy-houses
> 
> Similarly the menu created by {% show_menu %} should point to the
> absolute URLs under patmat.co.nz or house-buyers.co.nz respectively. And
> all that, of course, being one Django project with a single database,
> same design templates, same config, same /admin, etc.
> 
> Is this at all possible with Django?
> 
> Thanks!
> 
> Michael
> 

Should be possible with multiple virtual host configs in Apache. One for
each domain with all of them having duplicate mod_wsgi or fastcgi
configs. If you want to force certain urls from one domain to the other
use Apache for that. As far as Django is concerned everything is
relative to the top url whatever that may be. Though you can put in
mulitple hostnames in the admin interface which makes things like
flatpages happy.

Happy ponies,
Alex

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



Re: Can model subclass change field options?

2011-10-02 Thread Brian Mehrman
Hi Jonas,

You can override validation by adding a "clean" method to the ModelAdmin
subclass. Look here for more details,
https://docs.djangoproject.com/en/dev/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other
.
That is what I have been doing. It might be hacky, someone please let me
know if there is a better solution.


Going back to my earlier example it should look something like this. In the
clean function you can also raise ValidationErrors to send back a custom
error message.

# admin.py
from django.contrib import admin
from django.forms import widgets

class myModelAdmin(admin.ModelAdmin):
  title = CharField(widget=widgets.Select(choices=('mr','mrs','miss'))

  # This method name is dynamicly create using 'clean_' + model name to
create
  # a method name.
  def clean_title(self):
 data = self.cleaned_data['title']
 if(data == ''):
   raise ValidationError("you forgot to set the title")


  def clean(self):
# grab already cleaned data so we can manipulate it
data = super(myModelAdmin, self).clean()
new_title = data['title']

# do something to the old title then add it back to data
data['title'] = new_title

return data


admin.site.register(myModel, myModelAdmin)
Thats how I have been handling my validation issues. I hope this helps you
figure out your validation issues. If you are still having trouble post the
error message your are gettting, I might be able to help you more from that.

-Brian

Also if you have checked out DjangoSnippets you should check it out. I have
found some great working examples on that site.


On Sun, Oct 2, 2011 at 4:04 PM, Jonas Cleve wrote:

> Hi Brian,
>
> that works so far for displaying the correct choices in the admin
> interface. But the problem now is the validation. He always tells me
> that my choice is not a correct value.
> I have been looking for a way to change validation but I can't figure
> out how to do this...
>
> Thanks for your help so far.
>
> Jonas
>
> Am 02.10.2011 19:41, schrieb Brian Mehrman:
> > HI, Artemis,
> >
> > If I understand you correctly you want to use a Select Widget for your
> > CharField. And feed your choices to the select widget.
> >
> > In your admin.py file of your app you will want to override the model's
> > form field.
> >
> >
> > # models.py
> > from django.db import models
> >
> > myModel(models.Model):
> >   person = models.CharField()
> >   title = models.CharField()
> >
> > # admin.py
> > from django.contrib import admin
> > from django.forms import widgets
> >
> > myModelAdmin(admin.ModelAdmin):
> >   title = CharField(widget=widgets.Select(choices=('mr','mrs','miss'))
> >
> > admin.site.register(myModel, myModelAdmin)
> >
> > This code hasnt been tested but should be the route you want to take.
> > You can find more info on widgets
> > here(https://docs.djangoproject.com/en/1.3/ref/forms/widgets/). I hope
> > this helps you.
> >
> > -Brian
> >
> > On Sun, Oct 2, 2011 at 12:20 PM, Artemis  > > wrote:
> >
> > Hi,
> >
> > I have an model which contains a CharField.
> > Now I want to have different subclasses of this model each one with
> > different *choices* for the CharFiel. How can I implement this?
> >
> > --
> > 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.



Part site under a dedicated domain

2011-10-02 Thread Michael Ludvig

Hi guys and gals,

I maintain a Django-CMS website running on Django 1.2.5 with a couple of 
pages - one for selling houses, one buying houses, etc. At the moment 
it's all under one domain name (http://patmat.co.nz) with some other 
domains being redirected by Apache to specific pages on the main site, 
for example http://house-buyers.co.nz is redirected to 
http://patmat.co.nz/we-buy-houses/ 


Now, I would like to have the "We Buy Houses" part of the main website 
accessible directly at http://house-buyers.co.nz - i.e. when someone 
clicks on a link leading to house-buyers.co.nz I want them to get the We 
Buy Houses page without actually redirecting to patmat.co.nz/we-buy-houses


Similarly the menu created by {% show_menu %} should point to the 
absolute URLs under patmat.co.nz or house-buyers.co.nz respectively. And 
all that, of course, being one Django project with a single database, 
same design templates, same config, same /admin, etc.


Is this at all possible with Django?

Thanks!

Michael

--
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: View decorator for common navigation elements?

2011-10-02 Thread Victor Hooi
heya,

This SO post seems to suggest that data and template tags shouldn't mix...

http://stackoverflow.com/questions/5046046/where-put-database-interaction-in-django-templatetags

Not sure how I feel about that myself - I see the philosophical argument 
behind it, but I don't see another more efficiently creating common page 
elements (like my category dropdowns).

Also, if you look at James Bennett's posts here:

http://www.b-list.org/weblog/2006/jun/07/django-tips-write-better-template-tags/

His code actually *does* interact with the database, as does the blog post 
here 
(http://www.webmonkey.com/2010/02/use_templates_in_django/#Roll_your_own_template_tags).

Also, as an aside, each link on our category dropdown is bound to a JS click 
event - not sure how this would tie in with the custom template tag - 
separate tag for that part of it?

Cheers,
Victor

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



Django 1.3 logging, how to log INFO to file1.log and ERROR to file2.log

2011-10-02 Thread robinne
I want to log ERRORs to an error log and INFO to an info log file. I
have it setup like this, but the info log files gets both INFO and
ERROR logging (because it allows INFO and above severity). How do I
only run a handler for INFO and not higher items such as ERROR.

LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %
(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'null': {
'level':'DEBUG',
'class':'django.utils.log.NullHandler',
},
'console':{
'level':'DEBUG',
'class':'logging.StreamHandler',
'formatter': 'simple'
},
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler',
},
'log_errors':{
'level':'ERROR',
'class' : 'logging.handlers.RotatingFileHandler',
'filename' : os.path.join(SITEROOT, 'Logs/errors.log'),
'formatter' : 'verbose',
'backupCount' :'5',
'maxBytes' : '500'
},
'log_info':{
'level':'INFO',
'class' : 'logging.handlers.RotatingFileHandler',
'filename' : os.path.join(SITEROOT, 'Logs/info.log'),
'formatter' : 'simple',
'backupCount' :'5',
'maxBytes' : '500'
}
},
'loggers': {
'django': {
'handlers':['null'],
'propagate': True,
'level':'INFO',
},
'django.request': {
'handlers': ['log_errors'],
'level': 'ERROR',
'propagate': False,
},
'':{
'handlers': ['log_errors', 'log_info'],
'level': 'INFO',
'propagate': False,
}

}
}

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



Re: can't get STATICFILES to work (Django dev version)

2011-10-02 Thread nara
No, I had Debug=True.

Xavier, you have a good point, my understanding of STATICFILES is
still foggy, and I do have confusion between media and static files.
However, I have to make some progress on the rest of
my code. I will revisit this when I have some cycles, but for sure,
when I try to use a non-development server, such as apache.

Thanks
Nara



On Oct 1, 1:00 pm, Jian Chang  wrote:
> Did you set Debug=False?
> 在 2011-9-27 上午4:21,"nara" 写道:
>
>
>
>
>
>
>
> > I am having trouble getting STATICFILES to work. I have read the docs,
> > and followed the instructions, but I never get my css files to load.
> > My current workaround is to put all the css inline in my template
> > file, but that should not be a permanent solution.
>
> > I am running the django dev version, and I am using the built-in
> > server. Here are my changes:
>
> > 1. I placed my media (css) files under /home/nara/media
> > 2. I added '/home/nara/media' under STATICFILES_DIRS
> > (django.contrib.staticfiles is already in INSTALLED_APPS)
> > 3. I added {{STATIC_URL}} (no spaces) in front of the reference to
> > static files in my template file.
> > 4. I restarted the server.
>
> > No further changes. I don't have additional copies of the static files
> > anywhere else, such
> > us under my project, or app.
>
> > Looking at the result in firebug within firefox, I get an HTTP
> > response of 200 on my css files
> > (happen to be css/blueprint/screen.css and print.css), but the files
> > are null. Clearing
> > the cache, restarting Firefox etc. do not help.
>
> > I have been fighting this issue for several days now, and have tried
> > many things,
> > but the above description is for my current state.
>
> > Thanks
> > Nara
>
> > --
> > You received this message because you are subscribed to the Google Groups
>
> "Django users" group.> To post to this group, send email to 
> django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
>
> django-users+unsubscr...@googlegroups.com.> For more options, visit this 
> group at
>
> http://groups.google.com/group/django-users?hl=en.
>
>
>
>
>
>
>
>

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



Django 1.3 logging, django.request logger not processed

2011-10-02 Thread robinne
I have setup my application to use the settings from the django
documentation on logging, with a few items removed for simplicity. I
have found that the logger django.request is not running even though I
am trying to log an error from within a view. If I add  '' logger
(thanks to some other posts found here), that logger will run a
handler. What am I missing with the default django.request logger?

#settings
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %
(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'null': {
'level':'DEBUG',
'class':'django.utils.log.NullHandler',
},
'console':{
'level':'DEBUG',
'class':'logging.StreamHandler',
'formatter': 'simple'
},
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler',
},
'log_it':{
'level':'ERROR',
'class' : 'logging.handlers.RotatingFileHandler',
'filename' : os.path.join(SITEROOT, 'MYLOGGING.log'),
'formatter' : 'verbose',
'backupCount' :'5',
'maxBytes' : '500'
}
},
'loggers': {
'django': {
'handlers':['null'],
'propagate': True,
'level':'INFO',
},
'django.request': {
'handlers': ['log_it'],
'level': 'ERROR',
'propagate': False,
},
'':{
'handlers': ['log_it'],
'level': 'ERROR',
'propagate': False,
}


}
}


and the view...

import logging
logger = logging.getLogger(__name__)

def FAQ(request):
logger.error('test logging error')
return render_to_response("FAQ.html",
context_instance=RequestContext(request))


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



Re: Can model subclass change field options?

2011-10-02 Thread Jonas Cleve
Hi Brian,

that works so far for displaying the correct choices in the admin
interface. But the problem now is the validation. He always tells me
that my choice is not a correct value.
I have been looking for a way to change validation but I can't figure
out how to do this...

Thanks for your help so far.

Jonas

Am 02.10.2011 19:41, schrieb Brian Mehrman:
> HI, Artemis,
> 
> If I understand you correctly you want to use a Select Widget for your
> CharField. And feed your choices to the select widget.
> 
> In your admin.py file of your app you will want to override the model's
> form field. 
> 
> 
> # models.py
> from django.db import models
> 
> myModel(models.Model):
>   person = models.CharField()
>   title = models.CharField()
> 
> # admin.py
> from django.contrib import admin
> from django.forms import widgets
> 
> myModelAdmin(admin.ModelAdmin):
>   title = CharField(widget=widgets.Select(choices=('mr','mrs','miss'))
> 
> admin.site.register(myModel, myModelAdmin)
> 
> This code hasnt been tested but should be the route you want to take.
> You can find more info on widgets
> here(https://docs.djangoproject.com/en/1.3/ref/forms/widgets/). I hope
> this helps you.
> 
> -Brian
> 
> On Sun, Oct 2, 2011 at 12:20 PM, Artemis  > wrote:
> 
> Hi,
> 
> I have an model which contains a CharField.
> Now I want to have different subclasses of this model each one with
> different *choices* for the CharFiel. How can I implement this?
> 
> --
> 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.



Re: Can model subclass change field options?

2011-10-02 Thread Jonas Cleve
HI, Artemis,

If I understand you correctly you want to use a Select Widget for your
CharField. And feed your choices to the select widget.

In your admin.py file of your app you will want to override the model's
form field. 


# models.py
from django.db import models

myModel(models.Model):
  person = models.CharField()
  title = models.CharField()

# admin.py
from django.contrib import admin
from django.forms import widgets

myModelAdmin(admin.ModelAdmin):
  title = CharField(widget=widgets.Select(choices=('mr','mrs','miss'))

admin.site.register(myModel, myModelAdmin)

This code hasnt been tested but should be the route you want to take.
You can find more info on widgets
here(https://docs.djangoproject.com/en/1.3/ref/forms/widgets/). I hope
this helps you.

-Brian

On Sun, Oct 2, 2011 at 12:20 PM, Artemis > wrote:

Hi,

I have an model which contains a CharField.
Now I want to have different subclasses of this model each one with
different *choices* for the CharFiel. How can I implement this?

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



Re: Can model subclass change field options?

2011-10-02 Thread Brian Mehrman
HI, Artemis,

If I understand you correctly you want to use a Select Widget for your
CharField. And feed your choices to the select widget.

In your admin.py file of your app you will want to override the model's form
field.


# models.py
from django.db import models

myModel(models.Model):
  person = models.CharField()
  title = models.CharField()

# admin.py
from django.contrib import admin
from django.forms import widgets

myModelAdmin(admin.ModelAdmin):
  title = CharField(widget=widgets.Select(choices=('mr','mrs','miss'))

admin.site.register(myModel, myModelAdmin)

This code hasnt been tested but should be the route you want to take. You
can find more info on widgets here(
https://docs.djangoproject.com/en/1.3/ref/forms/widgets/). I hope this helps
you.

-Brian

On Sun, Oct 2, 2011 at 12:20 PM, Artemis  wrote:

> Hi,
>
> I have an model which contains a CharField.
> Now I want to have different subclasses of this model each one with
> different *choices* for the CharFiel. How can I implement this?
>
> --
> 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.



Can model subclass change field options?

2011-10-02 Thread Artemis
Hi,

I have an model which contains a CharField.
Now I want to have different subclasses of this model each one with
different *choices* for the CharFiel. How can I implement this?

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



Re: django 1.3 upgrade problem

2011-10-02 Thread Xavier Ordoquy
Hi,

I'm a bit curious about the ModPythonRequest object which makes me think you 
are using mod_python.
If this is the case, you should note that its support is deprecated:

Support for mod_python has been deprecated, and will be removed in Django 1.5. 
If you are configuring a new deployment, you are strongly encouraged to 
consider using mod_wsgi or any of the other supported backends.


Regards,
Xavier.

Le 2 oct. 2011 à 16:52, shiva a écrit :

> I recently updgraded to django 1.3. After the upgrade, I get the
> following error whenever I used request.POST:
> 
> Traceback (most recent call last):
> 
> File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py",
> line 86, in  get_response
> response = None
> 
> File "/public/gdp/trunk/src/ukl/lis/process/utils/error_handler.py",
> line 15, in __call__
> return self.function(*args, **kwargs)
> 
> File "/usr/lib/python2.4/site-packages/django/views/decorators/
> cache.py", line 30, in _cache_controlled
> # and this:
> 
> File "/public/gdp/trunk/src/ukl/lis/process/authentication/views.py",
> line 438, in login
> form = loginForm(request.POST)
> 
> File "/usr/lib/python2.4/site-packages/django/core/handlers/
> modpython.py", line 101, in _get_post
> self._load_post_and_files()
> 
> AttributeError: 'ModPythonRequest' object has no attribute
> '_load_post_and_files'
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

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



django 1.3 upgrade problem

2011-10-02 Thread shiva
I recently updgraded to django 1.3. After the upgrade, I get the
following error whenever I used request.POST:

Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py",
line 86, in  get_response
response = None

File "/public/gdp/trunk/src/ukl/lis/process/utils/error_handler.py",
line 15, in __call__
return self.function(*args, **kwargs)

File "/usr/lib/python2.4/site-packages/django/views/decorators/
cache.py", line 30, in _cache_controlled
# and this:

File "/public/gdp/trunk/src/ukl/lis/process/authentication/views.py",
line 438, in login
form = loginForm(request.POST)

File "/usr/lib/python2.4/site-packages/django/core/handlers/
modpython.py", line 101, in _get_post
self._load_post_and_files()

AttributeError: 'ModPythonRequest' object has no attribute
'_load_post_and_files'

-- 
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 do some additional process while saving a django flatpage

2011-10-02 Thread Swaroop Shankar V
Hi,
I am trying to build a menu system which can be controlled at the admin
area. For the content management purpose i am using django flatpage. So when
a page is getting saved i need to insert the page title and url in the menu
table i have created. So i guess a flatpage signal is the best way to go,
but after searching a lot i could not find any such signals available for
flatpage. So which is the best approach to implement whatever i had
described above. Thanks
Regards,

Swaroop Shankar V

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



Re: `manage.py syncdb` fails, but what does the error mean?

2011-10-02 Thread christoffer.buchh...@gmail.com
I was too quick there, because just after sending the last email, I
found the problem. It seemed, that the copy of South, that Snowy
bundles in /lib/south, was the culprit. When I deleted it, and
installed south in my virtualenv instead, things started working.

Thank you for your help!

On Sun, Oct 2, 2011 at 8:27 AM, christoffer.buchh...@gmail.com
 wrote:
> All right. I have now tried renaming my virtualenv to Snowyv, so no
> mix-up would occur. That didn't solve the problem, the error is the
> same.
> I have not Snowy install globally. The only copy I have of Snowy, is
> the one I have in /home/cb/Projects/snowy. I also use virtualenv
> (/home/cb/.virtualenvs/snowy), so no mix-up should occur even if I
> did, but I don't.
>
> I can understand, from what've said, that some misunderstanding about
> the directories and such, is what is going on, but I don't think this
> is it, unfortunately.
>
> On Sun, Oct 2, 2011 at 6:11 AM, Ramiro Morales  wrote:
>> On Sat, Oct 1, 2011 at 8:06 AM, chrisbuchholz
>>  wrote:
>>> Hey,
>>>
>>> I have this django 1.2 app, Snowy[1], that I try to get to run locally. But
>>> everytime I do `manage.py syncdb` I get this[2] error, but I have no idea
>>> what it means.
>>>
>>> Snowy uses, by default django 1.2, python 2 and SQLite3, and at first, I
>>> thought it was because that django couldnt talk to SQLite3, but if I create
>>> a new django 1.2 app in a python 2 environment, it works fine, so that is
>>> not it.
>>>
>>> I have no idea what the error means, and the Snowy devs haven't been able to
>>> help me out either. I hope some of you guys can.
>>>
>>> [1]: http://git.gnome.org/browse/snowy
>>> [2]: http://paste.pocoo.org/show/485318/
>>
>> Your traceback shows you have a weird mixup of paths, both
>> /home/cb/.virtualenvs/snowy/ and /home/cb/Projects/snowy/
>> appear as locations of the snowy app.
>> Perhaps you created a virtualenv with a copy of the app
>> there but already have a global one?.
>>
>> Also, is seems the app ships a copy of several third party
>> django apps (like south) inside their lib/ subdir.
>>
>> --
>> Ramiro Morales
>>
>> --
>> 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: `manage.py syncdb` fails, but what does the error mean?

2011-10-02 Thread christoffer.buchh...@gmail.com
All right. I have now tried renaming my virtualenv to Snowyv, so no
mix-up would occur. That didn't solve the problem, the error is the
same.
I have not Snowy install globally. The only copy I have of Snowy, is
the one I have in /home/cb/Projects/snowy. I also use virtualenv
(/home/cb/.virtualenvs/snowy), so no mix-up should occur even if I
did, but I don't.

I can understand, from what've said, that some misunderstanding about
the directories and such, is what is going on, but I don't think this
is it, unfortunately.

On Sun, Oct 2, 2011 at 6:11 AM, Ramiro Morales  wrote:
> On Sat, Oct 1, 2011 at 8:06 AM, chrisbuchholz
>  wrote:
>> Hey,
>>
>> I have this django 1.2 app, Snowy[1], that I try to get to run locally. But
>> everytime I do `manage.py syncdb` I get this[2] error, but I have no idea
>> what it means.
>>
>> Snowy uses, by default django 1.2, python 2 and SQLite3, and at first, I
>> thought it was because that django couldnt talk to SQLite3, but if I create
>> a new django 1.2 app in a python 2 environment, it works fine, so that is
>> not it.
>>
>> I have no idea what the error means, and the Snowy devs haven't been able to
>> help me out either. I hope some of you guys can.
>>
>> [1]: http://git.gnome.org/browse/snowy
>> [2]: http://paste.pocoo.org/show/485318/
>
> Your traceback shows you have a weird mixup of paths, both
> /home/cb/.virtualenvs/snowy/ and /home/cb/Projects/snowy/
> appear as locations of the snowy app.
> Perhaps you created a virtualenv with a copy of the app
> there but already have a global one?.
>
> Also, is seems the app ships a copy of several third party
> django apps (like south) inside their lib/ subdir.
>
> --
> Ramiro Morales
>
> --
> 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.