Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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.

Notifications You must be signed in to change notification settings

ChrisRoss5/infoeduka

Repository files navigation

App deployed on GCP, App Engine

-- OR --

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

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 i 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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •