开发者

Uploading files with an ImageField and saving them to a static location

开发者 https://www.devze.com 2023-02-03 23:13 出处:网络
I have a problem with my app here. My configuration is as such I can upload a new release and symbolically link it for production -- however, this means every time I upload a new release, all of the p

I have a problem with my app here. My configuration is as such I can upload a new release and symbolically link it for production -- however, this means every time I upload a new release, all of the photos that were uploaded in any parts of my entire project are wrapped into the old release and disappear.

How can I save these 开发者_运维技巧files to a static file location which does not get wrapped in the release? Thanks in advance.


I guess best for this is keeping your media files out of your source project folder, you could eg have a structure like:

myproject
|
|----media
|----src

There's no need to have the media folder in the same directory as your source code, apps etc. So you have a solution where the dir with your release only contains static files! The same applies to the database, if you are using sqlite... Have a look at this for a more detailled structure!

Of course this no must, but experience shows it makes live much easier!

0

精彩评论

暂无评论...
验证码 换一张
取 消