Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chrisross5/infoeduka
College team project (Project approach to applications development S4): A Django student-news app, deployed on GCP App Engine. Supports user & admin roles with CRUD for news, courses, and lecturers.
https://github.com/chrisross5/infoeduka
appengine azure-app-service azure-devops django django-template python sql sqlite
Last synced: about 2 hours ago
JSON representation
College team project (Project approach to applications development S4): A Django student-news app, deployed on GCP App Engine. Supports user & admin roles with CRUD for news, courses, and lecturers.
- Host: GitHub
- URL: https://github.com/chrisross5/infoeduka
- Owner: ChrisRoss5
- Created: 2024-03-14T05:10:39.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-08-01T01:21:22.000Z (4 months ago)
- Last Synced: 2024-08-02T04:13:37.332Z (4 months ago)
- Topics: appengine, azure-app-service, azure-devops, django, django-template, python, sql, sqlite
- Language: Python
- Homepage: https://infoeduka.k1k1.dev
- Size: 7.35 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# App deployed on GCP, App Engine
### https://infoeduka.k1k1.dev
-- OR --
### https://infoeduka.oa.r.appspot.com
**IMPORTANT: Startup may take up to 10s due to cold start.**
| EMAIL ADDRESS | PASSWORD | STAFF STATUS |
| ------------------ | -------- | ------------ |
| [email protected] | 1 | Yes |
| [email protected] | 1 | No |Visit `/admin` to access Django admin interface.
### About deployment
Steps to deploy a Django app with an SQLite database to the App Engine standard environment:
1. add `app.yaml` to root
2. update `settings.py`: allowed hosts, trusted origins and database initialization
3. run `python manage.py collectstatic`
4. run `gcloud app deploy`The key is to have `init-db.sqlite3` deployed to the App Engine `/tmp` directory, which is writable.
This allows for a prepopulated database that resets with each new instance.
Instances can scale down to zero when not in use.
The `init-db.sqlite3` file contains only the user data as shown above.### Azure DevOps
https://dev.azure.com/PRA23-Tim5/_git/Infoeduka%20project
---
⬇ _Original README_ ⬇
## Instalacija
Potreban je Python 3.8 ili noviji za Django 4.2. Više na: [How to install Django](https://docs.djangoproject.com/en/4.2/topics/install/)
```
pip install -r requirements.txt
```## Pokretanje
```
python manage.py migrate
python manage.py runserver
```Nakon dodavanja modela potrebno je napraviti migraciju i spremiti ju u bazu podataka:
```
python manage.py makemigrations
python manage.py migrate
```Nakon izmjene modela najlakše je izbrisati bazu i migracije te započeti iznova.
## Korisnici
Predavači su `Useri`.
Administratori su `Superuseri` (`Useri` sa `is_staff=True` i `is_superuser=True`)
Provjera administratora u kodu se provjerava sa `user.is_staff`.
Više na: [Using the Django authentication system](https://docs.djangoproject.com/en/4.2/topics/auth/default/) i [django.contrib.auth](https://docs.djangoproject.com/en/4.2/ref/contrib/auth/#django-contrib-auth)
### Primjeri korisnika:
| USERNAME | EMAIL ADDRESS | FIRST NAME | LAST NAME | STAFF STATUS | PASSWORD |
| ------------------ | ------------------ | ------------ | ---------------- | ------------ | -------- |
| [email protected] | [email protected] | AdminIme1 | AdminPrezime1 | Yes | 1 |
| [email protected] | [email protected] | PredavacIme1 | PredavacPrezime1 | No | 1 |### Dodavanje korisnika iz primjera:
```
python manage.py shell
``````
from django.contrib.auth.models import User
User.objects.create_superuser(username="[email protected]", email="[email protected]", first_name="AdminIme1", last_name="AdminPrezime1", password="1")
User.objects.create_user(username="[email protected]", email="[email protected]", first_name="PredavacIme1", last_name="PredavacPrezime1", password="1")
```### Dodavanje superusera (drugi način):
```
python manage.py createsuperuser
```