Mon CSS / JS ne se charge pas lors de l’utilisation d’un alias dans le httpd.conf
Le site se charge avec tous les fichiers statiques lors de l’utilisation du localhost
WSGIScriptAlias / "d:\www\python\skillshare\src\mvp_landing\wsgi.py"
résultat;
http://localhost/
Le site se charge mais sans css et js lors de l’ajout de l’alias
WSGIScriptAlias /picon "d:\www\python\skillshare\src\mvp_landing\wsgi.py"
résultat;
http://localhost/picon/
Ma structure Dir actuelle ci-dessous;
D:\www\python\skillshare\src\mvp_landing\wsgi.py D:\www\python\skillshare\src\manage.py D:\www\python\skillshare\static\static\ D:\www\python\skillshare\static\media\ D:\www\python\skillshare\static\templates\
Au-dessous de mon httpd.conf actuel (apache2.2);
WSGIScriptAlias /picon "d:\www\python\skillshare\src\mvp_landing\wsgi.py" Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny Allow from all
Mes parameters.py ci-dessous
STATIC_URL = '/static/' # Template location TEMPLATE_DIRS = ( os.path.join(os.path.dirname(BASE_DIR), "static", "templates"), ) if DEBUG: MEDIA_URL = '/media/' STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), "static", "static") MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), "static", "media") STATICFILES_DIRS = ( os.path.join(os.path.dirname(BASE_DIR), "static", "static"), )
Mon urls.py ci-dessous
urlpatterns = patterns('', url(r'^/$', 'signups.views.home', name='home'), url(r'^thank-you/$', 'signups.views.thankyou', name='thankyou'), url(r'^about-us/$', 'signups.views.aboutus', name='aboutus'), url(r'^customers/$', 'formlist.views.customers', name='customers'), url(r'^addcustomer/$', 'formlist.views.addcustomer', name='addcustomer'), url(r'^admin/', include(admin.site.urls)), ) if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Actuellement, je ne sais pas à quel paramètre s’adapter pour que les fichiers statiques fonctionnent avec l’alias en place, toute suggestion serait très appréciée. S’il vous plaît laissez-moi savoir si des informations de configuration supplémentaires sont nécessaires pour répondre à la question.
Installer:
Windows server 2012 64bit WAMP Apache 2.2 Python 2.7 Django 1.6 Bootstrap (latest)
Cordialement.
Avez-vous ajouté l’alias pour statique dans votre httpd.conf? Quelque chose comme:
Alias /static/ D:\www\python\skillshare\static\static Options -Indexes FollowSymLinks Order deny,allow Allow from all
Super, j’ai dû enlever le / pour le faire fonctionner, mais ça a fonctionné!
Alias /static D:\www\python\skillshare\static\static Options -Indexes FollowSymLinks Order deny,allow Allow from all