├── .gitignore ├── LICENSE ├── README.md ├── autogen ├── __init__.py ├── asgi.py ├── settings.py ├── urls.py └── wsgi.py ├── data └── programming_topics.csv ├── lite.sqlite3 ├── manage.py ├── nbs ├── Autogen_Final.ipynb └── django_setup.py ├── pyvenv.cfg ├── requirements.txt └── topics ├── __init__.py ├── admin.py ├── apps.py ├── migrations ├── 0001_initial.py ├── 0002_auto_20201108_1954.py ├── 0003_topic_percent_human.py ├── 0004_auto_20201108_2008.py ├── 0005_remove_topic_percent_human.py ├── 0006_topic_percent_human.py ├── 0007_auto_20201108_2014.py └── __init__.py ├── models.py ├── tests.py └── views.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | .DS_Store 131 | bin/ 132 | etc/ 133 | share/ 134 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Coding For Entrepreneurs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Autogenerate Django Models](https://static.codingforentrepreneurs.com/media/cfe-blog/auto-generate-django-models/Autogenerate_Django_Models.jpg)](https://www.codingforentrepreneurs.com/blog/auto-generate-django-models) 2 | 3 | # Autogenerate Django Models 4 | 5 | Learn how to take a scraped dataset and turn it into Django models using inspectdb. You can also use this method for legacy databases. 6 | 7 | We'll use: 8 | - Django (v2.2+) 9 | - Jupyter 10 | - SQLAlchemy 11 | - Pandas 12 | - sqlite3 13 | - Python (v3+) 14 | 15 | You can use this method to convert `SQLAlchemy`-managed models into `Django`-managed models as well. 16 | 17 | 18 | ## How to use (after watching tutorial): 19 | 20 | 1. Download / Clone this [Repo](https://kirr.co/0bu8v5) 21 | 2. Activate a virtual environment `python3 -m venv .` 22 | 3. Run `pip install -r requirements.txt` 23 | 4. Run `jupyter notebook` 24 | 5. Navigate to `nbs/` and open `Autogen_Final.ipynb` 25 | 6. Run All Cells 26 | 7. Update `models.py` as you need related to the `python manage.py inspectdb --database lite` command. 27 | 28 | > If you get a import error related to django, just do steps 2-4 in a new terminal / powershell. 29 | -------------------------------------------------------------------------------- /autogen/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingforentrepreneurs/Autogenerate-Django-Models/95f3ffc2ad6714a02ea16b124ae075dd7ff218c2/autogen/__init__.py -------------------------------------------------------------------------------- /autogen/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for autogen project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'autogen.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /autogen/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for autogen project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.1.3. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.1/ref/settings/ 11 | """ 12 | 13 | from pathlib import Path 14 | 15 | # Build paths inside the project like this: BASE_DIR / 'subdir'. 16 | BASE_DIR = Path(__file__).resolve().parent.parent 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = 'fxlcu4ujx-vk46w62wygha^q7=+!#e2cajoe-+r4skyb&z_r=w' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'topics', 41 | ] 42 | 43 | MIDDLEWARE = [ 44 | 'django.middleware.security.SecurityMiddleware', 45 | 'django.contrib.sessions.middleware.SessionMiddleware', 46 | 'django.middleware.common.CommonMiddleware', 47 | 'django.middleware.csrf.CsrfViewMiddleware', 48 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 49 | 'django.contrib.messages.middleware.MessageMiddleware', 50 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 51 | ] 52 | 53 | ROOT_URLCONF = 'autogen.urls' 54 | 55 | TEMPLATES = [ 56 | { 57 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 58 | 'DIRS': [], 59 | 'APP_DIRS': True, 60 | 'OPTIONS': { 61 | 'context_processors': [ 62 | 'django.template.context_processors.debug', 63 | 'django.template.context_processors.request', 64 | 'django.contrib.auth.context_processors.auth', 65 | 'django.contrib.messages.context_processors.messages', 66 | ], 67 | }, 68 | }, 69 | ] 70 | 71 | WSGI_APPLICATION = 'autogen.wsgi.application' 72 | 73 | 74 | # Database 75 | # https://docs.djangoproject.com/en/3.1/ref/settings/#databases 76 | 77 | DATABASES = { 78 | 'default': { 79 | 'ENGINE': 'django.db.backends.sqlite3', 80 | 'NAME': BASE_DIR / 'db.sqlite3', 81 | }, 82 | 'lite': { 83 | 'ENGINE': 'django.db.backends.sqlite3', 84 | 'NAME': BASE_DIR / 'lite.sqlite3', 85 | } 86 | } 87 | 88 | 89 | # Password validation 90 | # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators 91 | 92 | AUTH_PASSWORD_VALIDATORS = [ 93 | { 94 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 95 | }, 96 | { 97 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 98 | }, 99 | { 100 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 101 | }, 102 | { 103 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 104 | }, 105 | ] 106 | 107 | 108 | # Internationalization 109 | # https://docs.djangoproject.com/en/3.1/topics/i18n/ 110 | 111 | LANGUAGE_CODE = 'en-us' 112 | 113 | TIME_ZONE = 'UTC' 114 | 115 | USE_I18N = True 116 | 117 | USE_L10N = True 118 | 119 | USE_TZ = True 120 | 121 | 122 | # Static files (CSS, JavaScript, Images) 123 | # https://docs.djangoproject.com/en/3.1/howto/static-files/ 124 | 125 | STATIC_URL = '/static/' 126 | -------------------------------------------------------------------------------- /autogen/urls.py: -------------------------------------------------------------------------------- 1 | """autogen URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path 18 | 19 | urlpatterns = [ 20 | path('admin/', admin.site.urls), 21 | ] 22 | -------------------------------------------------------------------------------- /autogen/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for autogen project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'autogen.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /lite.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingforentrepreneurs/Autogenerate-Django-Models/95f3ffc2ad6714a02ea16b124ae075dd7ff218c2/lite.sqlite3 -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'autogen.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /nbs/django_setup.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | PWD = os.getenv('PWD') 3 | 4 | PROJ_MISSING_MSG = """Set an enviroment variable:\n 5 | `DJANGO_PROJECT=your_project_name`\n 6 | or call:\n 7 | `init_django(your_project_name)` 8 | """ 9 | 10 | def init_django(project_name="autogen"): 11 | os.chdir(PWD) 12 | project_name = project_name or os.environ.get('DJANGO_PROJECT') or None 13 | if project_name == None: 14 | raise Exception(PROJ_MISSING_MSG) 15 | sys.path.insert(0, os.getenv('PWD')) 16 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', f'{project_name}.settings') 17 | os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true" 18 | import django 19 | django.setup() -------------------------------------------------------------------------------- /pyvenv.cfg: -------------------------------------------------------------------------------- 1 | home = /Library/Frameworks/Python.framework/Versions/3.8/bin 2 | include-system-site-packages = false 3 | version = 3.8.2 4 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | appnope==0.1.0 2 | argon2-cffi==20.1.0 3 | asgiref==3.3.0 4 | async-generator==1.10 5 | attrs==20.3.0 6 | backcall==0.2.0 7 | bleach==3.2.1 8 | cffi==1.14.3 9 | decorator==4.4.2 10 | defusedxml==0.6.0 11 | Django==3.1.3 12 | entrypoints==0.3 13 | ipykernel==5.3.4 14 | ipython==7.19.0 15 | ipython-genutils==0.2.0 16 | ipywidgets==7.5.1 17 | jedi==0.17.2 18 | Jinja2==2.11.2 19 | jsonschema==3.2.0 20 | jupyter==1.0.0 21 | jupyter-client==6.1.7 22 | jupyter-console==6.2.0 23 | jupyter-core==4.6.3 24 | jupyterlab-pygments==0.1.2 25 | MarkupSafe==1.1.1 26 | mistune==0.8.4 27 | nbclient==0.5.1 28 | nbconvert==6.0.7 29 | nbformat==5.0.8 30 | nest-asyncio==1.4.2 31 | notebook==6.1.5 32 | numpy==1.19.4 33 | packaging==20.4 34 | pandas==1.1.4 35 | pandocfilters==1.4.3 36 | parso==0.7.1 37 | pexpect==4.8.0 38 | pickleshare==0.7.5 39 | prometheus-client==0.8.0 40 | prompt-toolkit==3.0.8 41 | ptyprocess==0.6.0 42 | pycparser==2.20 43 | Pygments==2.7.2 44 | pyparsing==2.4.7 45 | pyrsistent==0.17.3 46 | python-dateutil==2.8.1 47 | pytz==2020.4 48 | pyzmq==19.0.2 49 | qtconsole==4.7.7 50 | QtPy==1.9.0 51 | Send2Trash==1.5.0 52 | six==1.15.0 53 | SQLAlchemy==1.3.20 54 | sqlparse==0.4.1 55 | terminado==0.9.1 56 | testpath==0.4.4 57 | tornado==6.1 58 | traitlets==5.0.5 59 | wcwidth==0.2.5 60 | webencodings==0.5.1 61 | widgetsnbextension==3.5.1 62 | -------------------------------------------------------------------------------- /topics/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingforentrepreneurs/Autogenerate-Django-Models/95f3ffc2ad6714a02ea16b124ae075dd7ff218c2/topics/__init__.py -------------------------------------------------------------------------------- /topics/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /topics/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class TopicsConfig(AppConfig): 5 | name = 'topics' 6 | -------------------------------------------------------------------------------- /topics/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.3 on 2020-11-08 19:52 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='Topics', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('tag', models.CharField(blank=True, max_length=120, null=True)), 19 | ('count', models.BigIntegerField(blank=True, null=True)), 20 | ('percent', models.DecimalField(blank=True, decimal_places=5, max_digits=10, null=True)), 21 | ], 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /topics/migrations/0002_auto_20201108_1954.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.3 on 2020-11-08 19:54 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('topics', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameModel( 14 | old_name='Topics', 15 | new_name='Topic', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /topics/migrations/0003_topic_percent_human.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.3 on 2020-11-08 20:07 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('topics', '0002_auto_20201108_1954'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='topic', 15 | name='percent_human', 16 | field=models.DecimalField(blank=True, decimal_places=10, max_digits=10, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /topics/migrations/0004_auto_20201108_2008.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.3 on 2020-11-08 20:08 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('topics', '0003_topic_percent_human'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='topic', 15 | name='percent_human', 16 | field=models.DecimalField(blank=True, decimal_places=5, max_digits=10, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /topics/migrations/0005_remove_topic_percent_human.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.3 on 2020-11-08 20:10 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('topics', '0004_auto_20201108_2008'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='topic', 15 | name='percent_human', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /topics/migrations/0006_topic_percent_human.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.3 on 2020-11-08 20:12 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('topics', '0005_remove_topic_percent_human'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='topic', 15 | name='percent_human', 16 | field=models.TextField(blank=True, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /topics/migrations/0007_auto_20201108_2014.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.3 on 2020-11-08 20:14 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('topics', '0006_topic_percent_human'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='topic', 15 | name='percent_human', 16 | field=models.CharField(blank=True, max_length=120, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /topics/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingforentrepreneurs/Autogenerate-Django-Models/95f3ffc2ad6714a02ea16b124ae075dd7ff218c2/topics/migrations/__init__.py -------------------------------------------------------------------------------- /topics/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | 4 | class Topic(models.Model): 5 | # index = models.BigIntegerField(blank=True, null=True) 6 | tag = models.CharField(max_length=120, blank=True, null=True) 7 | count = models.BigIntegerField(blank=True, null=True) 8 | percent = models.DecimalField(max_digits=10, decimal_places=5, blank=True, null=True) # max_digits and decimal_places have been guessed, as this database handles decimal fields as float 9 | percent_human = models.CharField(max_length=120, blank=True, null=True) 10 | 11 | # class Meta: 12 | # managed = False 13 | # db_table = 'topics' -------------------------------------------------------------------------------- /topics/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /topics/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | --------------------------------------------------------------------------------