Skip to content

Commit 2dc0ead

Browse files
committedAug 17, 2016
tested the app
1 parent 1a6337a commit 2dc0ead

36 files changed

+129
-244
lines changed
 

‎.gitignore

+62-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,64 @@
1-
*.pyc
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
5+
# C extensions
6+
*.so
7+
8+
# Distribution / packaging
9+
.Python
10+
env/
11+
3env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*,cover
46+
47+
# Translations
48+
*.mo
49+
*.pot
50+
51+
# Django stuff:
52+
*.log
53+
54+
# Sphinx documentation
55+
docs/_build/
56+
57+
# PyBuilder
58+
target/
59+
.idea/
60+
db.sqlite3
61+
media/
262
*~
3-
*.swo
463
*.swp
5-
<<<<<<< HEAD
6-
db.sqlite3
7-
media
8-
migrations
9-
media-images
10-
cache
11-
=======
12-
>>>>>>> ee8731e625f8c49618214b0644ed3f66b980050d
64+
*.swo

‎MANIFEST.in

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include README.rst
2+
recursive-include django_mfa/templates *
3+
recursive-include django_mfa/static *

‎README.md ‎README.rst

File renamed without changes.

‎dist/django-mfa-0.0.1.tar.gz

-2.88 KB
Binary file not shown.

‎django_mfa.egg-info/PKG-INFO

-22
This file was deleted.

‎django_mfa.egg-info/SOURCES.txt

-10
This file was deleted.

‎django_mfa.egg-info/dependency_links.txt

-1
This file was deleted.

‎django_mfa.egg-info/requires.txt

-1
This file was deleted.

‎django_mfa.egg-info/top_level.txt

-1
This file was deleted.
File renamed without changes.

‎otp_app/apps.py ‎django_mfa/apps.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
from django.apps import AppConfig
44

55

6-
class OtpAppConfig(AppConfig):
7-
name = 'otp_app'
6+
class DjangoMfaAppConfig(AppConfig):
7+
name = 'django_mfa'
File renamed without changes.

‎django_mfa/migrations/0001_initial.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.9.7 on 2016-07-04 11:28
3+
from __future__ import unicode_literals
4+
5+
from django.conf import settings
6+
from django.db import migrations, models
7+
import django.db.models.deletion
8+
9+
10+
class Migration(migrations.Migration):
11+
12+
initial = True
13+
14+
dependencies = [
15+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
16+
]
17+
18+
operations = [
19+
migrations.CreateModel(
20+
name='UserOTP',
21+
fields=[
22+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
23+
('otp_type', models.CharField(choices=[(b'HOTP', b'hotp'), (b'TOTP', b'totp')], max_length=20)),
24+
('secret_key', models.CharField(blank=True, max_length=100)),
25+
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
26+
],
27+
),
28+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.9.7 on 2016-07-06 14:21
3+
from __future__ import unicode_literals
4+
5+
from django.conf import settings
6+
from django.db import migrations, models
7+
import django.db.models.deletion
8+
9+
10+
class Migration(migrations.Migration):
11+
12+
dependencies = [
13+
('django_mfa', '0001_initial'),
14+
]
15+
16+
operations = [
17+
migrations.AlterField(
18+
model_name='userotp',
19+
name='user',
20+
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
21+
),
22+
]
File renamed without changes.
File renamed without changes.

‎otp_app/otp.py ‎django_mfa/otp.py

File renamed without changes.

‎django_mfa/settings.py

-129
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎otp_app/totp.py ‎django_mfa/totp.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import datetime
44
import time
55

6-
from otp_app import utils
7-
from otp_app.otp import OTP
6+
from django_mfa import utils
7+
from django_mfa.otp import OTP
88

99

1010
class TOTP(OTP):

‎django_mfa/urls.py

+6-26
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
1-
<<<<<<< HEAD
2-
from django.conf.urls import url, include
3-
from django.contrib import admin
4-
5-
urlpatterns = [
6-
url(r'^admin/', include(admin.site.urls)),
7-
url(r'^settings/', include('otp_app.urls', namespace="mfa")),
8-
=======
9-
"""django_mfa URL Configuration
10-
11-
The `urlpatterns` list routes URLs to views. For more information please see:
12-
https://docs.djangoproject.com/en/1.9/topics/http/urls/
13-
Examples:
14-
Function views
15-
1. Add an import: from my_app import views
16-
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
17-
Class-based views
18-
1. Add an import: from other_app.views import Home
19-
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
20-
Including another URLconf
21-
1. Import the include() function: from django.conf.urls import url, include
22-
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
23-
"""
241
from django.conf.urls import url
25-
from django.contrib import admin
2+
from .views import *
263

274
urlpatterns = [
28-
url(r'^admin/', admin.site.urls),
29-
>>>>>>> ee8731e625f8c49618214b0644ed3f66b980050d
5+
url(r'^security/$', security_settings, name="security_settings"),
6+
url(r'^mfa/configure/$', configure_mfa, name="configure_mfa"),
7+
url(r'^mfa/enable/$', enable_mfa, name="enable_mfa"),
8+
url(r'^verify/token/$', verify_otp, name="verify_otp"),
9+
url(r'^mfa/disable/$', disable_mfa, name="disable_mfa"),
3010
]
File renamed without changes.

‎otp_app/views.py ‎django_mfa/views.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import totp
33
import base64
44
from django.contrib.auth.decorators import login_required
5-
from otp_app.models import *
5+
from django_mfa.models import *
66
from django.http import HttpResponseRedirect
77

88

‎django_mfa/wsgi.py

-16
This file was deleted.

‎manage.py

-10
This file was deleted.

‎otp_app/urls.py

-10
This file was deleted.

‎setup.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
from setuptools import setup
33

4-
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
4+
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
55
README = readme.read()
66

77
# allow setup.py to be run from any path
@@ -22,7 +22,7 @@
2222

2323
setup(
2424
name='django-mfa',
25-
version='0.0.1',
25+
version='0.0.2',
2626
packages=['django_mfa'],
2727
include_package_data=True,
2828
description='A Django deployment package for all hosting types.',
@@ -45,6 +45,6 @@
4545
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
4646
],
4747
install_requires=[
48-
"django",
48+
"Django>=1.6.0,<1.10",
4949
],
5050
)

0 commit comments

Comments
 (0)
Please sign in to comment.