my system: Windows 10 1903, Python 3.7.4, 64 bit
My directory structure
%USERPROFILE%/Desktop/myproject/manage.py
%USERPROFILE%/Desktop/myproject/some_app/(...)
%USERPROFILE%/Desktop/myproject/myproject/sqlite3.db
%USERPROFILE%/Desktop/myproject/myproject/static (...)
;
> If you want to manually add staticfile serving, you have to give
> --nostatic parameter to runserver to omit all magic that happena
> automatically.
>
>
> On Mon, 26 Aug 2013 07:58:38 -0700 (PDT)
> Wesley Ni <wesley...@gmail.com > wrote:
>
>
.
On Mon, 26 Aug 2013 07:58:38 -0700 (PDT)
Wesley Ni <wesley.ni...@gmail.com> wrote:
> I hit an issue when trying serve static files.
>
> In settings, debug is True, and with the followinig:
> STATIC_ROOT = os.path.join(freelancer_path,"staticfiles")
> STATIC_URL
ROOT, try 'document_root' :
> settings.STATIC_ROOT,
>
>
> On Mon, Aug 26, 2013 at 10:05 AM, Wesley Ni <wesley...@gmail.com
> > wrote:
>
>> Forget to say that I use Django 1.5.2
>>
>> 在 2013年8月26日星期一UTC-4上午10时58分38秒,Wesley Ni写道:
>>
>>> I hit a
> I hit an issue when trying serve static files.
>>
>> In settings, debug is True, and with the followinig:
>> STATIC_ROOT = os.path.join(freelancer_path,"**staticfiles")
>> STATIC_URL = '/staticfiles/'
>>
>> urls.py:
>> (r'^staticfiles/(?P.*)$'*
I hit an issue when trying serve static files.
In settings, debug is True, and with the followinig:
STATIC_ROOT = os.path.join(freelancer_path,"staticfiles")
STATIC_URL = '/staticfiles/'
urls.py:
(r'^staticfiles/(?P.*)$','django.contrib.staticfiles.views.serve',
{'doc
Forget to say that I use Django 1.5.2
在 2013年8月26日星期一UTC-4上午10时58分38秒,Wesley Ni写道:
>
> I hit an issue when trying serve static files.
>
> In settings, debug is True, and with the followinig:
> STATIC_ROOT = os.path.join(freelancer_path,"staticfiles")
> STATIC_URL =
Try changing the first line to {% load static from staticfiles %}
_Nik
On 8/21/2013 6:27 PM, Ideo Rex wrote:
> {% load staticfiles %}
>
>
>
> This is just for my css file (there are other categories under lifestream.
>
> server: https://my.site.com/DJStatic/static/livestream/css/style.css
>
>
This is how I do it.
In settings.py:
STATIC_ROOT = '/home/user/app/site_media/static/' # Generated files here
from 'manage.py collectstatic'
STATIC_URL = 'http://static.example.com/static/'
In templates:
{% load staticfiles %}
...
Produces:
{% load staticfiles %}
This is just for my css file (there are other categories under lifestream.
server: https://my.site.com/DJStatic/static/livestream/css/style.css
On Wednesday, August 21, 2013 6:18:37 PM UTC-7, Nikolas Stevenson-Molnar
wrote:
>
> That should work... how are you
That should work... how are you referencing your static files from your
templates?
_Nik
On 8/21/2013 6:09 PM, Ideo Rex wrote:
> Hello,
> I have a different request that I couldn't find anywhere else on the
> internet. I'm an intern who has built a Django Web Application for my
> project
Hello,
I have a different request that I couldn't find anywhere else on the
internet. I'm an intern who has built a Django Web Application for my
project (basically a large experiment). The cite will never leave
development, but I'm holding my static files and templates on another
server. I
On Sunday, December 30, 2012 6:01:24 PM UTC+1, Amirouche wrote:
>
> Héllo Stefano,
>
> On Sunday, December 30, 2012 1:27:12 PM UTC+1, Stefano Tranquillini wrote:
>>
>> Hi all.
>> in the appfog ML we were fighting again the possibility to serve static
>> file in django without using an external
Héllo Stefano,
On Sunday, December 30, 2012 1:27:12 PM UTC+1, Stefano Tranquillini wrote:
>
> Hi all.
> in the appfog ML we were fighting again the possibility to serve static
> file in django without using an external server.
> So far AF does not provide a setup of the server to split the
El 08/07/12 06:08, surya escribió:
My project is on heroku and my website templates has some CSS, JS
files. Totally 5 of them.
I don't want to get off with amazon s3 for the sake of those 5 files
(very small ones). However, I even need to enter my credit -card,
which I don't like :P
So, as
My project is on heroku and my website templates has some CSS, JS files.
Totally 5 of them.
I don't want to get off with amazon s3 for the sake of those 5 files (very
small ones). However, I even need to enter my credit -card, which I don't
like :P
So, as far as I know, my only option is to
Thanks for another great suggestion.
My really pressing questions have been successfully answered, I now
have a high-performance solution for the final version and a purely
Python/Django solution for initial testing and demos. Hopefully I can
figure out how to make the high-performance solution
On Tue, Nov 8, 2011 at 11:12 PM, zak wrote:
> Thank you, that is a very helpful suggestion.
>
> However, I have a followup question. What are my options if:
>
> 1. It is okay to be slow (low performance), and
> 2. The method must work on any webserver, not necessarily or
>
Thank you, that is a very helpful suggestion.
However, I have a followup question. What are my options if:
1. It is okay to be slow (low performance), and
2. The method must work on any webserver, not necessarily or
specifically Apache or Nginx.
In pure Python/Django, how do I open a file on
On Tue, Nov 8, 2011 at 2:11 PM, zak2011 wrote:
> Dear Django Users,
>
> tl;dr: Please tell me what strategies I might use to serve a large
> static file from within Django, from views.py.
>
> If I want to limit access to a particular page in a Django app, I can
> do something
Dear Django Users,
tl;dr: Please tell me what strategies I might use to serve a large
static file from within Django, from views.py.
If I want to limit access to a particular page in a Django app, I can
do something like this in views.py:
(Note: I will use four periods to indent, because spaces
Ok finally got it. David Zhou above, earlier mentioned adding static
file directory to css link (ie, ) but when i did that it didn't work. I
must have had something wrong somewhere else. Anyway, i made some more
changes after reading info here:
ah ok. good catch. My MEDIA_ROOT = C:\dev\proj. But my media directory
is actually in my app directory, one directory down. I fixed
MEDIA_ROOT to equal C:\dev\proj\app and still not having any luck. my
use of -\ in directory structure example is just to indicate a folder
in directory tree. Let me
Sorry that should be {{MEDIA_URL}}
Dj Gilcrease
OpenRPG Developer
~~http://www.openrpg.com
On Thu, Jan 22, 2009 at 9:30 AM, Puneet Madaan wrote:
> beside you need to correct settings.py to
>
> SETTINGS_FILE_FOLDER = os.path.dirname( os.path.abspath(__file__))
>
>
>
well at my side it works well on both *nix and windoof platforms... here is
what I use on my projects...
settings.py
--
import platform
import os
PROJECT_DIR = os.path.dirname( os.path.abspath(__file__))
MEDIA_ROOT = os.path.join(PROJECT_DIR, 'static')
---
urls.py
Thanks but no change.
On Jan 22, 11:30 am, Puneet Madaan wrote:
> beside href="{MEDIA_URL}css/styles.css">
> you need to correct settings.py to
>
> SETTINGS_FILE_FOLDER = os.path.dirname( os.path.abspath(__file__))
>
>
>
> On Thu, Jan 22, 2009 at 5:26 PM, john
beside
you need to correct settings.py to
SETTINGS_FILE_FOLDER = os.path.dirname( os.path.abspath(__file__))
On Thu, Jan 22, 2009 at 5:26 PM, john wrote:
>
> Thanks but no change.
>
> On Jan 22, 11:02 am, Dj Gilcrease wrote:
> > change
> >
> >
Thanks but no change.
On Jan 22, 11:02 am, Dj Gilcrease wrote:
> change
>
> to
>
>
> Dj Gilcrease
> OpenRPG Developer
> ~~http://www.openrpg.com
>
> On Thu, Jan 22, 2009 at 8:53 AM, john wrote:
>
> > No matter what i do i can't get my css to
change
to
Dj Gilcrease
OpenRPG Developer
~~http://www.openrpg.com
On Thu, Jan 22, 2009 at 8:53 AM, john wrote:
>
> No matter what i do i can't get my css to load. 100% Frustrated with
> Django. My index page loads when i request http://127.0.0.1:8000/ but
> it is
On Thu, Jan 22, 2009 at 10:53 AM, john wrote:
>
> No matter what i do i can't get my css to load. 100% Frustrated with
> Django. My index page loads when i request http://127.0.0.1:8000/ but
> it is not styled. Django dev server returns 404 in console for "GET /
>
No matter what i do i can't get my css to load. 100% Frustrated with
Django. My index page loads when i request http://127.0.0.1:8000/ but
it is not styled. Django dev server returns 404 in console for "GET /
css/styles.css HTTP/1.1"
In my base template i have:
In my urls.py I have:
I think I may have figured out the problem.. I needed my admin_media
folder to be in my media folder
Thanks for the help :)
I appreciate both of your responses!
Molly
On Jun 17, 1:37 pm, "Norman Harman" <[EMAIL PROTECTED]> wrote:
> Molly wrote:
> > How would I call the static file in my
Molly wrote:
> How would I call the static file in my browser??
By typing in the url to the static file directly in the address bar.
For example if your server is example.com, root of django app is myapp,
and images are in img dir, and image is named myjp.jpg the url would be
How would I call the static file in my browser??
Sorry, i'm still a beginner! :P
Thanks for the response :)
Molly
On Jun 17, 12:16 pm, chris vigelius <[EMAIL PROTECTED]>
wrote:
> Am Dienstag, 17. Juni 2008 17:22:46 schrieb Molly:
>
> > I created a django app and turned it into a stand alone
Am Dienstag, 17. Juni 2008 17:22:46 schrieb Molly:
> I created a django app and turned it into a stand alone app.
>
> Everything is working, except for the look of the page is all messed
> up.
what happens if you call one of the static files directly in your browser?
Does the path to the static
I created a django app and turned it into a stand alone app.
Everything is working, except for the look of the page is all messed
up.
I need to serve static files (I think) in urls.py but somehow I am
messing up my code
On 8/20/07, Graham Dumpleton <[EMAIL PROTECTED]> wrote:
> Have you read the mod_python documentation on Django site? It gives an
> example, which modified for your case would be:
>
>
> SetHandler None
>
>
> The important bit is the SetHandler directive. Have you done that?
Yes, I did.
On Aug 21, 3:21 am, "Peter Melvyn" <[EMAIL PROTECTED]> wrote:
> On 8/20/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
>
> > Not really Django related, so I'll do this briefly...
>
> Yes, I know. I appreciate your prompt reply. Thanks.
>
> > In this case you'll probably want to add another
On 8/20/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> Not really Django related, so I'll do this briefly...
Yes, I know. I appreciate your prompt reply. Thanks.
> In this case you'll probably want to add another Location section before
> this one to handle things to WWW-ROOT/bizweb
On 11/27/05, Christopher Lenz <[EMAIL PROTECTED]> wrote:
> > How to serve static files
> > http://www.djangoproject.com/documentation/static_files/
>
> Can you maybe elaborate on why this approach is considered insecure?
Mainly because it hasn't been security-audited
Am 27.11.2005 um 15:48 schrieb Adrian Holovaty:
A commonly asked question is how to serve static files with Django.
Here's the answer, finally documented.
How to serve static files
http://www.djangoproject.com/documentation/static_files/
Can you maybe elaborate on why this approach
it's very useful!
good job
A commonly asked question is how to serve static files with Django.
Here's the answer, finally documented.
How to serve static files
http://www.djangoproject.com/documentation/static_files/
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org
43 matches
Mail list logo