Skip to content

Commit

Permalink
Remake as Django app
Browse files Browse the repository at this point in the history
  • Loading branch information
samirelanduk committed Dec 30, 2018
1 parent 1aaa7a3 commit d44be4a
Show file tree
Hide file tree
Showing 60 changed files with 51 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
__pycache__
*.pyc
*.sqlite3
secrets.py
Empty file added core/__init__.py
Empty file.
25 changes: 25 additions & 0 deletions core/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import os
from .secrets import SECRET_KEY

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

ALLOWED_HOSTS = []
DEBUG = True

ROOT_URLCONF = "core.urls"

INSTALLED_APPS = [
"django.contrib.staticfiles",
"core",
]

TEMPLATES = [{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"APP_DIRS": True,
}]

MIDDLEWARE = []

STATIC_URL = "/assets/"
STATIC_ROOT = os.path.abspath(f"{BASE_DIR}/../static")
SASS_PROCESSOR_ROOT = os.path.abspath(f"{BASE_DIR}/core/static")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions style.css → core/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ button:focus {
/*--------------------*/

#mu-hero {
background-image: url("assets/images/header-background2.jpeg");
background-image: url("/assets/images/header-background2.jpeg");
display: inline;
float: left;
width: 100%;
Expand Down Expand Up @@ -468,7 +468,7 @@ button:focus {


#mu-video {
background-image: url("assets/images/about-video-bg.jpg");
background-image: url("/assets/images/about-video-bg.jpg");
background-attachment: fixed;
background-position: center center;
-webkit-background-size: cover;
Expand Down Expand Up @@ -982,7 +982,7 @@ button:focus {
/*--------------------*/

#mu-register {
background-image: url("assets/images/register-bg.jpg");
background-image: url("/assets/images/register-bg.jpg");
background-position: center center;
background-size: cover;
background-attachment: fixed;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions index.html → core/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<link id="switcher" href="assets/css/orange-theme.css" rel="stylesheet">

<!-- Main Style -->
<link href="style.css" rel="stylesheet">
<link href="/assets/css/style.css" rel="stylesheet">

<!-- Fonts -->

Expand Down Expand Up @@ -62,7 +62,7 @@
</button>

<!-- Logo -->
<a class="navbar-brand" href="index.html"><img src="assets/images/logo-no-text.png" alt="logo img"></a>
<a class="navbar-brand" href="/"><img src="assets/images/logo-no-text.png" alt="logo img"></a>

</div>

Expand Down
6 changes: 6 additions & 0 deletions core/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.urls import path
from core.views import *

urlpatterns = [
path("", home)
]
4 changes: 4 additions & 0 deletions core/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from django.shortcuts import redirect, render

def home(request):
return render(request, "home.html")
7 changes: 7 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python
import os
import sys

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)

0 comments on commit d44be4a

Please sign in to comment.