Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

#73 Restart with Django 4 #74

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,34 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.10"]
python-version: ["3.10"]
env:
MAIN_PYTHON_VERSION: "3.8" # same as Ubuntu 20 LTS
MAIN_PYTHON_VERSION: "3.10" # same as Ubuntu 22 LTS

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: |
pip install -r requirements/testing.txt
- name: Install Ubuntu package dependencies
run: sudo apt-get install gettext graphviz graphviz-dev
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction
- name: Run the test suite
run: |
coverage run manage-testing.py test pygraz_website.apps.accounts pygraz_website.apps.companies pygraz_website.apps.core pygraz_website.apps.meetups
- name: Build coverage report
run: |
coverage html
coverage report
run: pytest

check-style:
runs-on: ubuntu-latest
Expand Down
15 changes: 3 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
*.pyc
.env
*.css
*.sass-cache*
*.diff
*.sql
*.sublime*
.codeintel
.venv
*.retry
pygraz_website/static/css/icomoon
*.DS_Store
*.zip
*.mo
pygraz_website/settings/live.py
pygraz_website/settings/stage.py
live.ini
stage.ini
Procfile
.tox
.coverage
htmlcov
/database.db
/pygraz.dump
/_old/
/pygraz.sqlite3
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 15 additions & 2 deletions .idea/pygraz_website.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ repos:
- id: isort

- repo: https://github.com/ambv/black
rev: 23.7.0
rev: 23.10.1
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0
rev: v3.0.3
hooks:
- id: prettier

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: fix-byte-order-marker
- id: trailing-whitespace
Expand All @@ -30,13 +30,13 @@ repos:
- id: mixed-line-ending

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies: ["pep8-naming==0.13.3"]

- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
rev: v3.15.0
hooks:
- id: pyupgrade
args: ["--py38-plus"]
Expand All @@ -45,7 +45,7 @@ repos:
# even for the rare case a commit should go into one of the protected
# branches.
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: no-commit-to-branch
args: ["--branch", "develop"]
1 change: 0 additions & 1 deletion .python-version

This file was deleted.

13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Dorian Santner
Horst Gutmann <[email protected]>
Thomas Aglassinger <[email protected]>
5 changes: 0 additions & 5 deletions Makefile

This file was deleted.

72 changes: 17 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Coverage Status](https://coveralls.io/repos/pygraz/website/badge.svg?branch=develop)](https://coveralls.io/r/pygraz/website?branch=develop)

The PyGRAZ website currently supports the creation of meetups and for users to make session proposal which can
The PyGRAZ website currently supports the creation of meetups and for admin to make session proposal which can
then be assigned to a meetup.

Each proposal can have descriptive information associated with it like an abstract, a description and notes.
Expand All @@ -26,82 +26,44 @@ git clone <url of this repo>
cd website
```

Then create a virtualenv for all the Python requirements, activate it and install the requirements:
Then install [poetry](https://python-poetry.org/) and install the requirements:

```bash
mkvirtualenv --no-site-packages env
source env/bin/active
pip install -r requirements/base.txt
pip install -r requirements/development.txt
poetry install
```

We are using a multi-settings-file approach for handling settings on different target systems. For local development
you should use "pygraz_website/settings/development.py" which just sets some plain defaults and doesn't send emails.

Next, install the pre-commit hooks to perform static checks on your code everytime you commit:

```bash
pre-commit install
```

Now on to creating the database. By default, the website looks for a PostgreSQL database by the name of
"pygraz-website" accessibly by the current system user.

If you want to use for instance a sqlite database, add following content to your development.py file you created in
the last step:

```python
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': join(ROOT, 'localdb.sqlite3'),
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
poetry run pre-commit install
```

Now run following commands to initialize the database:

```bash
python manage-dev.py syncdb
python manage-dev.py migrate
```
Currently, the site uses an SQLite database. No further setup is needed for this.

To finally start the server run ...
If you just want to run the application locally and want to fill the database with generated demonstration data, you can run:

```bash
python manage-dev.py runserver
poetry run python manage.py make_demo
```

When you first visit http://localhost:8000, you will notice that all the stylesheets are still missing.
For local development we would recommend that you open another terminal, go to the pygraz_website/static folder and
execute following command:
To launch the application run:

```bash
compass watch
poetry run python manage.py runserver
```

This will compile the stylesheets using Compass and keep the process running so that changes the .scss files are
automatically compiled into .css files.

## Components not included
Then visit http://127.0.0.1:8000/

The pygraz.org website uses the icomoon icon-font for its icons. Due to license restrictions we are not allowed to
bundle it with the website's source code. For details on this font visit http://keyamoon.com/icomoon/
## Testing

## Deployment
All tests are located in the `tests` folder and its respective sub-folders.

For deployments, we are using an Ansible playbook which builds a production.zip
and deploys that onto the target server:
For testing, run:

```bash
cd ansible/playbooks
ansible-playbook -i ../hosts deploy.yml
poetry run pytest
```

[pip]: http://pypi.python.org/pypi/pip
[rc]: http://recaptcha.net/
[pm]: http://postmarkapp.com
## Deployment

**To be defined.**
2 changes: 0 additions & 2 deletions ansible/hosts

This file was deleted.

46 changes: 0 additions & 46 deletions ansible/playbooks/deploy.yml

This file was deleted.

File renamed without changes.
6 changes: 6 additions & 0 deletions core/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.contrib import admin

from core.models import Location, Meetup, Session, SessionType

for model in [Location, Meetup, Session, SessionType]:
admin.site.register(model)
6 changes: 6 additions & 0 deletions core/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class CoreConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "core"
Loading
Loading