This repo contains frontend(Angular) and backend(Django DRF) of an SPA.
Home | Upload Dialog | Auth(Login) | Auth(Register) |
---|---|---|---|
(start backend server first)
cd frontend
npm i
to install dependenciesng serve
Swagger UI: http://127.0.0.1:8000/api/schema/docs/
- or paste
./dbdiagram[dot]io.txt
at dbdiagram.io
- Project name is
flagship
- 3 apps:
common
,gallery
anduser
-
create venv, using
python -m venv venv
-
activate the environment
Ubuntu `source venv/bin/activate` Windows Powershell `venv\Scripts\Activate.ps1` Windows CMD `venv\Scripts\activate.bat`
-
install dependencies
pip install -r requirements.txt
-
connect with local MySQL instance at
flagship/flagship/settings/dev.py
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': '<schema_name>', 'USER': '<user_name>', 'PASSWORD': '<password>', 'HOST':'localhost', 'PORT':'3306', } } # change redis server's port, default is 6379 CELERY_BROKER_URL = "redis://localhost:6379" CELERY_RESULT_BACKEND = "redis://localhost:6379"
-
set firebase storage credentails at
./flagship/common/storage.py
cred = credentials.Certificate("C:\\Path\\to\\key") firebase_admin.initialize_app(cred, { 'storageBucket': '<your-app-url>.appspot.com' })
-
start redis server
> redis-server
-
start celery client (call this inside ./flagship)
> celery --app=flagship worker -l INFO --pool=solo
-
make migrations, migrate and runserver
cd python manage.py makemigrations python manage.py migrate python manage.py runserver 8000