Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python apache-django没有提供css文件_Python_Django_Apache - Fatal编程技术网

Python apache-django没有提供css文件

Python apache-django没有提供css文件,python,django,apache,Python,Django,Apache,我想用Apache2.4和mod_wsgi在Ubuntu13.10上配置并运行Django。 除了css,其他一切都可以工作。我做错了什么 我通过以下方式创建了/etc/apache2/sites available/mysite.conf文件 跑 它将静态文件收集到静态根目录中,然后由apache提供服务 您不需要将“/loginsys/templates”和“/table\u view/templates”添加到模板目录中,django将搜索所有已安装的应用程序中的模板目录,并自动将它们添加

我想用Apache2.4和mod_wsgi在Ubuntu13.10上配置并运行Django。 除了css,其他一切都可以工作。我做错了什么

我通过以下方式创建了/etc/apache2/sites available/mysite.conf文件

它将静态文件收集到静态根目录中,然后由apache提供服务

您不需要将“/loginsys/templates”和“/table\u view/templates”添加到模板目录中,django将搜索所有已安装的应用程序中的模板目录,并自动将它们添加到模板搜索路径中。
WSGIScriptAlias / /home/evgeny/django_progects/django_show_table/table/wsgi.py
WSGIPythonPath /home/evgeny/django_progects/django_show_table

Alias /static/ /home/evgeny/django_progects/django_show_table/static/

<Directory home/evgeny/django_progects/django_show_table/static>
Require all granted
</Directory>

<Directory /home/evgeny/django_progects/django_show_table/table>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
2   Django settings for table project.
3   
4   For more information on this file, see
5   https://docs.djangoproject.com/en/1.7/topics/settings/
6   
7   For the full list of settings and their values, see
8   https://docs.djangoproject.com/en/1.7/ref/settings/
9   """
10  
11  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
12  import os
13  BASE_DIR = os.path.dirname(os.path.dirname(__file__))
14  
15  TEMPLATE_CONTEXT_PROCESSORS =(
16      "django.contrib.auth.context_processors.auth",
17      "django.core.context_processors.debug",
18      "django.core.context_processors.i18n",
19      "django.core.context_processors.media",
20      "django.core.context_processors.static",
21      "django.core.context_processors.tz",
22      "django.contrib.messages.context_processors.messages",
23      "django.core.context_processors.request",
24  )
25  
26  TEMPLATE_DIRS = (
27      os.path.join(BASE_DIR, 'templates'),
28      os.path.join(BASE_DIR, '/loginsys/templates'),
29      os.path.join(BASE_DIR, '/table_view/templates'),
30  )
31  
32  # Quick-start development settings - unsuitable for production
33  # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
34  
35  # SECURITY WARNING: keep the secret key used in production secret!
36  SECRET_KEY = 'eszu&dq85t6zzd&1+e7a!5mbi*0em+%cev8_zntm3v5u6o+@zt'
37  
38  # SECURITY WARNING: don't run with debug turned on in production!
39  DEBUG = True
40  
41  TEMPLATE_DEBUG = True
42  
43  ALLOWED_HOSTS = []
44  
45  
46  # Application definition
47  
48  INSTALLED_APPS = (
49      'django.contrib.admin',
50      'django.contrib.auth',
51      'django.contrib.contenttypes',
52      'django.contrib.sessions',
53      'django.contrib.messages',
54      'django.contrib.staticfiles',
55      'table_view',
56     
57      'loginsys',
58  )
59  
60  MIDDLEWARE_CLASSES = (
61      'django.contrib.sessions.middleware.SessionMiddleware',
62      'django.middleware.common.CommonMiddleware',
63      'django.middleware.csrf.CsrfViewMiddleware',
64      'django.contrib.auth.middleware.AuthenticationMiddleware',
65      'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
66      'django.contrib.messages.middleware.MessageMiddleware',
67      'django.middleware.clickjacking.XFrameOptionsMiddleware',
68  )
69  
70  ROOT_URLCONF = 'table.urls'
71  
72  WSGI_APPLICATION = 'table.wsgi.application'
73  
74  
75  # Database
76  # https://docs.djangoproject.com/en/1.7/ref/settings/#databases
77  
78  DATABASES = {
79      'default': {
80          'ENGINE': 'django.db.backends.sqlite3',
81          'NAME': os.path.join(BASE_DIR, 'book_db.sqlite3'),
82      }
83  }
84  
85  # Internationalization
86  # https://docs.djangoproject.com/en/1.7/topics/i18n/
87  
88  LANGUAGE_CODE = 'en-us'
89  
90  TIME_ZONE = 'UTC'
91  
92  USE_I18N = True
93  
94  USE_L10N = True
95  
96  USE_TZ = True
97  
98  
99  # Static files (CSS, JavaScript, Images)
100 # https://docs.djangoproject.com/en/1.7/howto/static-files/
101 
102 STATIC_URL = '/static/'
103 
104 STATICFILES_DIRS = (
105     ('static', os.path.join(BASE_DIR, 'static')),
106 )
python manage.py collectstatic