Skip to content

Commit 069b833

Browse files
authored
Merge pull request #4 from Python-Cameroun/jefcolbi
added Meta system and jazzmin
2 parents 7d16bf9 + 7aeba28 commit 069b833

File tree

5 files changed

+194
-28
lines changed

5 files changed

+194
-28
lines changed

.gitignore

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
*.log
2-
*.pot
3-
*.pyc
4-
__pycache__/
5-
local_settings.py
6-
db.sqlite3
7-
.DS_Store
1+
2+
.env
3+
*.wpr
4+
*.wpu
85

96
# Created by https://www.toptal.com/developers/gitignore/api/python,django,vscode,pycharm+all
107
# Edit at https://www.toptal.com/developers/gitignore?templates=python,django,vscode,pycharm+all
@@ -316,3 +313,4 @@ modules.xml
316313
*.code-workspace
317314

318315
# End of https://www.toptal.com/developers/gitignore/api/python,django,vscode,pycharm+all
316+

Pipfile

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ verify_ssl = true
44
name = "pypi"
55

66
[packages]
7-
django = "*"
7+
django = "~=2.2"
88
python-dotenv = "*"
9+
django-meta = "*"
10+
django-template-data = "*"
11+
django-jazzmin = "*"
912

1013
[dev-packages]
1114

1215
[requires]
13-
python_version = "3.9"
16+
python_version = "3.6"

Pipfile.lock

+35-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/core/templates/core/base.html

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% load static %}
2+
{% load meta %}
23
<!DOCTYPE html>
34
<html lang="en">
45

@@ -10,23 +11,25 @@
1011
<link rel="stylesheet" href="{% static 'css/main.css' %}">
1112

1213
<title>{% block title %} {% endblock title %}</title>
14+
15+
{% include 'meta/meta.html' %}
1316
</head>
1417
<body>
1518

16-
17-
19+
20+
1821
{% if messages %}
1922
<!-- Then put toasts within -->
2023
{% for message in messages %}
2124
<div class="alert alert-{{message.tags}} alert-dismissible fade show" role="alert">
22-
<strong>{{message}} </strong>
25+
<strong>{{message}} </strong>
2326
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
2427
<span aria-hidden="true">&times;</span>
2528
</button>
2629
</div>
2730
{% endfor %}
2831
{% endif %}
29-
32+
3033
{% block content %}
3134

3235
{% endblock content %}
@@ -60,14 +63,14 @@
6063
<!-- Footer starts-->
6164
<footer>
6265
<!-- Copyright -->
63-
<div class="small text-center">&copy;<script>document.write(new Date().getFullYear())</script> (PYCUG) Python Cameroon User Group |
66+
<div class="small text-center">&copy;<script>document.write(new Date().getFullYear())</script> (PYCM) Python Cameroon |
6467
Designed & Developed with ❤️ and ☕️ . All the souce code available on github
6568

6669
</div>
6770
<!-- Copyright -->
6871

6972
<a style="position: fixed; top: 100%; right: 0;" class="gh-fork"
70-
href="https://github.com/Python-Cameroun/pythoncm-website">
73+
href="https://github.com/Python-Cameroun/website-v2">
7174
<img src="https://raw.github.com/anasnakawa/kalendae-skins/gh-pages/images/forkme-red.png"
7275
alt="Fork me on GitHub">
7376
</a>
@@ -91,4 +94,4 @@
9194
{% endblock scripts %}
9295
</body>
9396

94-
</html>
97+
</html>

website/settings.py

+139-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
# Application definition
4747

4848
INSTALLED_APPS = [
49+
'jazzmin',
4950
'django.contrib.admin',
5051
'django.contrib.auth',
5152
'django.contrib.contenttypes',
@@ -55,6 +56,8 @@
5556
'apps.core',
5657
'apps.project',
5758
'apps.event',
59+
'meta',
60+
'template_data',
5861
]
5962

6063
MIDDLEWARE = [
@@ -80,6 +83,7 @@
8083
'django.template.context_processors.request',
8184
'django.contrib.auth.context_processors.auth',
8285
'django.contrib.messages.context_processors.messages',
86+
'template_data.processors.load_data',
8387
],
8488
},
8589
},
@@ -105,7 +109,7 @@
105109
DATABASES = {
106110
'default': {
107111
'ENGINE': 'django.db.backends.sqlite3',
108-
'NAME': BASE_DIR / 'db.sqlite3',
112+
'NAME': str(BASE_DIR / 'db.sqlite3'),
109113
}
110114
}
111115

@@ -166,3 +170,137 @@
166170
# EMAIL_HOST_PASSWORD =""
167171
# EMAIL_USE_TLS =False
168172
# EMAIL_USE_SSL =False
173+
174+
# Meta settings
175+
META_SITE_PROTOCOL = "https"
176+
META_SITE_DOMAIN = "pythoncm.org"
177+
META_SITE_NAME = "Python Cameroon"
178+
META_INCLUDE_KEYWORDS = ["pycm", "pythoncm", "python cameroon", 'python cameroun']
179+
META_USE_OG_PROPERTIES = True
180+
META_USE_TWITTER_PROPERTIES = True
181+
META_USE_GOOGLEPLUS_PROPERTIES = True
182+
META_OG_SECURE_URL_ITEMS = []
183+
184+
185+
JAZZMIN_SETTINGS = {
186+
# title of the window
187+
"site_title": "Python Cameroon Admin",
188+
189+
# Title on the brand, and the login screen (19 chars max)
190+
"site_header": "Python Cameroon",
191+
192+
# square logo to use for your site, must be present in static files, used for favicon and brand on top left
193+
#"site_logo": "books/img/logo.png",
194+
195+
# Welcome text on the login screen
196+
"welcome_sign": "Welcome to Python Cameroon",
197+
198+
# Copyright on the footer
199+
"copyright": "PyCM",
200+
201+
# The model admin to search from the search bar, search bar omitted if excluded
202+
#"search_model": "auth.User",
203+
204+
# Field name on user model that contains avatar image
205+
#"user_avatar": None,
206+
207+
############
208+
# Top Menu #
209+
############
210+
211+
# Links to put along the top menu
212+
#"topmenu_links": [
213+
214+
## Url that gets reversed (Permissions can be added)
215+
#{"name": "Home", "url": "admin:index", "permissions": ["auth.view_user"]},
216+
217+
## external url that opens in a new window (Permissions can be added)
218+
#{"name": "Support", "url": "https://github.com/farridav/django-jazzmin/issues", "new_window": True},
219+
220+
## model admin to link to (Permissions checked against model)
221+
#{"model": "auth.User"},
222+
223+
## App with dropdown menu to all its models pages (Permissions checked against models)
224+
#{"app": "books"},
225+
#],
226+
227+
##############
228+
## User Menu #
229+
##############
230+
231+
## Additional links to include in the user menu on the top right ("app" url type is not allowed)
232+
#"usermenu_links": [
233+
#{"name": "Support", "url": "https://github.com/farridav/django-jazzmin/issues", "new_window": True},
234+
#{"model": "auth.user"}
235+
#],
236+
237+
#############
238+
# Side Menu #
239+
#############
240+
241+
# Whether to display the side menu
242+
"show_sidebar": True,
243+
244+
# Whether to aut expand the menu
245+
"navigation_expanded": True,
246+
247+
## Hide these apps when generating side menu e.g (auth)
248+
#"hide_apps": [],
249+
250+
## Hide these models when generating side menu (e.g auth.user)
251+
#"hide_models": [],
252+
253+
## List of apps (and/or models) to base side menu ordering off of (does not need to contain all apps/models)
254+
#"order_with_respect_to": ["auth", "books", "books.author", "books.book"],
255+
256+
## Custom links to append to app groups, keyed on app name
257+
#"custom_links": {
258+
#"books": [{
259+
#"name": "Make Messages",
260+
#"url": "make_messages",
261+
#"icon": "fas fa-comments",
262+
#"permissions": ["books.view_book"]
263+
#}]
264+
#},
265+
266+
# Custom icons for side menu apps/models See https://fontawesome.com/icons?d=gallery&m=free
267+
# for a list of icon classes
268+
#"icons": {
269+
#"auth": "fas fa-users-cog",
270+
#"auth.user": "fas fa-user",
271+
#"auth.Group": "fas fa-users",
272+
#},
273+
## Icons that are used when one is not manually specified
274+
#"default_icon_parents": "fas fa-chevron-circle-right",
275+
#"default_icon_children": "fas fa-circle",
276+
277+
##################
278+
## Related Modal #
279+
##################
280+
## Use modals instead of popups
281+
#"related_modal_active": False,
282+
283+
##############
284+
## UI Tweaks #
285+
##############
286+
## Relative paths to custom CSS/JS scripts (must be present in static files)
287+
#"custom_css": None,
288+
#"custom_js": None,
289+
## Whether to show the UI customizer on the sidebar
290+
#"show_ui_builder": False,
291+
292+
################
293+
## Change view #
294+
################
295+
## Render out the change view as a single form, or in tabs, current options are
296+
## - single
297+
## - horizontal_tabs (default)
298+
## - vertical_tabs
299+
## - collapsible
300+
## - carousel
301+
#"changeform_format": "horizontal_tabs",
302+
## override change forms on a per modeladmin basis
303+
#"changeform_format_overrides": {"auth.user": "collapsible", "auth.group": "vertical_tabs"},
304+
## Add a language dropdown into the admin
305+
#"language_chooser": True,
306+
}

0 commit comments

Comments
 (0)