Skip to content

Commit c9fce9d

Browse files
committed
base template
1 parent 380a128 commit c9fce9d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+4223
-10
lines changed

app/resources/js/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'bootstrap';
12
import { createApp } from 'vue';
23

34
import ExampleComponent from "./components/ExampleComponent";

app/resources/sass/app.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@import "~bootstrap/scss/bootstrap";
2+
main > .container {
3+
padding: 60px 15px 0;
4+
}

djangoStarter/config.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.conf import settings
2+
3+
4+
def global_settings(request):
5+
return {
6+
'APP_NAME': 'Django Vue Starter'
7+
}

djangoStarter/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
'django.template.context_processors.request',
6666
'django.contrib.auth.context_processors.auth',
6767
'django.contrib.messages.context_processors.messages',
68+
'djangoStarter.config.global_settings'
6869
],
6970
},
7071
},

package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
"vue-loader": "^16.1.2"
2626
},
2727
"dependencies": {
28+
"@popperjs/core": "^2.6.0",
29+
"bootstrap": "^5.0.0-beta2",
30+
"bootstrap-icons": "^1.3.0",
31+
"popper.js": "^1.16.1",
2832
"primeicons": "^4.1.0",
2933
"primevue": "^3.2.4",
3034
"vue": "^3.0.5"

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Django~=3.1.6
2+
djangorestframework
3+
psycopg2-binary

templates/app/_partials/navbar.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<header>
2+
<!-- Fixed navbar -->
3+
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
4+
<div class="container-fluid">
5+
<a class="navbar-brand" href="#">{{ APP_NAME }}</a>
6+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
7+
<span class="navbar-toggler-icon"></span>
8+
</button>
9+
<div class="collapse navbar-collapse" id="navbarCollapse">
10+
<div class="navbar-nav me-auto mb-2 mb-md-0">
11+
{# Space for menu items in left #}
12+
</div>
13+
<div class="d-flex">
14+
<ul class="navbar-nav me-auto mb-2 mb-md-0">
15+
<li class="nav-item">
16+
<a class="nav-link active" aria-current="page" href="/">Login</a>
17+
</li>
18+
<li class="nav-item">
19+
<a class="nav-link" href="#">Register</a>
20+
</li>
21+
</ul>
22+
</div>
23+
</div>
24+
</div>
25+
</nav>
26+
</header>

templates/app/base_layout.html

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,43 @@
11
{% load static %}
2-
<html>
3-
2+
<!DOCTYPE html>
3+
<html lang="en">
44
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>{{ APP_NAME }}</title>
9+
<meta name="theme-color" content="#7952b3">
10+
11+
<style>
12+
.bd-placeholder-img {
13+
font-size: 1.125rem;
14+
text-anchor: middle;
15+
-webkit-user-select: none;
16+
-moz-user-select: none;
17+
user-select: none;
18+
}
519

6-
<!-- refer to CSS that was compiled by Laravel Mix -->
20+
@media (min-width: 768px) {
21+
.bd-placeholder-img-lg {
22+
font-size: 3.5rem;
23+
}
24+
}
25+
</style>
726

8-
<link rel="stylesheet" type="text/css" href="{% static 'build/app.css' %}">
27+
<!-- refer to CSS that was compiled by Laravel Mix -->
28+
<link rel="stylesheet" type="text/css" href="{% static 'build/app.css' %}">
929
</head>
30+
<body class="d-flex flex-column h-100">
31+
{% include 'app/_partials/navbar.html' %}
32+
33+
<!-- Begin page content -->
34+
<main class="flex-shrink-0" id="app">
1035

11-
<body>
12-
<div id="app">
1336
{% block main_content %}
1437

1538
{% endblock %}
16-
</div>
39+
40+
</main>
1741

1842
<!-- refer to JS that was compiled by Laravel Mix -->
1943
<script type="text/javascript" src="{% static 'build/app.js' %}"></script>

templates/app/index.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{% extends 'app/base_layout.html' %}
22

33
{% block main_content %}
4-
5-
<h1>Hello, world. You're at the app index.</h1>
6-
<example-component></example-component>
4+
<div class="container">
5+
<h1 class="mt-5 text-center">Django Vue Starter</h1>
6+
<div class="text-center">
7+
<a href="" class="btn btn-primary">Login</a>
8+
</div>
9+
</div>
710

811
{% endblock %}

0 commit comments

Comments
 (0)