static-files

Refresh static files served by SparkJava

前提是你 提交于 2019-12-12 11:05:43
问题 I'm doing a project using Spark Java. On the server side, some images are created and I want them to be available in the client. Since I have a static content directory, after creating the image on the server side, I place it in that directory. However, this file is not available unless I reboot the server. I guess there must be a way to refresh the static directory file for Spark Java on runtime so that requests of on-runtime created images can be fulfilled. Right? Thanks! 回答1: The

ImproperlyConfigured at / Empty static prefix not permitted - Django

你说的曾经没有我的故事 提交于 2019-12-12 08:19:56
问题 I'm working on uploading/displaying images with Django. The website is deployed on Heroku. Following this tutorial I was able to successfully upload images. However, the images weren't being displayed in the template. I then learned that my urls.py should have this line at the end: + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) I added this to the end of my urls.py but now I'm getting this error: ImproperlyConfigured at / Empty static prefix not permitted I have MEDIA_URL and

Serving django static files in development envirnoment

随声附和 提交于 2019-12-12 01:57:29
问题 I want to use static files to load my css with runserver command. The problem is that i tried all the solution i found here on stackoverflow and also in django docs, but it doesnt works at all... I dont know what can i do... If i set STATIC_URL = '/static/' STATIC_ROOT = 'C:\Users\Max\Works\www\mysite\mysite\static' INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles'

Static files not working in Django

别说谁变了你拦得住时间么 提交于 2019-12-11 19:26:57
问题 My static files were absolutely working fine, but yesterday I tried using the app allauth and since then my static files are not being displayed. It is not showing any css or js. I tried commenting the allauth app and even then it does not work. However I just figured out the problem. Django is appending the wrong path to the static files. It should be /static/style.css but it is searching it at /"module-name"/style.css What could be the possible reason. I have correctly configured the static

In Rails, how can I force update the client's js/css files?

☆樱花仙子☆ 提交于 2019-12-11 15:23:16
问题 When I use javascript_include_tag or stylesheet_link_tag to include files, they have a number at the end to make it easier to circumvent browser caching (update the file without changing the number, the browser still uses the cached version; change the number, the browser will download and use the updated file). But where does this number come from? When is it updated? And how can I manually update it? I'm still using Rails 2.3.9, but I guess answers for any version of Rails would be helpful

Django - staticfiles directory keeps getting created

爷,独闯天下 提交于 2019-12-11 14:57:18
问题 There is a directory called "staticfiles" that gets created each time I run the django development web server: python manage.py runserver 0.0.0.0:8000 I have the staticfiles as one of my apps: INSTALLED_APPS = [ # 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] A few other "static files" settings, which are probably unrelated: # Static files STATIC_URL = '/static/' # Url for

how to store uploaded files in secure folder and it can be accessed securely in asp.net core?

懵懂的女人 提交于 2019-12-11 06:43:33
问题 how to store uploaded files in secure folder and it can be accessed securely in asp.net core? I knew the folder must be outside for www root folder. However, I did some google search still cannot find an example. Can someone please help me give an example or give me instructions how to setup? Thanks. I refer to the instructions from (Serving Static Files Outside of wwwroot in Asp.NET Core 1.0) to setup. But it's still available for public access. I would like to only authorized user can

.Net core Add folder in static folder (www) and save image file

会有一股神秘感。 提交于 2019-12-11 05:16:42
问题 Add file in the static folder and save an image in the static folder. Save base64 image in the Dot net core project. 回答1: public class EventMastersController : Controller { private IHostingEnvironment _env; public EventMastersController(IHostingEnvironment env) { _env = env; } public void AddFolderAndImage() { var webRoot = _env.WebRootPath; var PathWithFolderName = System.IO.Path.Combine(webRoot, "MyFolder"); if (!Directory.Exists(PathWithFolderName)) { // Try to create the directory.

WWWROOT in MVC5

╄→гoц情女王★ 提交于 2019-12-10 04:35:55
问题 How to achieve same behavior in ASP.NET MVC5 with static files like it works on aspnet-core with app.UseDefaultFiles(); app.UseStaticFiles(); ? I mean serving static files from some folder over root, e.g. /wwwroot/some.html must be opened on mysite.com/some.html , /wwwroot/img/test.jpg on mysite.com/img/test.jpg etc. Update : I have created wwwroot folder and added following rule to web.config : <system.webServer> <rewrite> <rules> <rule name="Rewrite Static" stopProcessing="true"> <match url

Django - Static Files from App Directories

半腔热情 提交于 2019-12-09 17:56:30
问题 In a development environment, I'd like to use static files from the app directories. #settings.py SITE_ROOT = os.path.dirname(os.path.realpath(__file__)) STATIC_ROOT = (os.path.join(SITE_ROOT, 'static_files/')) STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(SITE_ROOT, 'static/'), ) STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', ) TEMPLATE_CONTEXT_PROCESSORS = ( #... 'django.core.context