Added package_data attributes to django-nova and django-nova-syspanel to install

templates with this packages.
Fixed url displayed as "Sign In" (made it use url template tag).
Little hack to login.html to make it redirect to index page even when Dashboard
is accessed not from server's root.
Removed ancient hack from django.wsgi. It was needed only for very old Django
versions.
This commit is contained in:
Yuriy Taraday 2011-05-13 18:23:13 +04:00
parent 03dce1929d
commit 05580ac6dd
5 changed files with 6 additions and 19 deletions

View File

@ -15,6 +15,7 @@ setup(
author_email = 'xtoddx@gmail.com',
packages = find_packages('src'),
package_dir = {'': 'src'},
package_data = {'django_nova_syspanel': ['templates/django_nova_syspanel/*.html','templates/django_nova_syspanel/*/*.html',]},
install_requires = ['setuptools', 'boto==1.9b', 'mox>=0.5.0'],
classifiers = [
'Development Status :: 4 - Beta',

View File

@ -15,6 +15,8 @@ setup(
author_email = 'devin.carlen@gmail.com',
packages = find_packages('src'),
package_dir = {'': 'src'},
package_data = {'': ['templates/django_nova/*.html','templates/django_nova/*/*.html',
'templates/admin/*.html','templates/admin/*/*.html',]},
install_requires = ['setuptools', 'boto==1.9b', 'mox>=0.5.0',
'nova-adminclient'],
classifiers = [

View File

@ -30,7 +30,7 @@
</div>
{% else %}
<div id="user_info">
<a id="lnk_login" href="/accounts/login">Sign In</a>
<a id="lnk_login" href="{% url auth_login %}">Sign In</a>
</div>
{% endif %}
</div>

View File

@ -25,7 +25,7 @@
{% if form.errors %}
<p class="error">Your username and password didn't match. Please try again.</p>
{% endif %}
<input type="hidden" name="next" value="{{ next }}" />
<input type="hidden" name="next" value="{% if next %}{{ next }}{% else %}{% url index %}{% endif %}" />
{{ form.username.label_tag }}{{ form.username }}
{{ form.password.label_tag }}{{ form.password }}
<div class="button">

View File

@ -9,21 +9,5 @@ sys.stdout = sys.stderr
DEBUG = False
class WSGIRequest(django.core.handlers.wsgi.WSGIRequest):
def is_secure(self):
value = self.META.get('wsgi.url_scheme', '').lower()
if value == 'https':
return True
return False
class WSGIHandler(django.core.handlers.wsgi.WSGIHandler):
request_class = WSGIRequest
_application = WSGIHandler()
def application(environ, start_response):
environ['PATH_INFO'] = environ['SCRIPT_NAME'] + environ['PATH_INFO']
environ['wsgi.url_scheme'] = environ.get('HTTP_X_URL_SCHEME', 'http')
return _application(environ, start_response)
application = django.core.handlers.wsgi.WSGIHandler()