Re: How force DJANGo choice MEDIA_URL or STATIC_URL in template?

2016-03-02 Thread setivolkylany
-- And all worked Thanks среда, 2 марта 2016 г., 1:41:28 UTC+2 пользователь James Schneider написал: > > >> I need choice base url MEDIA_URL (/media/) - for uploaded user picture, >> or STATIC_URL (/static/) - picture by default >> >> I am try nex

Re: How force DJANGo choice MEDIA_URL or STATIC_URL in template?

2016-03-01 Thread James Schneider
> > > I need choice base url MEDIA_URL (/media/) - for uploaded user picture, or > STATIC_URL (/static/) - picture by default > > I am try next: > > p> alt="picture_for_{{ account.name }}" id="account_picture"> > > , but result is MEDIA_URL

Re: How force DJANGo choice MEDIA_URL or STATIC_URL in template?

2016-03-01 Thread Seti Volkylany
{% load static %} > {% static "images/default_pic.jpg" as default_pic %} > {{ account.accountuserinfo.picture|default:default_pic }} > > Cheers > > On Monday, February 29, 2016 at 10:49:53 PM UTC+1, setivo...@gmail.com > wrote: >> >> >> I need

Re: How force DJANGo choice MEDIA_URL or STATIC_URL in template?

2016-03-01 Thread Jonas Svensson
+1, setivo...@gmail.com wrote: > > > I need choice base url MEDIA_URL (/media/) - for uploaded user picture, or > STATIC_URL (/static/) - picture by default > > I am try next: > > p> alt="picture_for_{{ account.name }}" id="account_picture"> > >

How force DJANGo choice MEDIA_URL or STATIC_URL in template?

2016-02-29 Thread setivolkylany
I need choice base url MEDIA_URL (/media/) - for uploaded user picture, or STATIC_URL (/static/) - picture by default I am try next: p> , but result is MEDIA_URL(STATIC_URL) and path to file. I am next try: {% templatetag openvariable %} url 'entry_list' {% templatetag closevaria

Re: Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

2015-08-30 Thread Dennis Marwood
Ok, thanks. It seems like such a common use case that I wanted to be sure there was not an existing template tag for it. On Sunday, 30 August 2015 14:48:47 UTC-7, Christophe Pettus wrote: > > > On Aug 30, 2015, at 2:37 PM, Christophe Pettus > wrote: > > > On Aug 30, 2015,

Re: Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

2015-08-30 Thread Christophe Pettus
On Aug 30, 2015, at 2:37 PM, Christophe Pettus wrote: > On Aug 30, 2015, at 12:43 PM, Dennis Marwood wrote: > >> How do I get the template to treat {{ }} in my entry as a variable? > > The Django template language doesn't iterate over the results

Re: Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

2015-08-30 Thread Christophe Pettus
On Aug 30, 2015, at 12:43 PM, Dennis Marwood wrote: > How do I get the template to treat {{ }} in my entry as a variable? The Django template language doesn't iterate over the results of expansion; once a substitution is done, it moves on. So, template language

Re: Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

2015-08-30 Thread Dennis Marwood
this: > > from django.conf import MEDIA_URL > > > 2015-08-30 20:43 GMT+01:00 Dennis Marwood <dennis...@gmail.com > >: > >> Hello, >> >> I have a seemingly straight forward and likely common issue. But there is >> no obvious way that I am seeing to make it

Re: Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

2015-08-30 Thread monoBOT
You can import your any part of your settings into the model.py file and then insert it like this: from django.conf import MEDIA_URL 2015-08-30 20:43 GMT+01:00 Dennis Marwood <dennismarw...@gmail.com>: > Hello, > > I have a seemingly straight forward and like

Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

2015-08-30 Thread Dennis Marwood
to display my blog post like {% for post in posts %} {{ post.entry }} {% endfor %} But the template does not process {{ MEDIA_URL }}. It just sees it as a string and prints it exactly as passed in. How do I get the template to treat {{ }} in my entry as a variable? How can I get that value

Re: MEDIA_URL doesnt work in windows but works on linux

2015-04-14 Thread Stephen J. Butler
be I need to simplify my question. > > > how do I use media_url in windows? > > > > > > > On Wednesday, April 8, 2015 at 10:56:27 AM UTC-5, dk wrote: >> >> in my settings >> MEDIA_ROOT = os.path.join(BASE_DIR, 'media') >> MEDIA_URL = "/m

Re: MEDIA_URL doesnt work in windows but works on linux

2015-04-14 Thread dk
maybe I need to simplify my question. how do I use media_url in windows? On Wednesday, April 8, 2015 at 10:56:27 AM UTC-5, dk wrote: > in my settings > MEDIA_ROOT = os.path.join(BASE_DIR, 'media') > MEDIA_URL = "/media/" > > > my view to accept files

MEDIA_URL doesnt work in windows but works on linux

2015-04-08 Thread dk
in my settings MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_URL = "/media/" my view to accept files. def request_page(request): #todo since sqlite my get stuck between 2 submittion at the same time, # submit, if it cant try again and then message that ask the user to try

Re: AW: MEDIA_URL not treated like static

2011-03-28 Thread galgal
Thanks, I didn't know that. All works fine now. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to

Re: AW: MEDIA_URL not treated like static

2011-03-28 Thread Amao Zhao
Dear galgal: according to the django docs for 1.3, The most likely example is user-uploaded content in MEDIA_ROOT . staticfiles is intended for static assets and has no built-in handling for user-uploaded files, but you

Re: AW: MEDIA_URL not treated like static

2011-03-28 Thread galgal
I forgot to tell I'm using Django 1.3. In that case - how to make it work with separate dirs? Or it can't be done on dev server? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

AW: MEDIA_URL not treated like static

2011-03-28 Thread Szabo, Patrick (LNG-VIE)
I have a static folder in my Prject and my MEDIA_URL looks like this: http://127.0.0.1:8000/static/ Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im Auftrag von galgal Gesendet: Montag, 28. März 2011 13:38 An: django-users@googlegroups.com Betreff: MEDIA_URL

MEDIA_URL not treated like static

2011-03-28 Thread galgal
I have that dirs structure: site_media/ | ---> static/ | ---> uploads/ static dir is set as STATIC_URL = '/site_media/static/' uploads dir is set as MEDIA_URL = '/site_media/uploads/' In that case on dev server (localhost:8000) media_url is not accessible via browser as

Re: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-28 Thread Lee Connell
Thanks everyone, the problem was indeed not using the RequestContext, using Context does not automatically include some useful variables which are retrieved from TEMPLATE_CONTEXT_PROCESSORS that includes MEDIA_URL as stated above. Thanks again! On Dec 28, 5:31 pm, dmitry b <dmitry

Re: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-28 Thread dmitry b
; and it did not help, MEDIA_URL is still blank. I am using django 1.2.1 > on windows. > > On Dec 28, 12:56 am, Kenneth Gonsalves <law...@thenilgiris.com> wrote: > > > > > > > > > On Mon, 2010-12-27 at 08:03 -080

Re: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-28 Thread Daniel Roseman
On Tuesday, December 28, 2010 3:02:44 PM UTC, Lee Connell wrote: > > I didn't have TEMPLATE_CONTEXT_PROCESSORS at all, I copied the code > and it did not help, MEDIA_URL is still blank. I am using django 1.2.1 > on windows. > You don't actually need to specify TEMPLATE_CON

Re: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-28 Thread easylancer
Post your settings.py in a pastebin and add a link to it here. Remove all sensitive data before posting it. On Dec 28, 3:02 pm, Lee Connell <lee.a.conn...@gmail.com> wrote: > I didn't have TEMPLATE_CONTEXT_PROCESSORS at all, I copied the code > and it did not help, MEDIA_URL is still

Re: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-28 Thread Lee Connell
I didn't have TEMPLATE_CONTEXT_PROCESSORS at all, I copied the code and it did not help, MEDIA_URL is still blank. I am using django 1.2.1 on windows. On Dec 28, 12:56 am, Kenneth Gonsalves <law...@thenilgiris.com> wrote: > On Mon, 2010-12-27 at 08:03 -0800, easylan

Re: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-28 Thread Kenneth Gonsalves
On Mon, 2010-12-27 at 08:03 -0800, easylancer wrote: > TEMPLATE_CONTEXT_PROCESSORS = ( > 'django.contrib.auth.context_processors.auth', > 'django.core.context_processors.debug', > 'django.core.context_processors.i18n', > 'django.core.context_processors.media', >

Re: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-27 Thread easylancer
', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.contrib.messages.context_processors.messages', 'django.core.context_processors.request', ) On Dec 27, 3:17 pm, Lee Connell <lee.a.conn...@gmail.com> wrote: > I have my media url and root set: > > MEDI

Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-27 Thread Lee Connell
I have my media url and root set: MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'media') This is what my template has: Postfix Log Viewer The {{ MEDIA_URL }} shows up blank -- You received this message because you

Re: do we need MEDIA_ROOT and MEDIA_URL anymore?

2010-11-17 Thread Adam V.
On Nov 17, 2:07 am, MiratCanBayrak <miratcanbay...@gmail.com> wrote: > Hi, > > I understood that in new version of django we are using > STATICFILES_ROOT and STATICFILES_URL instead OF MEDIA_ROOT and > MEDIA_URL. > > But when i look at settings.py i see both of them. W

do we need MEDIA_ROOT and MEDIA_URL anymore?

2010-11-17 Thread MiratCanBayrak
Hi, I understood that in new version of django we are using STATICFILES_ROOT and STATICFILES_URL instead OF MEDIA_ROOT and MEDIA_URL. But when i look at settings.py i see both of them. When do we use MEDIA? when do we use STATICFILES ? Note: pls dont give link to docs i already read them

Re: Using localhost in MEDIA_URL causing very slow django

2010-08-16 Thread Steve Holden
ke like 10 minutes for it to load. The code didn't even reach > the view. I tracked the problem down to the use of MEDIA_URL in my > base.html. I looked at my MEDIA_URL setting and it was set to > http://localhost:8000/media/. Since I'm using http://127.0.0.1:8000/ > to access the pag

Using localhost in MEDIA_URL causing very slow django

2010-08-16 Thread Martin Lundberg
the problem down to the use of MEDIA_URL in my base.html. I looked at my MEDIA_URL setting and it was set to http://localhost:8000/media/. Since I'm using http://127.0.0.1:8000/ to access the page I tried changing the setting to 127.0.0.1 as well and for some reason the problem went away. I'm

[Solved] Re: Not reflecting MEDIA_URL value

2010-07-20 Thread barun
x(request): > >         return render_to_response('base.html', {}) > > You have to pass through a RequestContext() for the template context > processor that injects MEDIA_URL > ('django.core.context_processors.media') into to the template to kick > in, and you h

Re: Not reflecting MEDIA_URL value

2010-07-20 Thread David De La Harpe Golden
On 20/07/10 12:11, barun wrote: > > [gallery/views.py] > def index(request): > return render_to_response('base.html', {}) > You have to pass through a RequestContext() for the template context processor that injects MEDIA_URL ('django.core.context_processors.media') into

Not reflecting MEDIA_URL value

2010-07-20 Thread barun
(where I'm using {{ MEDIA_URL }} to denote the path of the image), the value of the variable MEDIA_URL is not getting substituted -- it appears as blank. For example, with the following settings: [photo/settings.py] DEBUG = True MEDIA_ROOT = '/home/barun/codes/python/django/test/photo/media

Re: context porcessors request.context media_url breaks admin

2010-07-08 Thread Rolando Espinoza La Fuente
On Thu, Jul 8, 2010 at 8:21 AM, justin jools <justinjo...@gmail.com> wrote: > Wow... django docs can be so confusing... > > I could not believe it worked just by using upper case MEDIA_URL {{ MEDIA_URL }} is already present in the templates because the django.core.context_p

Re: context porcessors request.context media_url breaks admin

2010-07-08 Thread justin jools
Wow... django docs can be so confusing... I could not believe it worked just by using upper case MEDIA_URL Thanks so much :) :) I spent a day trying figure this out... On 8 July, 13:14, Daniel Roseman <dan...@roseman.org.uk> wrote: > On Jul 8, 12:57 pm, justin jools <justinjo.

Re: context porcessors request.context media_url breaks admin

2010-07-08 Thread justin jools
The 2 methods of using media_url with generic views I have tried: 1. http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/ This knocked out my admin, but media_url did work 2. using templatetags yourApp/templatetags/media_url.py: from django.template import Library

Re: context porcessors request.context media_url breaks admin

2010-07-08 Thread Daniel Roseman
On Jul 8, 12:57 pm, justin jools <justinjo...@gmail.com> wrote: > Thank for your quick response Daniel. > I'm just confused about using media_url with generic views, I have > done it previously with: > > from django.conf import settings        # for media_url > media_

Re: context porcessors request.context media_url breaks admin

2010-07-08 Thread justin jools
Thank for your quick response Daniel. I'm just confused about using media_url with generic views, I have done it previously with: from django.conf import settings# for media_url media_url = settings.MEDIA_URL def dblist(request): obj_list_menu = dbModel1.objects.all() return

Re: context porcessors request.context media_url breaks admin

2010-07-08 Thread Daniel Roseman
he RequestContext, which means they automatically gain access to all the existing context processors - including the default "django.core.context_processors.media" processor. So, all generic views *already* have access to MEDIA_URL. -- DR. -- You received this message because you are

Re: context porcessors request.context media_url breaks admin

2010-07-08 Thread justin jools
t the error is > > being caused by setting of context processors to media_url (see > > original post). > > When context processors are active the {media_url} tag works > > perfectly, but breaks the admin. > > > If I comme

Re: context porcessors request.context media_url breaks admin

2010-06-29 Thread Daniel Roseman
On Jun 29, 1:41 pm, justin jools <justinjo...@gmail.com> wrote: > Hi Tom if you read my original post you will realise that the error is > being caused by setting of context processors to media_url (see > original post). > When context processors are active the {media_url} tag

Re: context porcessors request.context media_url breaks admin

2010-06-29 Thread justin jools
Hi Tom if you read my original post you will realise that the error is being caused by setting of context processors to media_url (see original post). When context processors are active the {media_url} tag works perfectly, but breaks the admin. If I comment out : settings.py

Re: context porcessors request.context media_url breaks admin

2010-06-29 Thread Tom Evans
On Tue, Jun 29, 2010 at 12:33 PM, justin jools <justinjo...@gmail.com> wrote: > I corrected my settings.py links: > > TEMPLATE_DIRS = 'C:/django/portfolio_root/templates/' > MEDIA_ROOT = 'C:/django/portfolio_root/site-media/' > MEDIA_URL = '/site-media/' > ADMIN_MEDIA_PREF

Re: context porcessors request.context media_url breaks admin

2010-06-29 Thread justin jools
I corrected my settings.py links: TEMPLATE_DIRS = 'C:/django/portfolio_root/templates/' MEDIA_ROOT = 'C:/django/portfolio_root/site-media/' MEDIA_URL = '/site-media/' ADMIN_MEDIA_PREFIX = '/media/' but I still get this error: TemplateSyntaxError at /admin/ Caught an exception while rendering

Re: context porcessors request.context media_url breaks admin

2010-06-29 Thread justin jools
Yes I did accidentally set my ADMIN_MEDIA_PREFIX = '/site-media/' instead of media I'll try this On Jun 29, 8:57 am, bruno desthuilliers <bruno.desthuilli...@gmail.com> wrote: > On 29 juin, 00:44, justin jools <justinjo...@gmail.com> wrote: > > > > > &g

Re: context porcessors request.context media_url breaks admin

2010-06-29 Thread bruno desthuilliers
On 29 juin, 00:44, justin jools <justinjo...@gmail.com> wrote: > I am trying to use media_url with generic views: > When I set context processors to media_url, with generic views it > breaks Admin: > > Caught an exception while rendering: user > > settings.py &g

context porcessors request.context media_url breaks admin

2010-06-28 Thread justin jools
I am trying to use media_url with generic views: When I set context processors to media_url, with generic views it breaks Admin: Caught an exception while rendering: user settings.py TEMPLATE_CONTEXT_PROCESSORS = ('portfolio.context_processors.media_url',) context_processors.py def media_url

Re: Problem with static files (MEDIA_URL and MEDIA_ROOT)

2010-06-28 Thread nadae ivar badio
Hi do you speack french? 2010/6/27 Denis Ricardo <dnsrica...@gmail.com> > Hello people! I am having any problems with static files (images, CSS) > in Django. I configured the MEDIA_URL and MEDIA_ROOT in settings.py > and when I execute the server and I go see the webpage, the

Re: Problem with static files (MEDIA_URL and MEDIA_ROOT)

2010-06-27 Thread Graham Dumpleton
On Jun 27, 10:53 pm, Denis Ricardo <dnsrica...@gmail.com> wrote: > Hello people! I am having any problems with static files (images, CSS) > in Django. I configured the MEDIA_URL and MEDIA_ROOT in settings.py > and when I execute the server and I go see the webpage, the static

Problem with static files (MEDIA_URL and MEDIA_ROOT)

2010-06-27 Thread Denis Ricardo
Hello people! I am having any problems with static files (images, CSS) in Django. I configured the MEDIA_URL and MEDIA_ROOT in settings.py and when I execute the server and I go see the webpage, the static files doesn't are encountered (the page stay without anything). Screen Shot of my page

Re: Using array of URLs for MEDIA_URL

2010-06-11 Thread Martin Siniawski
Alex, Thanks for the answer. I tried doing something like the first thing you proposed (MEDIA_URL as a callable) but I had to tweak it a little bit because the template wasn't calling the callable, but rather printing 'function object .'. What do you think of the solution I posted? Best

Re: Using array of URLs for MEDIA_URL

2010-06-11 Thread Martin Siniawski
__unicode__(self): self.current_url += 1 self.current_url %= len(self.media_urls) return self.media_urls[self.current_url] def context_proc (req): return {'MEDIA_URL': RoundRobinMediaUrl()} On Jun 11, 3:09 pm, Martin Siniawski <msi...@gmail.com> wrote: > Steven, &

Re: Using array of URLs for MEDIA_URL

2010-06-11 Thread Martin Siniawski
--- > from django import template > from random import choice > > register = template.Library() > > defmedia_url(): >     media_urls = ['site1.example.com', 'site2.example.com', > 'site3.example.com'] >     return choice(media_urls) > register.simple_tag(media_url)

Re: Using array of URLs for MEDIA_URL

2010-06-08 Thread Alex Robbins
nswer. > > If I understand correctly your idea and code, each template would have > only one value for the MEDIA_URL (randomly chosen from the array), > right? > > What I was looking for was a way of distributing the value of the > MEDIA_URL uniformly along the values of an array,

Re: Using array of URLs for MEDIA_URL

2010-06-08 Thread Steven L Smith
Looks like my email client screwed up the indentation I've added some indents... random_media.py - from django import template from random import choice register = template.Library() def media_url(): media_urls = ['site1.example.com', 'site2.example.com

Re: Using array of URLs for MEDIA_URL

2010-06-08 Thread Steven L Smith
random_media.py - from django import template from random import choice register = template.Library() def media_url(): media_urls = ['site1.example.com', 'site2.example.com', 'site3.example.com'] return choice(media_urls) register.simple_tag(media_url) in some

Re: Using array of URLs for MEDIA_URL

2010-06-08 Thread Martin Siniawski
Steve, Thanks for the answer. If I understand correctly your idea and code, each template would have only one value for the MEDIA_URL (randomly chosen from the array), right? What I was looking for was a way of distributing the value of the MEDIA_URL uniformly along the values of an array

Re: Using array of URLs for MEDIA_URL

2010-06-07 Thread Steven L Smith
Hi Martin- I don't know what the "official" answer would be, but you could write your own context processor that had something like: from random import choice MEDIA_URLS = 'static1.site.com', 'static2.site.com', 'static3.site.com' ] def media(request): return {'MEDIA_UR

Using array of URLs for MEDIA_URL

2010-06-07 Thread Martin Siniawski
Hey guys, I wanted to ask if there's any way or accepted solution for using more than one URL simultaneously as the MEDIA_URL, so as to enable browsers to further parallelize the download of static content. That is, having something like: MEDIA_URL = [ 'static1.site.com', 'static2.site.com

Re: MEDIA_URL is not pushed to templates

2010-03-15 Thread Bobby Roberts
ah... my media processor got shot somehow On Mar 15, 7:51 pm, Bobby Roberts <tchend...@gmail.com> wrote: > hi group... got a strange situation.  MEDIA_URL is not being pushed to > the templates for some reason. > > In my settings file i have >

MEDIA_URL is not pushed to templates

2010-03-15 Thread Bobby Roberts
hi group... got a strange situation. MEDIA_URL is not being pushed to the templates for some reason. In my settings file i have MEDIA_URL='/static/' ... TEMPLATE_CONTEXT_PROCESSORS=( 'django.core.context_processors.request',) and in the template i am specifying it as {{MEDIA_URL}} however

media_url tute

2009-11-13 Thread Mike Dewhirst
I have looked at the django docs (http://docs.djangoproject.com/en/dev/topics/forms/media/) which painstakingly describe how to set up MEDIA_ROOT and MEDIA_URL. Does anyone know of a tutorial or other docco which covers the topic? Thanks Mike -- You received this message because you

Re: accessing media_url in javascript

2009-10-05 Thread Daniel Roseman
On Oct 5, 10:34 pm, "neri...@gmail.com" <neri...@gmail.com> wrote: > I was interested in finding out how I would go about accessing django > vars in my javascript file i.e., media_url within javascript. Do I > need to use a serializer to achieve this? > > Thank

accessing media_url in javascript

2009-10-05 Thread neri...@gmail.com
I was interested in finding out how I would go about accessing django vars in my javascript file i.e., media_url within javascript. Do I need to use a serializer to achieve this? Thanks, Jason --~--~-~--~~~---~--~~ You received this message because you

Re: admin running in dev mode (manage.py runserver) ignores MEDIA_URL

2009-08-14 Thread physicsnick
, Aljosa Mohorovic <aljosa.mohoro...@gmail.com> wrote: > settings.py: > MEDIA_ROOT = "%s/media" % PROJECT_ROOT # set to media folder in > project root > MEDIA_URL = '/media/' > ADMIN_MEDIA_PREFIX = '/media/admin/' > > urls.py > if settings.DEBUG: >   urlp

admin running in dev mode (manage.py runserver) ignores MEDIA_URL

2009-08-14 Thread Aljosa Mohorovic
settings.py: MEDIA_ROOT = "%s/media" % PROJECT_ROOT # set to media folder in project root MEDIA_URL = '/media/' ADMIN_MEDIA_PREFIX = '/media/admin/' urls.py if settings.DEBUG: urlpatterns += patterns('', (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.

Re: MEDIA_URL MEDIA_ROOT

2009-07-30 Thread cootetom
t; 2. > I can't download the files, probably I don't understand the MEDIA_URL > parameter. Here it is: > MEDIA_URL = 'http://localhost:8000/wiz/uploads/' > > but trying to access the files returns me a 404 error. > > I can workaround this configuring urls.py f

Re: MEDIA_URL MEDIA_ROOT

2009-07-30 Thread Xiong Chiamiov
On Jul 30, 3:38 am, Salvatore Leone <salvatore.le...@isti.cnr.it> wrote: > I can't download the files, probably I don't understand the MEDIA_URL > parameter. Here it is: > MEDIA_URL = 'http://localhost:8000/wiz/uploads/' > > but trying to access the files returns me a 404

MEDIA_URL MEDIA_ROOT

2009-07-30 Thread Salvatore Leone
= models.FileField(upload_to='user_files') # other stuff why all of the files are stored in 'uploads' and not in 'uploads/user_files/'? 2. I can't download the files, probably I don't understand the MEDIA_URL parameter. Here it is: MEDIA_URL = 'http://localhost:8000/wiz/uploads/' but trying to access

Re: MEDIA_URL and ADMIN_MEDIA_PREFIX

2009-07-12 Thread Sam Lai
Forgot to add - the usual trick is to symlink the admin media in your MEDIA_URL; that way you don't have to set up two different aliases in your web server config. 2009/7/13 Sam Lai <samuel@gmail.com>: > Yes, because unless you copy the admin site's media over to your > MEDIA_

Re: MEDIA_URL and ADMIN_MEDIA_PREFIX

2009-07-12 Thread Sam Lai
Yes, because unless you copy the admin site's media over to your MEDIA_URL (or vice-versa), Django won't be able to find the admin media. >From http://docs.djangoproject.com/en/dev/ref/settings/ ADMIN_MEDIA_PREFIX Default: '/media/' The URL prefix for admin media -- CSS, JavaScript and ima

MEDIA_URL and ADMIN_MEDIA_PREFIX

2009-07-12 Thread sjtirtha
Hi, I found out that MEDIA_URL and ADMIN_MEDIA_PREFIX may not have the same value, otherwise images that is located in this MEDIA_URL cannot be displayed in browser. I did not found about this anywhere in the documentation. Is my assumption correct? Regards, Steve

Re: How to use MEDIA_URL on flatpages content?

2009-06-25 Thread Panu Tangchalermkul
I think I got your concept, converting all MEDIA_URL to corresponding url before displaying. But I still curious to know where should I put this code in the project? I've been thinking and can only come up with a way, by creating a new middleware replicating FlatpageFallbackMiddleware

Re: How to use MEDIA_URL on flatpages content?

2009-06-25 Thread Rama Vadakattu
Please ignore the last line.. On Jun 25, 2:40 pm, Rama Vadakattu <rama.vadaka...@gmail.com> wrote: > you can put {{MEDIA_URL}} > > but while displaying instead of displaying it directly  just do the > below > > from django.template.loader import render_to_strin

Re: How to use MEDIA_URL on flatpages content?

2009-06-25 Thread Rama Vadakattu
you can put {{MEDIA_URL}} but while displaying instead of displaying it directly just do the below from django.template.loader import render_to_string from django.template import Context, Template t = Template("flat page content goes here") newflatpage = t.render({},contex

How to use MEDIA_URL on flatpages content?

2009-06-25 Thread Panu Tangchalermkul
In the content of my flatpage, there's a picture to be displayed that it was stored in django media folder. I want to link to this file without having to specify its url directly. Instead, I want to use something like {{MEDIA_URL}} when editing the content via django- admin. I know I can use

Re: MEDIA_ROOT, MEDIA_URL and upload_to confusion (~.~)

2009-01-16 Thread DragonSlayre
True) > >     photo = ImageWithThumbsField( > >             upload_to="site_images", > >             sizes=((270,150),)) > > > And in my settings my media path is as following: > > > MEDIA_ROOT = os.path.abspath(os.path.join(PROJECT_DIR, 'site_media')) >

Re: MEDIA_ROOT, MEDIA_URL and upload_to confusion (~.~)

2009-01-16 Thread Malcolm Tredinnick
= models.CharField(max_length=100, blank=True, null=True) > photo = ImageWithThumbsField( > upload_to="site_images", > sizes=((270,150),)) > > And in my settings my media path is as following: > > MEDIA_ROOT = os.path.abspath(os.path.join(

Re: MEDIA_ROOT, MEDIA_URL and upload_to confusion (~.~)

2009-01-16 Thread DragonSlayre
Ok, I got it working, I changed: > photo = ImageWithThumbsField( > upload_to="site_images", > sizes=((270,150),)) to: photo = ImageWithThumbsField( upload_to="static/site_images", sizes=((270,150),)

MEDIA_ROOT, MEDIA_URL and upload_to confusion (~.~)

2009-01-16 Thread DragonSlayre
= ImageWithThumbsField( upload_to="site_images", sizes=((270,150),)) And in my settings my media path is as following: MEDIA_ROOT = os.path.abspath(os.path.join(PROJECT_DIR, 'site_media')) MEDIA_URL = 'static/' I'm trying to upload my images into the 'site_media/static/ s

Re: to understand MEDIA_URL

2009-01-05 Thread Alan
, 4:13 am, Alan <alanwil...@gmail.com> wrote: > > Hi List, > > Because I couldn't find any idea better I am using "MEDIA_URL = > '/static/'" > > as a repository for the output of my application so I can see the results > in > > the web interface and downlo

Re: to understand MEDIA_URL

2009-01-05 Thread Mark Jones
ind any idea better I am using "MEDIA_URL = '/static/'" > as a repository for the output of my application so I can see the results in > the web interface and download them. > > However, I noticed for a particular case where I open and read a file > content to be viewe

to understand MEDIA_URL

2009-01-05 Thread Alan
Hi List, Because I couldn't find any idea better I am using "MEDIA_URL = '/static/'" as a repository for the output of my application so I can see the results in the web interface and download them. However, I noticed for a particular case where I open and read a file content to

Re: specifying MEDIA_URL in CSS files

2008-09-19 Thread Erik Allik
iversity.edu/group/groupname/), and when I move it over, I'd > like to have to go through and change as little as possible. > > Tim: I'll look into those solutions. > > Thanks to both of you. > > On Sep 13, 4:12 pm, Tim Chase <[EMAIL PROTECTED]> wrote: >>> What's th

Re: specifying MEDIA_URL in CSS files

2008-09-18 Thread MrJogo
/groupname/), and when I move it over, I'd like to have to go through and change as little as possible. Tim: I'll look into those solutions. Thanks to both of you. On Sep 13, 4:12 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > What's the best way to use MEDIA_URL in a CSS file. For example, r

Re: specifying MEDIA_URL in CSS files

2008-09-13 Thread Tim Chase
> What's the best way to use MEDIA_URL in a CSS file. For example, right > now my CSS file has something like: > > body { > background: transparent url('/media/images/bg.gif') repeat; > } > > I would like to use MEDIA_URL instead of /media/ (in a number of &

Re: specifying MEDIA_URL in CSS files

2008-09-13 Thread Erik Allik
, that's another case. Erik On 14.09.2008, at 1:56, MrJogo wrote: > > What's the best way to use MEDIA_URL in a CSS file. For example, right > now my CSS file has something like: > > body { > background: transparent url('/media/images/bg.gif') repeat; > } > > I would li

specifying MEDIA_URL in CSS files

2008-09-13 Thread MrJogo
What's the best way to use MEDIA_URL in a CSS file. For example, right now my CSS file has something like: body { background: transparent url('/media/images/bg.gif') repeat; } I would like to use MEDIA_URL instead of /media/ (in a number of places), but other than that the file is static

View not passing MEDIA_URL to Template

2008-09-04 Thread Cortland Klein
I have two templates, one called via a Generic View and one via my own View. They both extend a base.html view that has {{MEDIA_URL}} in it. When the generic view is hit, the base.html template gets it's value, http://rtdev.apple.com/media/ , but when my own View hits MEDIA_URL blanks. I

Re: {{ media_url }}

2008-06-05 Thread Andrew Ingram
If you're using render_to_response you'll want to do something like this: return render_to_response('my_template.html', my_data_dictionary, context_instance=RequestContext(request)) The last bit is the important part, it creates context data

Re: {{ media_url }}

2008-06-05 Thread chris hendrix
> > Hi Bobby, > > If you are referring to the media url that should be available via the > context processor, then the variable in your template should be: > {{ MEDIA_URL }} > > Unless you specifically are defining 'media_url' in your view. > > Hth, > Aaron > > Bobb

Re: {{ media_url }}

2008-06-05 Thread chris hendrix
Hi andrew. I've got the from django.template import Context, Template line at the top of the view. How do i pass the media template contact processor to the template? BR On Thu, Jun 5, 2008 at 4:20 PM, Andrew Ingram <[EMAIL PROTECTED]> wrote: > > Chances are that one of the views isn't

Re: {{ media_url }}

2008-06-05 Thread Andrew Ingram
Chances are that one of the views isn't passing the media template context processor to the template. = Andrew Bobby Roberts wrote: > i've got two templates in the same directory. My css works fine on > one template but not the other. My link to the css is > > > > Can you think of any

Re: {{ media_url }}

2008-06-05 Thread Aaron Fay
Hi Bobby, If you are referring to the media url that should be available via the context processor, then the variable in your template should be: {{ MEDIA_URL }} Unless you specifically are defining 'media_url' in your view. Hth, Aaron Bobby Roberts wrote: > i've got two templa

{{ media_url }}

2008-06-05 Thread Bobby Roberts
i've got two templates in the same directory. My css works fine on one template but not the other. My link to the css is Can you think of any reason it would work fine for one template and not the other when the templates are in the same dir? BR

Re: ImageField get_X_url() method not respecting MEDIA_URL?

2008-06-04 Thread chris . czub
Thanks, that was it. -Chris On Jun 3, 5:44 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On Tue, Jun 3, 2008 at 5:15 PM, Chris Czub <[EMAIL PROTECTED]> wrote: > > # URL that handles the media served from MEDIA_ROOT. > > # Example: "http:/

Re: ImageField get_X_url() method not respecting MEDIA_URL?

2008-06-03 Thread Marty Alchin
On Tue, Jun 3, 2008 at 5:15 PM, Chris Czub <[EMAIL PROTECTED]> wrote: > # URL that handles the media served from MEDIA_ROOT. > # Example: "http://media.lawrence.com; > MEDIA_URL = 'http://www.mysite.com/media' > > > which is correct - the url of the image SHOULD be &g

ImageField get_X_url() method not respecting MEDIA_URL?

2008-06-03 Thread Chris Czub
I'm having an issue with the ImageField's get_X_url() method(I think it actually inherits from FileField) not using my MEDIA_URL in the url it forms. *Model:* class ImageUpload(models.Model): image = models.ImageField(help_text='Image to upload', upload_to="uploads/%Y%m%d%H%M%S&quo

Re: MEDIA_URL doesnt work

2008-02-22 Thread Justin Lilly
AIL PROTECTED]> wrote: > > Have a look at the links below, I think you're over-estimating what > MEDIA_URL does for you - > http://www.djangoproject.com/documentation/static_files/ > http://www.djangoproject.com/documentation/settings/#media-url > > On Feb 22, 7:54 pm, troete

  1   2   >