Re: Problem template library loading

2010-03-13 Thread mrsource
Ok you're right now works!
I have confused clevercss with dlevercss...and I have forgotten that
Django module dlevercss requires clevercss python library.



On 13 Mar, 04:23, Karen Tracey <kmtra...@gmail.com> wrote:
> On Fri, Mar 12, 2010 at 11:37 AM, mrsource <mrsou...@gmail.com> wrote:
> > I have plugged dlevercss application to my Django project. In local
> > environment (windows xp - python 2.6) I have no errors, but in public
> > server (Ubuntu linux- python 2.5 - WSGI container), I get this error:
> > " 'dlevercss_tags' is not a valid tag library: Could not load template
> > library from django.templatetags.dlevercss_tags, No module named
> > clevercss"
>
> Sounds like the public server does not have clevercss installed. clevercss
> is imported by dlevercss_tags.py, and you'll get this error if that import
> fails.
>
> > The strange thing is that the template tag loaders try to load it from
> > django.templatetags module instead of his path. I placed dlevercss
> > module under site-packges folder and that path is included in the Path
> > variable as I can see from the Django debug output.
>
> The error message is misleading. The Django code actually attempts to load
> tag libraries from any templatetags module found under every application
> listed in INSTALLED_APPS. dlevercss_tags.py was found, the problem is the
> import of clevercss inside it is failing.
>
> Karen

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



Problem template library loading

2010-03-12 Thread mrsource
I have plugged dlevercss application to my Django project. In local
environment (windows xp - python 2.6) I have no errors, but in public
server (Ubuntu linux- python 2.5 - WSGI container), I get this error:
" 'dlevercss_tags' is not a valid tag library: Could not load template
library from django.templatetags.dlevercss_tags, No module named
clevercss"
The strange thing is that the template tag loaders try to load it from
django.templatetags module instead of his path. I placed dlevercss
module under site-packges folder and that path is included in the Path
variable as I can see from the Django debug output.

-- 
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: Need help getting the company I work for to go with django

2009-09-01 Thread mrsource

Two points:
- Django has good performance and scales well.
- It has many tools for safety, with a normal opensource CMS you have
many more issues with security holes because all the code is public.

On 1 Set, 18:52, "Rob B (uk)"  wrote:
> I work as a web developer at a reasonably large company in London. We
> are just about to completely re brand and rebuild the companies website
> (s) and implement a CMS.  I'm having a meeting tomorrow to discuss
> different avenues we can go down in regards to what technologies we
> can use.  I'm hoping to steer them towards Django!
>
> If you were me how would you sell Django to fellow developers and
> business (non-techies) people??
>
> The CMS will need to cope with million+ hits a month & have
> multilingual support.
>
> P.S. I know django isn't a CMS. I want to build a custom one using it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: how to use postgresql8.4 in django1.1

2009-09-01 Thread mrsource

I suppose that you have downloaded the latest version of psycopg2:
psycopg2-2.0.12.win32-py2.6-pg8.4.0-release.exe.
In that case use the previous release psycopg2-2.0.10.win32-py2.6-
pg8.3.7-release.exe that you can find here
http://stickpeople.com/projects/python/win-psycopg/index.2.0.9.html,
the 2.0.12 release is bugged.
I have the same environment configuration plus postgresql 8.4 and all
works well.

On 1 Set, 11:33, "tungliang.han...@gmail.com"
 wrote:
> hi,guys
> According to the django documents(http://docs.djangoproject.com/en/dev/
> topics/install/),I have downloaded the psycopg(http://stickpeople.com/
> projects/python/win-psycopg/) and switched the database in the
> settings. However,when I sync the database or run server,there are
> some error occurred.
> my OS is windows xp sp2,and python2.62. Django 1.1
> Thanks a million
>
> the error info:
> C:\hello>manage.py syncdb
> Traceback (most recent call last):
>   File "C:\hello\manage.py", line 11, in 
>     execute_manager(settings)
>   File "C:\Python26\lib\site-packages\django\core\management
> \__init__.py", line
> 362, in execute_manager
>     utility.execute()
>   File "C:\Python26\lib\site-packages\django\core\management
> \__init__.py", line
> 303, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "C:\Python26\lib\site-packages\django\core\management\base.py",
> line 195,
>  in run_from_argv
>     self.execute(*args, **options.__dict__)
>   File "C:\Python26\lib\site-packages\django\core\management\base.py",
> line 221,
>  in execute
>     self.validate()
>   File "C:\Python26\lib\site-packages\django\core\management\base.py",
> line 249,
>  in validate
>     num_errors = get_validation_errors(s, app)
>   File "C:\Python26\lib\site-packages\django\core\management
> \validation.py", lin
> e 22, in get_validation_errors
>     from django.db import models, connection
>   File "C:\Python26\lib\site-packages\django\db\__init__.py", line 41,
> in  e>
>     backend = load_backend(settings.DATABASE_ENGINE)
>   File "C:\Python26\lib\site-packages\django\db\__init__.py", line 17,
> in load_b
> ackend
>     return import_module('.base', 'django.db.backends.%s' %
> backend_name)
>   File "C:\Python26\lib\site-packages\django\utils\importlib.py", line
> 35, in im
> port_module
>     __import__(name)
>   File "C:\Python26\lib\site-packages\django\db\backends
> \postgresql_psycopg2\bas
> e.py", line 22, in 
>     raise ImproperlyConfigured("Error loading psycopg2 module: %s" %
> e)
> django.core.exceptions.ImproperlyConfigured: Error loading psycopg2
> module: DLL
> load failed:
--~--~-~--~~~---~--~~
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: A question about reverse url lookups for admin site in svn version

2009-07-19 Thread mrsource

Ok, I noted the same thing the reverse('admin:view_tree') works,
 then need a pattern to be named when self.admin_site.admin_view()
decorator is used?

On 19 Lug, 18:30, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Sun, Jul 19, 2009 at 6:03 AM, mrsource<mrsou...@gmail.com> wrote:
>
> > I'm using the current trunk version and I have a similar issue with
> > the reverse function:
>
> > - I defined a get_urls() method for one of my models whose I have
> > written a custom admin page.
> > - From my view I try to reverse one of this pattern with the "admin:"
> > prefix and it works but if I wrap the view callback with
> > self.admin_site.admin_view() decorator the reverse don't work and I
> > get a NoReverseMatch error.
>
> > Here the used codehttp://dpaste.com/hold/68763/
>
> > On 17 Lug, 23:32, Vasil Vangelovski <vvangelov...@gmail.com> wrote:
> >> Yeah, I was confused mostly about the stuff with the colon because I
> >> didn't pay much attention when reading about namespaced urls the new
> >> docs.
>
> >> Thanks
>
> >> On Fri, Jul 17, 2009 at 10:49 PM, Michael<newmani...@gmail.com> wrote:
> >> > On Fri, Jul 17, 2009 at 4:27 PM, Vasil Vangelovski 
> >> > <vvangelov...@gmail.com>
> >> > wrote:
>
> >> >> Sorry, it was probably my missunderstanding of some details in the
> >> >> docs. I changed the initialization of my admin site so it doesn't have
> >> >> a name and what I was trying to do works now. But anyway, if my admin
> >> >> site was initialized like so site = MyAdminSite('admin') what code is
> >> >> supposed to give me the url for it's index page?
>
> >> >> On Fri, Jul 17, 2009 at 9:48 PM, Vasil
> >> >> Vangelovski<vvangelov...@gmail.com> wrote:
> >> >> > Yes it does work, I've tried this with a brand new project in the same
> >> >> > virtualenv. Reverese resolution of urls for the AdminSite in
> >> >> > django.contrib.admin does work with the latest trunk revision.
> >> >> > Here's simplest situation where I'm having a problem:
>
> >> >> > I have an app called admin in my project which contains some
> >> >> > templatetags and a subcalss of AdminSite, you can see the relevant
> >> >> > code in this dpaste:
> >> >> >http://dpaste.com/68309/
> >> >> > The shell interaction is here:
> >> >> >http://dpaste.com/68303/
> >> >> > Note in my installed apps I have both my admin application and the
> >> >> > admin app from django.contrib.
> >> >> > The same shell interaction would work without a problem if I try it in
> >> >> > another project where I use just django.contrib.admin.sites.AdminSite
> >> >> > Note that changing the url regex for the admin from empty to
> >> >> > r'^admin/' doesn't change anything, it's like that because the django
> >> >> > project
> >> >> > is just an admin site for a larger project done in Java/Flex.
> >> >> > Thanks.
>
> >> > Tryreverse('admin:index ')
> >> > The colon is the new namespaces that were just added to the django
> >> > urlresolvers. Pretty exciting, huh?
> >> > FYI the admin uses 'admin' as the default app instance. I am not sure 
> >> > what
> >> > this will do if you have two apps that are named the same and try to
> >> >reverse. It might just be unpredictable as to which URL is going to be
> >> > returned or might throw an error. I am not sure. You might want to change
> >> > that to something else.
> >> > Hope that helps,
> >> > Michael
>
> That's because the view isn't named:
> admin:aureainfissi.catalogo.tree.tree_views.view_tree, it is named
> admin:view_tree.
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your
> right to say it." -- Voltaire
> "The people's good is the highest law." -- Cicero
> "Code can always be simpler than you think, but never as simple as you
> want" -- Me
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: A question about reverse url lookups for admin site in svn version

2009-07-19 Thread mrsource

I'm using the current trunk version and I have a similar issue with
the reverse function:

- I defined a get_urls() method for one of my models whose I have
written a custom admin page.
- From my view I try to reverse one of this pattern with the "admin:"
prefix and it works but if I wrap the view callback with
self.admin_site.admin_view() decorator the reverse don't work and I
get a NoReverseMatch error.

Here the used code http://dpaste.com/hold/68763/



On 17 Lug, 23:32, Vasil Vangelovski  wrote:
> Yeah, I was confused mostly about the stuff with the colon because I
> didn't pay much attention when reading about namespaced urls the new
> docs.
>
> Thanks
>
> On Fri, Jul 17, 2009 at 10:49 PM, Michael wrote:
> > On Fri, Jul 17, 2009 at 4:27 PM, Vasil Vangelovski 
> > wrote:
>
> >> Sorry, it was probably my missunderstanding of some details in the
> >> docs. I changed the initialization of my admin site so it doesn't have
> >> a name and what I was trying to do works now. But anyway, if my admin
> >> site was initialized like so site = MyAdminSite('admin') what code is
> >> supposed to give me the url for it's index page?
>
> >> On Fri, Jul 17, 2009 at 9:48 PM, Vasil
> >> Vangelovski wrote:
> >> > Yes it does work, I've tried this with a brand new project in the same
> >> > virtualenv. Reverese resolution of urls for the AdminSite in
> >> > django.contrib.admin does work with the latest trunk revision.
> >> > Here's simplest situation where I'm having a problem:
>
> >> > I have an app called admin in my project which contains some
> >> > templatetags and a subcalss of AdminSite, you can see the relevant
> >> > code in this dpaste:
> >> >http://dpaste.com/68309/
> >> > The shell interaction is here:
> >> >http://dpaste.com/68303/
> >> > Note in my installed apps I have both my admin application and the
> >> > admin app from django.contrib.
> >> > The same shell interaction would work without a problem if I try it in
> >> > another project where I use just django.contrib.admin.sites.AdminSite
> >> > Note that changing the url regex for the admin from empty to
> >> > r'^admin/' doesn't change anything, it's like that because the django
> >> > project
> >> > is just an admin site for a larger project done in Java/Flex.
> >> > Thanks.
>
> > Tryreverse('admin:index ')
> > The colon is the new namespaces that were just added to the django
> > urlresolvers. Pretty exciting, huh?
> > FYI the admin uses 'admin' as the default app instance. I am not sure what
> > this will do if you have two apps that are named the same and try to
> >reverse. It might just be unpredictable as to which URL is going to be
> > returned or might throw an error. I am not sure. You might want to change
> > that to something else.
> > Hope that helps,
> > 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: Overrding queryset on a field in form generated with ModelForm

2009-02-07 Thread mrsource

Solved, I corrected the __init__ method with this:

def __init__(self,  *args,  **kwargs):
super(CategoriaForm,self).__init__(*args,**kwargs);
if kwargs.has_key('instance'):
self.fields['parent'].queryset = Categoria.objects.exclude
(parent=kwargs['instance'].id).exclude(id=kwargs['instance'].id)

On Feb 5, 10:11 am, mrsource <mrsou...@gmail.com> wrote:
> Maybe I missing some step:
> I trying to set up the the automatic admin page form to edit a
> category tree builded withtreebeardextension:
> #Model:
> class Categoria(AL_Node,Componente):
>     immagine = fields.ImageWithThumbnailsField
> (upload_to=Componente.image_path + 'categorie/',
>                                                thumbnail={'size':
> (100, 60),'options': ['crop', 'upscale'],},
>                                                help_text =
> Componente.image_help_text,
>
> blank=True,default=Componente.noimage_logo)
>     parent = models.ForeignKey('self',
>                                related_name='children_set',
>                                null=True,
>                                db_index=True)
>     node_order_by = ['data_creazione']
>     class Meta:
>         verbose_name = 'Categoria'
>         verbose_name_plural = 'Categorie'
>
> but the I would exclude some elements from the foreign key choice
> widget as itself object id and its descendants:
> First I tried this to exclude the element that I editing:
>
> #admin.py
>  class CategoriaForm(forms.ModelForm):
>     class Meta:
>         model = Categoria
>     def __init__(self,  *args,  **kwargs):
>         super(CategoriaForm,self).__init__(self,  *args,  **kwargs);
>         self.fields['parent'].queryset = Categoria.objects.filter
> ('id'<>kwargs['instance'].id)
>
> but I get this error in the Categoria admin editing page:
>
> Exception Type:              TypeError
> Exception Value:             'bool' object is not iterable
> Exception Location:     D:\codice\workspace\django\django\db\models\sql
> \query.py in add_filter, line 1101
--~--~-~--~~~---~--~~
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: Overrding queryset on a field in form generated with ModelForm

2009-02-05 Thread mrsource

Maybe I missing some step:
I trying to set up the the automatic admin page form to edit a
category tree builded with treebeard extension:
#Model:
class Categoria(AL_Node,Componente):
immagine = fields.ImageWithThumbnailsField
(upload_to=Componente.image_path + 'categorie/',
   thumbnail={'size':
(100, 60),'options': ['crop', 'upscale'],},
   help_text =
Componente.image_help_text,
 
blank=True,default=Componente.noimage_logo)
parent = models.ForeignKey('self',
   related_name='children_set',
   null=True,
   db_index=True)
node_order_by = ['data_creazione']
class Meta:
verbose_name = 'Categoria'
verbose_name_plural = 'Categorie'

but the I would exclude some elements from the foreign key choice
widget as itself object id and its descendants:
First I tried this to exclude the element that I editing:

#admin.py
 class CategoriaForm(forms.ModelForm):
class Meta:
model = Categoria
def __init__(self,  *args,  **kwargs):
super(CategoriaForm,self).__init__(self,  *args,  **kwargs);
self.fields['parent'].queryset = Categoria.objects.filter
('id'<>kwargs['instance'].id)

but I get this error in the Categoria admin editing page:

Exception Type:  TypeError
Exception Value: 'bool' object is not iterable
Exception Location: D:\codice\workspace\django\django\db\models\sql
\query.py in add_filter, line 1101
--~--~-~--~~~---~--~~
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: Custom inline form

2008-12-02 Thread mrsource

I find the problem:
The validation was performed also on new extra widget because I have
added a field that was always valorized then the self.has_changed
property was always true then the validation was performed also for
the new extra widget. Now the field is empty by default.

But now another problem, I would override the save_model method for
the inline model to read the value of my custom widget. The problem is
that if I put the save_model in ModelInline or in ModelAdmin class it
is never executed...How can I read the property from my custom widget?


mrsource ha scritto:

> In the inline model option I have overriden the inline form with a
> custom form where I only added a choices widget, now the validation
> has a wrong behaviour...more precisely if I have set extra property to
> 2 in inline model options, when I click "Save" django try to validate
> even the two empty extra inline model that I have left blank and show
> an error like "the primary key field must not be empty"... If I remove
> my custom form all is ok.
>
> How can I avoid this validation on the empty extra filed?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Custom inline form

2008-12-01 Thread mrsource


In the inline model option I have overriden the inline form with a
custom form where I only added a choices widget, now the validation
has a wrong behaviour...more precisely if I have set extra property to
2 in inline model options, when I click "Save" django try to validate
even the two empty extra inline model that I have left blank and show
an error like "the primary key field must not be empty"... If I remove
my custom form all is ok.

How can I avoid this validation on the empty extra filed?
--~--~-~--~~~---~--~~
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: m2m relationship by intermediary model and inline editing

2008-11-30 Thread mrsource

Ok, Solved!! It wasmy fault because I have overwritten the form widget
in the inline model.
Now I have removed the customized form.

On Nov 29, 11:16 pm, mrsource <[EMAIL PROTECTED]> wrote:
> I have models and admin configuration like these:http://dpaste.com/94671/
>
> when I edit the model "composizione" the first foreign key
> (composizione) field of "through" model is automatically valorized by
> the parent model, and the second (articolo) is user selected. The
> problem is that if I don't valorize the second filed (articolo),and I
> edit only the parent model, I get an empty field error validation on
> the extra inline model.
> Can I escape this validation ? Or is not possible to use inline
> editing when I have an intermediary model?
> If I put blank=True in the field articolo of intermediary model I get
> another error because the foreign key must be not blank.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



m2m relationship by intermediary model and inline editing

2008-11-29 Thread mrsource

I have models and admin configuration like these:
http://dpaste.com/94671/

when I edit the model "composizione" the first foreign key
(composizione) field of "through" model is automatically valorized by
the parent model, and the second (articolo) is user selected. The
problem is that if I don't valorize the second filed (articolo),and I
edit only the parent model, I get an empty field error validation on
the extra inline model.
Can I escape this validation ? Or is not possible to use inline
editing when I have an intermediary model?
If I put blank=True in the field articolo of intermediary model I get
another error because the foreign key must be not blank.
--~--~-~--~~~---~--~~
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: Which IDE do you choose with django?

2008-10-13 Thread mrsource

I'm using eclipse because I also work on JAVA and I didn't want to
learn another editor for python.
Are Komodo or Eric 4 able to hot replace code in the debug mode? Pydev
can't do that.

On 12 Ott, 23:22, "Rob Sutherland" <[EMAIL PROTECTED]> wrote:
> On Sun, Oct 12, 2008 at 3:01 PM, Tim Chase
>
> <[EMAIL PROTECTED]> wrote:
> > Emacs is your thing, that would do, as would any other good
> > text-editor (some folks swear by TextMate or Notepad++).
>
>  I use Komodo Editor 
> -http://www.activestate.com/Products/komodo_ide/komodo_edit.mhtml- I
> find that in combination with using the dejngo development server and
> import pdb; pdb.set_trace() you can have a pretty solid edit and debug
> environment without too much learning curve.
>
> > Some folks do use Eclipse (with the Python plugin) for their
> > needs, but I've found that overkill for my simple needs (and my
> > underpowered home machine(s))
>
> Amen to that :-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Which IDE do you choose with django?

2008-10-12 Thread mrsource

I'm using Eclipse with WTP (Web Tool Platform) and Pydev plugins.
The eclipse debug interface is very powerful.

On 12 Ott, 18:19, zjffdu <[EMAIL PROTECTED]> wrote:
> I am a newbie of django, and want to know which IDE is suit for
> django?
>
> thank your
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Extend a field of an abstract model

2008-10-12 Thread mrsource

I have defined an abstract Model with some fields:

class Componente(models.Model):
name = models.CharField(max_length=80,unique=True)
description = models.TextField(blank=True)
class Meta:
abstract = True

and then in the derived class I would to define verbose_name property
for some field of the super Model:

class Pagina(Componente):
# Stuff to set verbose_name of fileds "name" and "description "
class Meta:
verbose_name = 'Pagina statica'
verbose_name_plural = 'Pagine statiche'

I have tried to put some stuff in __init__ function with no success...
--~--~-~--~~~---~--~~
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: Serving static file on Windows

2008-10-04 Thread mrsource

You're right...the ADMIN_MEDIA_PREFIX is routed before MEDIA_URL.
Changing one of them has solved my issue.
Carlo


On 4 Ott, 21:34, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Sat, Oct 4, 2008 at 3:19 PM, mrsource <[EMAIL PROTECTED]> wrote:
>
> > I can upload images on the right place in the file system, but then
> > django don't serve them.
> > I'm using the development server and the current SVN version of
> > django.
>
> > I have this configuration in settings.py:
> > MEDIA_ROOT = 'D:/codice/workspace/aurea/media/'
> > MEDIA_URL = '/media/'
> > ADMIN_MEDIA_PREFIX = '/media/'
>
> Do not use the same value for MEDIA_URL and ADMIN_MEDIA_PREFIX, as noted
> here:
>
> http://docs.djangoproject.com/en/dev/ref/settings/#admin-media-prefix
>
> When you do this the admin media server built into the development server
> handles everything under /media/, and the static server you have configured
> in urls.py never sees the requests.
>
> Karen
>
>
>
> > and in url.py:
>
> > from django.conf import settings
> > if settings.DEBUG
> >    urlpatterns += patterns('django.views.static',
> >    (r'^media/(?P.*)$',
> >        'serve', {
> >        'document_root':settings.MEDIA_ROOT,
> >        'show_indexes': True }),)
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Serving static file on Windows

2008-10-04 Thread mrsource

I can upload images on the right place in the file system, but then
django don't serve them.
I'm using the development server and the current SVN version of
django.

I have this configuration in settings.py:
MEDIA_ROOT = 'D:/codice/workspace/aurea/media/'
MEDIA_URL = '/media/'
ADMIN_MEDIA_PREFIX = '/media/'


and in url.py:

from django.conf import settings
if settings.DEBUG
urlpatterns += patterns('django.views.static',
(r'^media/(?P.*)$',
'serve', {
'document_root':settings.MEDIA_ROOT,
'show_indexes': True }),)


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