Django 1.4 Development Workflow Using Static Files

47 views
Skip to first unread message

huw_at1

unread,
Dec 25, 2012, 6:00:20 PM12/25/12
to django...@googlegroups.com
Hi again,

Another quick question. I'm still getting used to 1.4 and I've been setting up a remote static file service for the production deployment of my web app. This works just great however it seems a little cumbersome when developing if I want to add fresh image content I have to add it to the project locally, commit and push the changes, deploy to production and collect the static files there before the image is available to the development server...This seems like a very round about way of developing - I must be missing something here although I do not know what? Should I modify the setting.py to change the STATIC_URL value dependent on whether the server is production or development or is there any smarter way?

As ever any advice is much appreciated.

Huw_at1

Avraham Serour

unread,
Dec 25, 2012, 7:53:42 PM12/25/12
to django...@googlegroups.com

Maybe you can just upload the files directly to the collect static folder on the server

In any case maybe you want them under version control, so I guess you could just automate all these steps with fabric

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

huw_at1

unread,
Dec 26, 2012, 6:06:06 AM12/26/12
to django...@googlegroups.com
Thanks for the reply. I realised a few moments ago that I can use a relative STATIC_URL rather than an absolute one so now I just have '/static/' set as the value which works well.

Many thanks

RESOLVED

Bill Freeman

unread,
Dec 26, 2012, 9:40:09 AM12/26/12
to django...@googlegroups.com
On Wed, Dec 26, 2012 at 6:06 AM, huw_at1 <huwd...@gmail.com> wrote:
Thanks for the reply. I realised a few moments ago that I can use a relative STATIC_URL rather than an absolute one so now I just have '/static/' set as the value which works well.

Many thanks

RESOLVED


On Wednesday, 26 December 2012 00:53:42 UTC, אברהם סרור wrote:

Maybe you can just upload the files directly to the collect static folder on the server

In any case maybe you want them under version control, so I guess you could just automate all these steps with fabric

On Dec 26, 2012 1:00 AM, "huw_at1" <huwd...@gmail.com> wrote:
Hi again,

Another quick question. I'm still getting used to 1.4 and I've been setting up a remote static file service for the production deployment of my web app. This works just great however it seems a little cumbersome when developing if I want to add fresh image content I have to add it to the project locally, commit and push the changes, deploy to production and collect the static files there before the image is available to the development server...This seems like a very round about way of developing - I must be missing something here although I do not know what? Should I modify the setting.py to change the STATIC_URL value dependent on whether the server is production or development or is there any smarter way?

As ever any advice is much appreciated.

Huw_at1


You can also use the trick:

    try:
        from local_settings import *
    except:
        pass

To have a different value in STATIC_URL for your testing environment.  (Obviously, you keep local_settings.py out of revision control.)

Bill

Reply all
Reply to author
Forward
0 new messages