Ahoj,

asi ti jen chybi pocatecni lomitko ve STATIC_URL

Hezky den, Vitek


> 2. 1. 2015 v 16:14, Jakub Jiřička <[email protected]>:
> 
> Dobrý den,
> 
> s Djangem teprve začínám (cca 5 dní) a hned mám problém ohledně chybějcích 
> stylů pro administraci...
> 
> Věc se má takto, když si zobrazím zdrojový kod administrace tak mám soubory 
> nalinkované takto:
>   <link rel="stylesheet <>" type="text/css <>" href=""/>
>   <link rel="stylesheet <>" type="text/css <>" 
> href="static/suit/bootstrap/css/bootstrap.min.css 
> <view-source:http://127.0.0.1:8000/admin/static/suit/bootstrap/css/bootstrap.min.css>"
>  media="all <>"/>
>   <link rel="stylesheet <>" type="text/css <>" href="static/suit/css/suit.css 
> <view-source:http://127.0.0.1:8000/admin/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 
> <view-source:http://127.0.0.1:8000/admin/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 
> <view-source:http://127.0.0.1:8000/admin/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 když si chci jednotlivý soubory otevřít, tak to hodí error, že 
> neexistují, ale v odkazu vidím přidaný admin:
> <h1>Page not found <span>(404)</span></h1>
>     <table class="meta <>">
>       <tr>
>         <th>Request Method:</th>
>         <td>GET</td>
>       </tr>
>       <tr>
>         <th>Request URL:</th>
>       
> <td>http://127.0.0.1:8000/admin/static/suit/bootstrap/css/bootstrap.min.css</td>
>       </tr>
>     </table>
> 
> A já nemohu přijít na to, co dělám špatně ... proč mě ty styly nejdou ...
> 
> Kdyby bylo třeba, přidávám urls.py:
> 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 settings.py:
> """
> 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': 'projekt',
>         'USER': 'jiricka',
>         'PASSWORD': '',
>         '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/'
> 
> 
> Našla by se tu nějaka dobrý duše, která by mi poradila a vysvětlila, co dělam 
> špatně?
> 
> Předem mockrát děkuji
> Jiřička Jakub
> 
> --
> --
> E-mailová skupina [email protected]
> Správa: http://groups.google.cz/group/django-cs 
> <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 [email protected] 
> <mailto:[email protected]>.
> Další možnosti najdete na https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
-- 
E-mailová skupina [email protected]
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 [email protected].
Další možnosti najdete na adrese https://groups.google.com/d/optout.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to