Skip to content

Commit

Permalink
various fixes for django 3.1 and deployment with Caddy
Browse files Browse the repository at this point in the history
  • Loading branch information
ivh committed Aug 11, 2020
1 parent efcbf3f commit 23a324a
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 43 deletions.
28 changes: 7 additions & 21 deletions browse/templates/indigo.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% load static %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

Expand All @@ -6,7 +7,7 @@
<meta name="description" content="description"/>
<meta name="keywords" content="keywords"/>
<meta name="author" content="author"/>
<link rel="stylesheet" type="text/css" href="/css/indigo.css" media="screen"/>
<link rel="stylesheet" type="text/css" href="{% static "css/indigo.css" %}" media="screen"/>
<title>{% block title %}VAMDC dictionary{% endblock %}</title>
{% block addheader %}{% endblock %}
</head>
Expand All @@ -18,14 +19,8 @@
<div class="header">

<div class="title">
<h1>{% block headline %}The VAMDC dictionary{% endblock %}</h1>
<h1><a href="/">The VAMDC dictionary</a></h1>
</div>
<!-- <div class="navigation">
{% block topnavi %}
<a href="/portal/">Home</a>
{% endblock %}
-->
<div class="clearer"><span></span></div>

</div>
Expand All @@ -46,26 +41,17 @@ <h1>{% block headline %}The VAMDC dictionary{% endblock %}</h1>
<h1>Dictionary</h1>
<ul>
<li><a href="/restrictables/">Restrictables</a></li>
<li><a href="/requestables/">Requestables</a></li>
<li><a href="/requestables/">Requestables</a></li>
<li><a href="/returnables/">Returnables</a></li>
<li><a href="/log/">Log</a></li>
<li><a href="/admin/">Edit main dictionary</a></li>
<li><a href="/og/">Log</a></li>
<li><a href="/admin/">Edit main dictionary</a></li>
</ul>
<h1>Links</h1>
<ul>
<li><a href="http://www.vamdc.eu">VAMDC Homepage</a></li>
<li><a href="http://voparis-twiki.obspm.fr/twiki/bin/view/VAMDC/">VAMDC Wiki</a></li>
<li><a href="http://www.uu.se">UU</a></li>
<li><a href="http://www.astro.uu.se">Astronomy Uppsala</a></li>

</ul>
<!--
<h1>Search</h1>
<form action="index.html">
<div>
<input type="text" name="search" class="styled" /> <input type="submit" value="submit" class="button" />
</div>
</form>
-->
<p style="height: 400px;"></p>
{% endblock %}
{% block sidebar2 %}
Expand Down
19 changes: 15 additions & 4 deletions manage.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")

from django.core.management import execute_from_command_line

def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)


if __name__ == '__main__':
main()
31 changes: 23 additions & 8 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
}
}

STATIC_URL='/static/'
STATIC_ROOT='./static/'
TIME_ZONE = 'Europe/Stockholm'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = False
USE_L10N = False
MEDIA_ROOT = ''
MEDIA_URL = ''
SECRET_KEY = '%l%4o(43#bv8&$7j=9!+%k+!vkpf*kg3@62js983'
ROOT_URLCONF = 'urls'
STATIC_URL = '/'
#STATIC_ROOT='/opt/VamdcDictionary/static'
ALLOWED_HOSTS=['*']
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
SECRET_KEY = '%l%4o(43#bv5&$7j=9!+%k+!vkpf*kg3@62js983'


ROOT_URLCONF = 'urls'
APPEND_SLASH = True
ALLOWED_HOSTS=['*']

TEMPLATES = [
{
Expand All @@ -51,7 +51,7 @@
'django.template.loaders.app_directories.Loader',
)

MIDDLEWARE_CLASSES = (
MIDDLEWARE = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
Expand All @@ -65,7 +65,22 @@
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
# 'django.contrib.staticfiles',
'django.contrib.staticfiles',
'django.contrib.admin',
'browse',
)

LOGGING = {
'version': 1,
'handlers': {
'console': {
'class': 'logging.StreamHandler',
}
},
'loggers': {
'django.db.backends': {
'level': 'DEBUG',
'handlers': ['console'],
}
}
}
1 change: 0 additions & 1 deletion static/admin

This file was deleted.

17 changes: 8 additions & 9 deletions static/css/indigo.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ URL: http://arcsin.se
Feel free to use and modify but please provide credits.
#############################################################*/

/* standard elements */
* {
margin: 0;
Expand All @@ -20,7 +19,7 @@ a:hover {
color: #C60;
}
body {
background: #0094D6 url(/img/bg.gif) repeat-x;
background: #0094D6 url(/static/img/bg.gif) repeat-x;
color: #466;
font: normal 62.5% "Lucida Sans Unicode",sans-serif;
margin: 0;
Expand All @@ -38,7 +37,7 @@ h1 {
margin-bottom: 4px;
}
code {
background: url(/img/bgcode.gif);
background: url(/static/img/bgcode.gif);
border: 1px solid #F0F0F0;
border-left: 6px solid #39F;
color: #555;
Expand All @@ -49,7 +48,7 @@ code {
white-space: pre;
}
cite {
background: url(/img/quote.gif) no-repeat;
background: url(/static/img/quote.gif) no-repeat;
color: #666;
display: block;
font: normal 1.3em "Lucida Sans Unicode",serif;
Expand All @@ -66,7 +65,7 @@ h1,h2,h3 {

/* structure */
.container {
background: url(/img/topleft.gif) no-repeat;
background: url(/static/img/topleft.gif) no-repeat;
}

.header {
Expand Down Expand Up @@ -107,7 +106,7 @@ h1,h2,h3 {

/* main */
.main {
background: #FFF url(/img/bgmain.gif) no-repeat;
background: #FFF url(/static/img/bgmain.gif) no-repeat;
clear: both;
padding: 12px 12px 0 52px;
}
Expand Down Expand Up @@ -142,7 +141,7 @@ h1,h2,h3 {
}
.sidenav li a:hover {
color: #111;
background: url(/img/nav_li.gif) no-repeat;
background: url(/static/img/nav_li.gif) no-repeat;
}

/* content */
Expand All @@ -156,7 +155,7 @@ h1,h2,h3 {
margin-bottom: 6px;
}
.content li {
list-style: url(/img/li.gif);
list-style: url(/static/img/li.gif);
margin-left: 18px;
}

Expand All @@ -173,7 +172,7 @@ h1,h2,h3 {

/* footer */
.footer {
background: #0094D6 url(/img/bgfooter.gif) repeat-x;
background: #0094D6 url(/static/img/bgfooter.gif) repeat-x;
color: #C1DEF0;
font-size: 1.1em;
line-height: 40px;
Expand Down
1 change: 1 addition & 0 deletions static/static

0 comments on commit 23a324a

Please sign in to comment.