I have a python application that uses Django models for easy storage of data. It is NOT a django app, I'm just attempting to use models from django.db, JSONField from django.contrib.postgres.fields and other useful parts.
When I attempt to run python manage.py makemigrations
, the terminal stalls. How do I debug this?
Here are some snippets of my code:
manga_shell/models.py
import os, django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "manga_project.settings")
django.setup()
from django.db import models
from django.contrib.postgres.fields import JSONField
class Manga(models.Model):
# fields
class Chapter(models.Model):
# fields
class Page(models.Model):
# fields
manga_project/settings.py
import dj_database_url, os
SECRET_KEY = #secret :P
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
INSTALLED_APPS = (
'django.contrib.postgres',
'manga_shell',
)
DATABASES = {'default': dj_database_url.config(default='postgres://MyUserName:MyPassword@localhost:5432/manga_project_db')}
TIMEZONE = 'Asia/Kolkata'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
If more code is required, I'll post it. I'm not entirely clear on what might cause manage.py to stall, so I don't know for sure which snippets of code are needed. Thanks in advance for the help.