Skip to content

Commit

Permalink
week 1
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-allaway committed Feb 9, 2024
1 parent c2ad46e commit 9b0069b
Show file tree
Hide file tree
Showing 26 changed files with 1,215 additions and 232 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ exclude =
__pycache__,
venv,
resources/private
max-line-length = 119
max-line-length = 300
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
###################### Project-specific Ignore Paths ######################

venv/
resources/private/
*.sqlite3
django/media/
django/static/
node_modules/
private/
private_testdata*


###################### Django Templated gitignore paths ######################
Expand Down
87 changes: 0 additions & 87 deletions .gitlab-ci.yml

This file was deleted.

160 changes: 101 additions & 59 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,63 +1,105 @@
{
"extends": ["stylelint-config-standard"],
"plugins": ["@stylistic/stylelint-plugin"],
"__comment": "Copied from https://github.com/stylelint/stylelint-config-standard",
"rules": {
"@stylistic/at-rule-name-space-after": "always-single-line",
"@stylistic/at-rule-semicolon-newline-after": "always",
"@stylistic/block-closing-brace-empty-line-before": "never",
"@stylistic/block-closing-brace-newline-after": "always",
"@stylistic/block-closing-brace-newline-before": "always-multi-line",
"@stylistic/block-closing-brace-space-before": "always-single-line",
"@stylistic/block-opening-brace-newline-after": "always-multi-line",
"@stylistic/block-opening-brace-space-after": "always-single-line",
"@stylistic/block-opening-brace-space-before": "always",
"@stylistic/declaration-bang-space-after": "never",
"@stylistic/declaration-bang-space-before": "always",
"@stylistic/declaration-block-semicolon-newline-after": "always-multi-line",
"@stylistic/declaration-block-semicolon-space-after": "always-single-line",
"@stylistic/declaration-block-semicolon-space-before": "never",
"@stylistic/declaration-block-trailing-semicolon": "always",
"@stylistic/declaration-colon-newline-after": "always-multi-line",
"@stylistic/declaration-colon-space-after": "always-single-line",
"@stylistic/declaration-colon-space-before": "never",
"@stylistic/function-comma-newline-after": "always-multi-line",
"@stylistic/function-comma-space-after": "always-single-line",
"@stylistic/function-comma-space-before": "never",
"@stylistic/function-max-empty-lines": 0,
"@stylistic/function-parentheses-newline-inside": "always-multi-line",
"@stylistic/function-parentheses-space-inside": "never-single-line",
"@stylistic/function-whitespace-after": "always",
"@stylistic/indentation": 4,
"@stylistic/max-empty-lines": 1,
"@stylistic/media-feature-colon-space-after": "always",
"@stylistic/media-feature-colon-space-before": "never",
"@stylistic/media-feature-name-case": "lower",
"@stylistic/media-feature-parentheses-space-inside": "never",
"@stylistic/media-feature-range-operator-space-after": "always",
"@stylistic/media-feature-range-operator-space-before": "always",
"@stylistic/media-query-list-comma-newline-after": "always-multi-line",
"@stylistic/media-query-list-comma-space-after": "always-single-line",
"@stylistic/media-query-list-comma-space-before": "never",
"@stylistic/no-eol-whitespace": true,
"@stylistic/no-missing-end-of-source-newline": true,
"@stylistic/number-no-trailing-zeros": true,
"@stylistic/property-case": "lower",
"@stylistic/selector-attribute-brackets-space-inside": "never",
"@stylistic/selector-attribute-operator-space-after": "never",
"@stylistic/selector-attribute-operator-space-before": "never",
"@stylistic/selector-combinator-space-after": "always",
"@stylistic/selector-combinator-space-before": "always",
"@stylistic/selector-descendant-combinator-no-non-space": true,
"@stylistic/selector-list-comma-newline-after": "always",
"@stylistic/selector-list-comma-space-before": "never",
"@stylistic/selector-max-empty-lines": 0,
"@stylistic/selector-pseudo-class-case": "lower",
"@stylistic/selector-pseudo-class-parentheses-space-inside": "never",
"@stylistic/selector-pseudo-element-case": "lower",
"@stylistic/unit-case": "lower",
"@stylistic/value-list-comma-newline-after": "always-multi-line",
"@stylistic/value-list-comma-space-after": "always-single-line",
"@stylistic/value-list-comma-space-before": "never",
"@stylistic/value-list-max-empty-lines": 0
"at-rule-empty-line-before": [ "always", {
"except": [
"blockless-after-same-name-blockless",
"first-nested"
],
"ignore": ["after-comment"]
}],
"at-rule-name-case": "lower",
"at-rule-name-space-after": "always-single-line",
"at-rule-semicolon-newline-after": "always",
"block-closing-brace-empty-line-before": "never",
"block-closing-brace-newline-after": "always",
"block-closing-brace-newline-before": "always-multi-line",
"block-closing-brace-space-before": "always-single-line",
"block-opening-brace-newline-after": "always-multi-line",
"block-opening-brace-space-after": "always-single-line",
"block-opening-brace-space-before": "always",
"color-hex-length": "short",
"comment-empty-line-before": ["always", {
"except": ["first-nested"],
"ignore": ["stylelint-commands"]
}],
"comment-whitespace-inside": "always",
"custom-property-empty-line-before": ["always", {
"except": [
"after-custom-property",
"first-nested"
],
"ignore": [
"after-comment",
"inside-single-line-block"
]
}],
"declaration-bang-space-after": "never",
"declaration-bang-space-before": "always",
"declaration-block-semicolon-newline-after": "always-multi-line",
"declaration-block-semicolon-space-after": "always-single-line",
"declaration-block-semicolon-space-before": "never",
"declaration-block-single-line-max-declarations": 1,
"declaration-block-trailing-semicolon": "always",
"declaration-colon-newline-after": "always-multi-line",
"declaration-colon-space-after": "always-single-line",
"declaration-colon-space-before": "never",
"declaration-empty-line-before": ["always", {
"except": [
"after-declaration",
"first-nested"
],
"ignore": [
"after-comment",
"inside-single-line-block"
]
}],
"function-comma-newline-after": "always-multi-line",
"function-comma-space-after": "always-single-line",
"function-comma-space-before": "never",
"function-max-empty-lines": 0,
"function-name-case": "lower",
"function-parentheses-newline-inside": "always-multi-line",
"function-parentheses-space-inside": "never-single-line",
"function-whitespace-after": "always",
"indentation": 4,
"length-zero-no-unit": true,
"max-empty-lines": 1,
"media-feature-colon-space-after": "always",
"media-feature-colon-space-before": "never",
"media-feature-name-case": "lower",
"media-feature-parentheses-space-inside": "never",
"media-feature-range-operator-space-after": "always",
"media-feature-range-operator-space-before": "always",
"media-query-list-comma-newline-after": "always-multi-line",
"media-query-list-comma-space-after": "always-single-line",
"media-query-list-comma-space-before": "never",
"no-eol-whitespace": true,
"no-missing-end-of-source-newline": true,
"number-no-trailing-zeros": true,
"property-case": "lower",
"rule-empty-line-before": ["always-multi-line", {
"except": ["first-nested"],
"ignore": ["after-comment"]
}],
"selector-attribute-brackets-space-inside": "never",
"selector-attribute-operator-space-after": "never",
"selector-attribute-operator-space-before": "never",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"selector-descendant-combinator-no-non-space": true,
"selector-list-comma-newline-after": "always",
"selector-list-comma-space-before": "never",
"selector-max-empty-lines": 0,
"selector-pseudo-class-case": "lower",
"selector-pseudo-class-parentheses-space-inside": "never",
"selector-pseudo-element-case": "lower",
"selector-pseudo-element-colon-notation": "double",
"selector-type-case": "lower",
"unit-case": "lower",
"value-list-comma-newline-after": "always-multi-line",
"value-list-comma-space-after": "always-single-line",
"value-list-comma-space-before": "never",
"value-list-max-empty-lines": 0
}
}
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © 2020 University of Birmingham
Copyright © 2024 University of Birmingham

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
# RSG Django Template
# Cristero War

This project is a Django-based website created by the Research Software Group. This is our template for all new Django projects.
When you make a project please mention (in a git commit?) which version of the template project you used - E.g. "Based on django-template commit 8asde872"

## Using this as a template to start up a new project

* Fork this template project (just click "fork" in GitLab)
* Change the places it talks about being a template project into your own project (e.g. name) and send a merge request to get the changes merged *in your new repository*.
* We would not normally expect you to pull any new changes from the template into your fork, or push any changes back. There may be exceptions to this though.
This project is a Django-based website created by the Research Software Group for the "Cristero War" research project (full project title: "Encarnación de Díaz: Photohistories of the Cristero War") at the University of Birmingham, UK.

## Getting Started

Expand All @@ -17,7 +10,7 @@ These instructions will get you a copy of the project up and running on your loc

To run this project, you're required to have the following software installed on your machine:

* Python 3 (for specific Python 3 version please see the [Django documentation](https://www.djangoproject.com/)
* Python 3 (for specific Python 3 version please see the [Django documentation](https://www.djangoproject.com/))
* pip
* virtualenv

Expand Down
8 changes: 3 additions & 5 deletions django/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# RSG Django Template - Django Project

RSG Django Template.
# Cristero War - Django Project

This document is primarily designed for technical staff working on the development of the project (e.g. software engineers and system admins).


## Django Project

The project is called 'django-template', but project files are stored in the 'core' folder. Please refer to `core/settings.py` for further details
The project is called 'cristero-war', but project files are stored in the 'core' folder. Please refer to `core/settings.py` for further details


## Django Apps
Expand Down Expand Up @@ -72,7 +70,7 @@ Please note that the RSG's template Django project will link to the home page of

## Database

The SQLite3 database used sits in the Django project root folder (alongside this README file). It is not included within the Git repo, so must instead be requested from the system admin. Once you have a copy of this database, give it a suitable name like `django-template.sqlite3` and place in the `django/` directory (same directory that stores `manage.py`). Remember to name this database in `local_settings.py` (see Settings section of this document for more details)
The SQLite3 database used sits in the Django project root folder (alongside this README file). It is not included within the Git repo, so must instead be requested from the system admin. Once you have a copy of this database, give it a suitable name like `cristero-war.sqlite3` and place in the `django/` directory (same directory that stores `manage.py`). Remember to name this database in `local_settings.py` (see Settings section of this document for more details)


## Settings
Expand Down
6 changes: 3 additions & 3 deletions django/core/local_settings.example.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
DEBUG = True/False

# Set to ['*'] if in development, or specific IP addresses and domains if in production
ALLOWED_HOSTS = ['*']/['django-template.bham.ac.uk']
ALLOWED_HOSTS = ['*']/['cristero-war.bham.ac.uk']

# Provide the email address for the site admin (e.g. the researcher/research team)
ADMIN_EMAIL = '[email protected]'
Expand All @@ -26,9 +26,9 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'django-template.sqlite3'),
'NAME': os.path.join(BASE_DIR, 'cristero-war.sqlite3'),
'TEST': {
'NAME': os.path.join(BASE_DIR, 'django-template_TEST.sqlite3'),
'NAME': os.path.join(BASE_DIR, 'cristero-war_TEST.sqlite3'),
},
}
}
4 changes: 2 additions & 2 deletions django/core/local_settings.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'django-template.sqlite3'),
'NAME': os.path.join(BASE_DIR, 'cristero-war.sqlite3'),
'TEST': {
'NAME': os.path.join(BASE_DIR, 'django-template_TEST.sqlite3'),
'NAME': os.path.join(BASE_DIR, 'cristero-war_TEST.sqlite3'),
},
}
}
Loading

0 comments on commit 9b0069b

Please sign in to comment.