├── subscription-api ├── subscriptions │ ├── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ └── 0001_initial.py │ ├── admin.py │ ├── apps.py │ ├── urls.py │ ├── serializers.py │ ├── views.py │ ├── models.py │ └── tests.py ├── subscription_api │ ├── __init__.py │ ├── wsgi.py │ ├── urls.py │ └── settings.py ├── db.sqlite3 ├── README.md ├── .vscode │ └── settings.json ├── Pipfile ├── manage.py └── Pipfile.lock ├── README.md ├── subscription-app ├── .browserslistrc ├── babel.config.js ├── tests │ └── unit │ │ ├── .eslintrc.js │ │ └── example.spec.js ├── postcss.config.js ├── public │ ├── favicon.ico │ └── index.html ├── src │ ├── assets │ │ └── logo.png │ ├── store.js │ ├── App.vue │ ├── main.js │ ├── router.js │ └── components │ │ ├── Index.vue │ │ ├── Create.vue │ │ └── Edit.vue ├── .gitignore ├── .eslintrc.js ├── README.md ├── jest.config.js └── package.json └── .gitignore /subscription-api/subscriptions/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /subscription-api/subscription_api/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CRUD Vue.js Django REST Framework 2 | -------------------------------------------------------------------------------- /subscription-api/subscriptions/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /subscription-app/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /subscription-app/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ["@vue/app"] 3 | }; 4 | -------------------------------------------------------------------------------- /subscription-api/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Topten1004/Vue-Django/HEAD/subscription-api/db.sqlite3 -------------------------------------------------------------------------------- /subscription-app/tests/unit/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | jest: true 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /subscription-api/subscriptions/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /subscription-app/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /subscription-api/README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | pipenv shell 3 | pipenv install 4 | ./manage.py migrate 5 | ./manage.py runserver 6 | ``` 7 | -------------------------------------------------------------------------------- /subscription-app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Topten1004/Vue-Django/HEAD/subscription-app/public/favicon.ico -------------------------------------------------------------------------------- /subscription-app/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Topten1004/Vue-Django/HEAD/subscription-app/src/assets/logo.png -------------------------------------------------------------------------------- /subscription-api/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.pythonPath": "/Users/macbookpro/.local/share/virtualenvs/subscription-api-mtxB0jTH/bin/python" 3 | } -------------------------------------------------------------------------------- /subscription-api/subscriptions/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class SubscriptionsConfig(AppConfig): 5 | name = 'subscriptions' 6 | -------------------------------------------------------------------------------- /subscription-app/src/store.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import Vuex from "vuex"; 3 | 4 | Vue.use(Vuex); 5 | 6 | export default new Vuex.Store({ 7 | state: {}, 8 | mutations: {}, 9 | actions: {} 10 | }); 11 | -------------------------------------------------------------------------------- /subscription-api/Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | url = "https://pypi.org/simple" 3 | verify_ssl = true 4 | name = "pypi" 5 | 6 | [dev-packages] 7 | 8 | [packages] 9 | djangorestframework = "*" 10 | django = "*" 11 | django-cors-headers = "*" 12 | django-rest-framework = "*" 13 | 14 | [requires] 15 | python_version = "3.7" 16 | -------------------------------------------------------------------------------- /subscription-api/subscriptions/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from rest_framework.urlpatterns import format_suffix_patterns 3 | from subscriptions import views 4 | 5 | urlpatterns = [ 6 | path('subscriptions/', views.SubscriptionList.as_view()), 7 | path('subscriptions//', views.SubscriptionDetail.as_view()), 8 | ] 9 | -------------------------------------------------------------------------------- /subscription-app/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /subscription-api/subscriptions/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from .models import Subscription 3 | 4 | 5 | class SubscriptionSerializer(serializers.ModelSerializer): 6 | class Meta: 7 | model = Subscription 8 | fields = ('id', 'name', 'description', 'currency', 9 | 'amount', 'created_at', 'updated_at' 10 | ) -------------------------------------------------------------------------------- /subscription-app/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | extends: ["plugin:vue/essential", "@vue/prettier"], 7 | rules: { 8 | "no-console": process.env.NODE_ENV === "production" ? "error" : "off", 9 | "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off" 10 | }, 11 | parserOptions: { 12 | parser: "babel-eslint" 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /subscription-app/src/App.vue: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /subscription-app/tests/unit/example.spec.js: -------------------------------------------------------------------------------- 1 | import { shallowMount } from "@vue/test-utils"; 2 | import HelloWorld from "@/components/HelloWorld.vue"; 3 | 4 | describe("HelloWorld.vue", () => { 5 | it("renders props.msg when passed", () => { 6 | const msg = "new message"; 7 | const wrapper = shallowMount(HelloWorld, { 8 | propsData: { msg } 9 | }); 10 | expect(wrapper.text()).toMatch(msg); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /subscription-api/subscriptions/views.py: -------------------------------------------------------------------------------- 1 | from .models import Subscription 2 | from .serializers import SubscriptionSerializer 3 | from rest_framework import generics 4 | 5 | 6 | class SubscriptionList(generics.ListCreateAPIView): 7 | queryset = Subscription.objects.all() 8 | serializer_class = SubscriptionSerializer 9 | 10 | class SubscriptionDetail(generics.RetrieveUpdateDestroyAPIView): 11 | queryset = Subscription.objects.all() 12 | serializer_class = SubscriptionSerializer -------------------------------------------------------------------------------- /subscription-api/subscriptions/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | class Subscription(models.Model): 5 | name = models.CharField(max_length=255) 6 | description = models.TextField() 7 | currency = models.CharField(max_length=255) 8 | amount = models.IntegerField() 9 | created_at = models.DateTimeField(auto_now_add=True) 10 | updated_at = models.DateTimeField(auto_now=True) 11 | 12 | def __str__(self): 13 | return self.name -------------------------------------------------------------------------------- /subscription-api/subscription_api/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for subscription_api 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/2.2/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', 'subscription_api.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /subscription-app/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import App from "./App.vue"; 3 | import router from "./router"; 4 | import store from "./store"; 5 | import BootstrapVue from "bootstrap-vue"; 6 | import VeeValidate from 'vee-validate'; 7 | 8 | import "bootstrap/dist/css/bootstrap.min.css" 9 | import "bootstrap-vue/dist/bootstrap-vue.css" 10 | 11 | Vue.use(BootstrapVue) 12 | Vue.use(VeeValidate); 13 | 14 | Vue.config.productionTip = false; 15 | 16 | new Vue({ 17 | router, 18 | store, 19 | render: h => h(App) 20 | }).$mount("#app"); 21 | -------------------------------------------------------------------------------- /subscription-app/README.md: -------------------------------------------------------------------------------- 1 | # subscription-app 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn run build 16 | ``` 17 | 18 | ### Run your tests 19 | ``` 20 | yarn run test 21 | ``` 22 | 23 | ### Lints and fixes files 24 | ``` 25 | yarn run lint 26 | ``` 27 | 28 | ### Run your unit tests 29 | ``` 30 | yarn run test:unit 31 | ``` 32 | 33 | ### Customize configuration 34 | See [Configuration Reference](https://cli.vuejs.org/config/). 35 | -------------------------------------------------------------------------------- /subscription-app/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | subscription-app 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /subscription-app/src/router.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import Router from "vue-router"; 3 | 4 | Vue.use(Router); 5 | 6 | export default new Router({ 7 | routes: [ 8 | { 9 | path: "/", 10 | redirect: '/index' 11 | }, 12 | { 13 | path: "/create", 14 | name: "create", 15 | component: () => import("./components/Create.vue") 16 | }, 17 | { 18 | path: "/edit/:id", 19 | name: "edit", 20 | component: () => import("./components/Edit.vue") 21 | }, 22 | { 23 | path: "/index", 24 | name: "index", 25 | component: () => import("./components/Index.vue") 26 | }, 27 | ] 28 | }); 29 | -------------------------------------------------------------------------------- /subscription-api/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 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'subscription_api.settings') 9 | try: 10 | from django.core.management import execute_from_command_line 11 | except ImportError as exc: 12 | raise ImportError( 13 | "Couldn't import Django. Are you sure it's installed and " 14 | "available on your PYTHONPATH environment variable? Did you " 15 | "forget to activate a virtual environment?" 16 | ) from exc 17 | execute_from_command_line(sys.argv) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /subscription-app/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | moduleFileExtensions: ["js", "jsx", "json", "vue"], 3 | transform: { 4 | "^.+\\.vue$": "vue-jest", 5 | ".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$": 6 | "jest-transform-stub", 7 | "^.+\\.jsx?$": "babel-jest" 8 | }, 9 | transformIgnorePatterns: ["/node_modules/"], 10 | moduleNameMapper: { 11 | "^@/(.*)$": "/src/$1" 12 | }, 13 | snapshotSerializers: ["jest-serializer-vue"], 14 | testMatch: [ 15 | "**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)" 16 | ], 17 | testURL: "http://localhost/", 18 | watchPlugins: [ 19 | "jest-watch-typeahead/filename", 20 | "jest-watch-typeahead/testname" 21 | ] 22 | }; 23 | -------------------------------------------------------------------------------- /subscription-api/subscriptions/tests.py: -------------------------------------------------------------------------------- 1 | from django.urls import reverse 2 | from django.test import TestCase 3 | from rest_framework import status 4 | from rest_framework.test import APITestCase 5 | 6 | class SubscriptionListTestCase(APITestCase): 7 | 8 | def test_create_subscription(self): 9 | url = reverse('subscription-list') 10 | data = { 11 | 'name': 'Netflix', 12 | 'description': 'Moovies', 13 | 'currency': 'EUR', 14 | 'amount': 10, 15 | 'first_billing_date': '12/03/2019', 16 | 'billing_cycle': 'Monthly' 17 | } 18 | response = self.client.post(url, data, format='json') 19 | self.assertEqual(response.status_code, status.HTTP_201_CREATED) 20 | 21 | 22 | class SubscriptionDetailTestCase(APITestCase): 23 | pass -------------------------------------------------------------------------------- /subscription-api/subscription_api/urls.py: -------------------------------------------------------------------------------- 1 | """subscription_api URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.2/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, include 18 | 19 | urlpatterns = [ 20 | path('api/', include('subscriptions.urls')), 21 | path('admin/', admin.site.urls), 22 | ] 23 | -------------------------------------------------------------------------------- /subscription-api/subscriptions/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.1 on 2019-05-21 14:12 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='Subscription', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('name', models.CharField(max_length=255)), 19 | ('description', models.TextField()), 20 | ('currency', models.CharField(max_length=255)), 21 | ('amount', models.IntegerField()), 22 | ('created_at', models.DateTimeField(auto_now_add=True)), 23 | ('updated_at', models.DateTimeField(auto_now=True)), 24 | ], 25 | ), 26 | ] 27 | -------------------------------------------------------------------------------- /subscription-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "subscription-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint", 9 | "test:unit": "vue-cli-service test:unit" 10 | }, 11 | "dependencies": { 12 | "@vue/cli": "^5.0.8", 13 | "axios": "^0.18.1", 14 | "bootstrap": "^4.3.1", 15 | "bootstrap-vue": "^2.0.0-rc.20", 16 | "core-js": "^2.6.5", 17 | "vee-validate": "^2.2.7", 18 | "vue": "^2.6.10", 19 | "vue-router": "^3.0.3", 20 | "vuex": "^3.0.1" 21 | }, 22 | "devDependencies": { 23 | "@vue/cli-plugin-babel": "^3.7.0", 24 | "@vue/cli-plugin-eslint": "^3.7.0", 25 | "@vue/cli-plugin-unit-jest": "^3.7.0", 26 | "@vue/cli-service": "^3.7.0", 27 | "@vue/eslint-config-prettier": "^4.0.1", 28 | "@vue/test-utils": "1.0.0-beta.29", 29 | "babel-core": "7.0.0-bridge.0", 30 | "babel-eslint": "^10.0.1", 31 | "babel-jest": "^23.6.0", 32 | "eslint": "^5.16.0", 33 | "eslint-plugin-vue": "^5.0.0", 34 | "vue-template-compiler": "^2.5.21" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /subscription-app/src/components/Index.vue: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Django # 2 | *.log 3 | *.pot 4 | *.pyc 5 | __pycache__ 6 | db.sqlite3 7 | media 8 | 9 | # Backup files # 10 | *.bak 11 | 12 | # If you are using PyCharm # 13 | # User-specific stuff 14 | .idea/**/workspace.xml 15 | .idea/**/tasks.xml 16 | .idea/**/usage.statistics.xml 17 | .idea/**/dictionaries 18 | .idea/**/shelf 19 | 20 | # AWS User-specific 21 | .idea/**/aws.xml 22 | 23 | # Generated files 24 | .idea/**/contentModel.xml 25 | 26 | # Sensitive or high-churn files 27 | .idea/**/dataSources/ 28 | .idea/**/dataSources.ids 29 | .idea/**/dataSources.local.xml 30 | .idea/**/sqlDataSources.xml 31 | .idea/**/dynamic.xml 32 | .idea/**/uiDesigner.xml 33 | .idea/**/dbnavigator.xml 34 | 35 | # Gradle 36 | .idea/**/gradle.xml 37 | .idea/**/libraries 38 | 39 | # File-based project format 40 | *.iws 41 | 42 | # IntelliJ 43 | out/ 44 | 45 | # JIRA plugin 46 | atlassian-ide-plugin.xml 47 | 48 | # Python # 49 | *.py[cod] 50 | *$py.class 51 | 52 | # Distribution / packaging 53 | .Python build/ 54 | develop-eggs/ 55 | dist/ 56 | downloads/ 57 | eggs/ 58 | .eggs/ 59 | lib/ 60 | lib64/ 61 | parts/ 62 | sdist/ 63 | var/ 64 | wheels/ 65 | *.egg-info/ 66 | .installed.cfg 67 | *.egg 68 | *.manifest 69 | *.spec 70 | 71 | # Installer logs 72 | pip-log.txt 73 | pip-delete-this-directory.txt 74 | 75 | # Unit test / coverage reports 76 | htmlcov/ 77 | .tox/ 78 | .coverage 79 | .coverage.* 80 | .cache 81 | .pytest_cache/ 82 | nosetests.xml 83 | coverage.xml 84 | *.cover 85 | .hypothesis/ 86 | 87 | # Jupyter Notebook 88 | .ipynb_checkpoints 89 | 90 | # pyenv 91 | .python-version 92 | 93 | # celery 94 | celerybeat-schedule.* 95 | 96 | # SageMath parsed files 97 | *.sage.py 98 | 99 | # Environments 100 | .env 101 | .venv 102 | env/ 103 | venv/ 104 | ENV/ 105 | env.bak/ 106 | venv.bak/ 107 | 108 | # mkdocs documentation 109 | /site 110 | 111 | # mypy 112 | .mypy_cache/ 113 | 114 | # Sublime Text # 115 | *.tmlanguage.cache 116 | *.tmPreferences.cache 117 | *.stTheme.cache 118 | *.sublime-workspace 119 | *.sublime-project 120 | 121 | # sftp configuration file 122 | sftp-config.json 123 | 124 | # Package control specific files Package 125 | Control.last-run 126 | Control.ca-list 127 | Control.ca-bundle 128 | Control.system-ca-bundle 129 | GitHub.sublime-settings 130 | 131 | # Visual Studio Code # 132 | .vscode/* 133 | !.vscode/settings.json 134 | !.vscode/tasks.json 135 | !.vscode/launch.json 136 | !.vscode/extensions.json 137 | .history -------------------------------------------------------------------------------- /subscription-api/Pipfile.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_meta": { 3 | "hash": { 4 | "sha256": "cd07f420b91e936c4b6313af59d94f45c903b803dcb4a3ce17ce6beda9fc06d0" 5 | }, 6 | "pipfile-spec": 6, 7 | "requires": { 8 | "python_version": "3.7" 9 | }, 10 | "sources": [ 11 | { 12 | "name": "pypi", 13 | "url": "https://pypi.org/simple", 14 | "verify_ssl": true 15 | } 16 | ] 17 | }, 18 | "default": { 19 | "asgiref": { 20 | "hashes": [ 21 | "sha256:1d2880b792ae8757289136f1db2b7b99100ce959b2aa57fd69dab783d05afac4", 22 | "sha256:4a29362a6acebe09bf1d6640db38c1dc3d9217c68e6f9f6204d72667fc19a424" 23 | ], 24 | "markers": "python_version >= '3.7'", 25 | "version": "==3.5.2" 26 | }, 27 | "django": { 28 | "hashes": [ 29 | "sha256:0b223bfa55511f950ff741983d408d78d772351284c75e9f77d2b830b6b4d148", 30 | "sha256:d38a4e108d2386cb9637da66a82dc8d0733caede4c83c4afdbda78af4214211b" 31 | ], 32 | "index": "pypi", 33 | "version": "==4.1.4" 34 | }, 35 | "django-cors-headers": { 36 | "hashes": [ 37 | "sha256:37e42883b5f1f2295df6b4bba96eb2417a14a03270cb24b2a07f021cd4487cf4", 38 | "sha256:f9dc6b4e3f611c3199700b3e5f3398c28757dcd559c2f82932687f3d0443cfdf" 39 | ], 40 | "index": "pypi", 41 | "version": "==3.13.0" 42 | }, 43 | "django-rest-framework": { 44 | "hashes": [ 45 | "sha256:47a8f496fa69e3b6bd79f68dd7a1527d907d6b77f009e9db7cf9bb21cc565e4a" 46 | ], 47 | "index": "pypi", 48 | "version": "==0.1.0" 49 | }, 50 | "djangorestframework": { 51 | "hashes": [ 52 | "sha256:579a333e6256b09489cbe0a067e66abe55c6595d8926be6b99423786334350c8", 53 | "sha256:eb63f58c9f218e1a7d064d17a70751f528ed4e1d35547fdade9aaf4cd103fd08" 54 | ], 55 | "index": "pypi", 56 | "version": "==3.14.0" 57 | }, 58 | "pytz": { 59 | "hashes": [ 60 | "sha256:222439474e9c98fced559f1709d89e6c9cbf8d79c794ff3eb9f8800064291427", 61 | "sha256:e89512406b793ca39f5971bc999cc538ce125c0e51c27941bef4568b460095e2" 62 | ], 63 | "version": "==2022.6" 64 | }, 65 | "sqlparse": { 66 | "hashes": [ 67 | "sha256:0323c0ec29cd52bceabc1b4d9d579e311f3e4961b98d174201d5622a23b85e34", 68 | "sha256:69ca804846bb114d2ec380e4360a8a340db83f0ccf3afceeb1404df028f57268" 69 | ], 70 | "markers": "python_version >= '3.5'", 71 | "version": "==0.4.3" 72 | }, 73 | "tzdata": { 74 | "hashes": [ 75 | "sha256:2b88858b0e3120792a3c0635c23daf36a7d7eeeca657c323da299d2094402a0d", 76 | "sha256:fe5f866eddd8b96e9fcba978f8e503c909b19ea7efda11e52e39494bad3a7bfa" 77 | ], 78 | "markers": "sys_platform == 'win32'", 79 | "version": "==2022.7" 80 | } 81 | }, 82 | "develop": {} 83 | } 84 | -------------------------------------------------------------------------------- /subscription-api/subscription_api/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for subscription_api project. 3 | 4 | Generated by 'django-admin startproject' using Django 2.2.1. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.2/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/2.2/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = '=2ubex9f$sjwq80g1w6hr*(u23sb1z%@#51)u+3--$8cnqhmof' 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 | 'corsheaders', 41 | 'subscriptions', 42 | 'rest_framework' 43 | ] 44 | 45 | MIDDLEWARE = [ 46 | 'django.middleware.security.SecurityMiddleware', 47 | 'django.contrib.sessions.middleware.SessionMiddleware', 48 | 'corsheaders.middleware.CorsMiddleware', 49 | 'django.middleware.common.CommonMiddleware', 50 | 'django.middleware.csrf.CsrfViewMiddleware', 51 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 52 | 'django.contrib.messages.middleware.MessageMiddleware', 53 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 54 | ] 55 | 56 | ROOT_URLCONF = 'subscription_api.urls' 57 | 58 | TEMPLATES = [ 59 | { 60 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 61 | 'DIRS': [], 62 | 'APP_DIRS': True, 63 | 'OPTIONS': { 64 | 'context_processors': [ 65 | 'django.template.context_processors.debug', 66 | 'django.template.context_processors.request', 67 | 'django.contrib.auth.context_processors.auth', 68 | 'django.contrib.messages.context_processors.messages', 69 | ], 70 | }, 71 | }, 72 | ] 73 | 74 | WSGI_APPLICATION = 'subscription_api.wsgi.application' 75 | 76 | 77 | # Database 78 | # https://docs.djangoproject.com/en/2.2/ref/settings/#databases 79 | 80 | DATABASES = { 81 | 'default': { 82 | 'ENGINE': 'django.db.backends.sqlite3', 83 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 84 | } 85 | } 86 | 87 | 88 | # Password validation 89 | # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators 90 | 91 | AUTH_PASSWORD_VALIDATORS = [ 92 | { 93 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 94 | }, 95 | { 96 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 97 | }, 98 | { 99 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 100 | }, 101 | { 102 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 103 | }, 104 | ] 105 | 106 | 107 | # Internationalization 108 | # https://docs.djangoproject.com/en/2.2/topics/i18n/ 109 | 110 | LANGUAGE_CODE = 'en-us' 111 | 112 | TIME_ZONE = 'UTC' 113 | 114 | USE_I18N = True 115 | 116 | USE_L10N = True 117 | 118 | USE_TZ = True 119 | 120 | 121 | # Static files (CSS, JavaScript, Images) 122 | # https://docs.djangoproject.com/en/2.2/howto/static-files/ 123 | 124 | STATIC_URL = '/static/' 125 | 126 | CORS_ORIGIN_ALLOW_ALL = True -------------------------------------------------------------------------------- /subscription-app/src/components/Create.vue: -------------------------------------------------------------------------------- 1 | 69 | 70 | -------------------------------------------------------------------------------- /subscription-app/src/components/Edit.vue: -------------------------------------------------------------------------------- 1 | 69 | --------------------------------------------------------------------------------