Ahoj, `./manage.py collectstatic` si pustil? --- In Perl you shoot yourself in the foot, but nobody can understand how you did it. Six months later, neither can you. | print 'aknerats'[::-1]
2015-01-02 16:07 GMT+01:00 Jakub Jiřička <jiricka.k...@gmail.com>: > Dobrý den, > > s Django teprve začínám (asi 5dní) a narazil jsem na tento problém ... > > Líbíl se mi "doplněk" django-suite, tak jsem jej nainstaloval ... > > CSS styly pro front se mi v pohodě načtou, ale jakmile si pustim > administraci, CSS styly se nenactou ... kdyz si zobrazim zdrojaky > administrace tak vidim toto > > <link rel="stylesheet" type="text/css" href=""/> > <link rel="stylesheet" type="text/css" > href="static/suit/bootstrap/css/bootstrap.min.css" media="all"/> > <link rel="stylesheet" type="text/css" href="static/suit/css/suit.css" > media="all"> > > > > > <script type="text/javascript">window.__admin_media_prefix__ = > "static/admin/";</script> > <script src="static/suit/js/jquery-1.8.3.min.js"></script> > <script type="text/javascript">var Suit = { $: $.noConflict() }; if (!$) $ > = Suit.$; </script> > <script src="static/suit/bootstrap/js/bootstrap.min.js"></script> > > <style type="text/css">.required:after { content: '*'; margin: 0 0 0 5px; > position: absolute; color: #ccc;}</style> > > > > Ale kdyz si otevru jednotlivy CSS, tak mě to přidává pred link ještě admin > ... takže admin/static/suit atd ... > > URL.py mám takto: > > from django.conf.urls import patterns, include, url > from django.conf import settings > from django.contrib import admin > from django.conf.urls.static import static > > admin.autodiscover() > > urlpatterns = patterns('', > url(r'^$', 'standa.views.home', name='home'), > > url(r'^admin/', include(admin.site.urls)), > > ) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) > > if settings.DEBUG: > import debug_toolbar > urlpatterns += patterns('', > url(r'^__debug__/', include(debug_toolbar.urls)), > ) > > > a nastavení v settings.py takto: > > """ > Django settings for standa project. > > For more information on this file, see > https://docs.djangoproject.com/en/1.6/topics/settings/ > > For the full list of settings and their values, see > https://docs.djangoproject.com/en/1.6/ref/settings/ > """ > > # Build paths inside the project like this: os.path.join(BASE_DIR, ...) > import os > import django > from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP > > TEMPLATE_CONTEXT_PROCESSORS = TCP + ( > 'django.core.context_processors.request', > ) > > BASE_DIR = os.path.dirname(os.path.dirname(__file__)) > DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__)) > SITE_ROOT = os.path.dirname(os.path.realpath(__file__)) > > # Quick-start development settings - unsuitable for production > # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ > > # SECURITY WARNING: keep the secret key used in production secret! > SECRET_KEY = '#i#7hij2@zaye!95k6*m*1-db0)dvug=22v6m7=@fx^(jw-@+8' > > # SECURITY WARNING: don't run with debug turned on in production! > DEBUG = True > > TEMPLATE_DEBUG = True > > ALLOWED_HOSTS = [] > > > # Application definition > > INSTALLED_APPS = ( > 'suit', > 'django.contrib.admin', > 'django.contrib.auth', > 'django.contrib.contenttypes', > 'django.contrib.sessions', > 'django.contrib.messages', > 'django.contrib.staticfiles', > > # dodatecne > 'standa', > 'south', > 'lettuce.django', > 'debug_toolbar', > #'guardian', > 'floppyforms', > 'filer', > 'mptt', > 'easy_thumbnails', > > # dodatecne vlastni aplikace > 'dodani', > 'kategorie', > 'menu', > 'obecne', > ) > > MIDDLEWARE_CLASSES = ( > 'django.contrib.sessions.middleware.SessionMiddleware', > 'django.middleware.common.CommonMiddleware', > 'django.middleware.csrf.CsrfViewMiddleware', > 'django.contrib.auth.middleware.AuthenticationMiddleware', > 'django.contrib.messages.middleware.MessageMiddleware', > 'django.middleware.clickjacking.XFrameOptionsMiddleware', > ) > > ROOT_URLCONF = 'standa.urls' > > WSGI_APPLICATION = 'standa.wsgi.application' > > > # Database > # https://docs.djangoproject.com/en/1.6/ref/settings/#databases > > DATABASES = { > 'default': { > 'ENGINE': 'django.db.backends.mysql', > 'NAME': 'foo', > 'USER': 'root', > 'PASSWORD': 'bar', > 'HOST': 'localhost' > } > } > > # Internationalization > # https://docs.djangoproject.com/en/1.6/topics/i18n/ > > LANGUAGE_CODE = 'cs' > > TIME_ZONE = 'Europe/Prague' > > USE_I18N = True > > USE_L10N = True > > USE_TZ = True > > > # Static files (CSS, JavaScript, Images) > # https://docs.djangoproject.com/en/1.6/howto/static-files/ > STATIC_ROOT = os.path.join(BASE_DIR, 'static') > > TEMPLATE_DIRS = ( > os.path.join(BASE_DIR, 'templates'), > ) > > STATIC_URL = 'static/' > > > Ve slozce static mam suit jak je treba ... podle me to proste pro > administraci pridava navic ten /admin/ a ja nevim jak to vyresit ... hledal > jsem snad vsude a bud neumim hledat, nebo jsem to nenasel ... > > Byl by někdo tak hodný a dokázal mi říci co dělám špatně? > > Mockrát Vám děkuji > > Jiřička Jakub > > -- > -- > E-mailová skupina django-cs@googlegroups.com > Správa: http://groups.google.cz/group/django-cs > > --- > Tuto zprávu jste obdrželi, protože jste přihlášeni k odběru skupiny > „django-cs“ ve Skupinách Google. > Chcete-li zrušit odběr skupiny a přestat dostávat e-maily ze skupiny, > zašlete e-mail na adresu django-cs+unsubscr...@googlegroups.com. > Další možnosti najdete na https://groups.google.com/d/optout. -- -- E-mailová skupina django-cs@googlegroups.com Správa: http://groups.google.cz/group/django-cs --- Tuto zprávu jste obdrželi, protože jste přihlášeni k odběru skupiny django-cs ve Skupinách Google. Chcete-li zrušit odběr skupiny a přestat dostávat e-maily ze skupiny, zašlete e-mail na adresu django-cs+unsubscr...@googlegroups.com. Chcete-li zobrazit tuto diskusi na webu, navštivte https://groups.google.com/d/msgid/django-cs/CA%2B7MNVp%2BFE4b82SbeKcUxxmGa_VFOQJsNh4Uv1GGjb4Uin-hPw%40mail.gmail.com. Další možnosti najdete na adrese https://groups.google.com/d/optout.