попробуйте это
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_below="@+id/toolbar">
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" >
<ImageView
android:layout_width="wrap_content"
android:id="@+id/ivBack"
android:src="@drawable/ic_launcher_background"
android:layout_height="wrap_content" />
</android.support.v7.widget.Toolbar>
<RelativeLayout
android:layout_width="match_parent"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:src="@mipmap/ic_launcher" />
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:layout_marginBottom="40dp"
android:layout_height="wrap_content">
<Button
android:layout_width="0dp"
android:id="@+id/bChoose"
android:layout_weight="1"
android:layout_height="wrap_content" />
<Button
android:layout_width="0dp"
android:id="@+id/bUpload"
android:layout_weight="1"
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
Solved it. This .htaccess file did the trick, for whatever reason. I swear I tried all this before...
AddHandler fcgid-script .fcgi
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(adminmedia/.*)$ - [L]
RewriteCond %{REQUEST_URI} !(cgi-bin/myproject.fcgi)
RewriteRule ^(.*)$ cgi-bin/myproject.fcgi/$1 [L]
Скрипт ожидает, что эти параметры будут переданы как переменные среды Так как они отсутствуют в вашей среде оболочки, и скрипт не работает в среде apache fastcgi (которая их предоставляет), он жалуется.
Есть ли у вас доступ к журналам ошибок Apache? Что они говорят?
Есть ли у вашего хоста поддержка mod_wsgi? Если да, то вы можете использовать обработчик Django для wsgi:
import sys
import os
base = os.path.dirname(os.path.abspath(__file__)) + '/..'
sys.path.append(base)
os.environ['DJANGO_SETTINGS_MODULE'] = 'yourproject.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Дополнительные инструкции можно найти в modwsgi wiki и Django docs .