Explorar el Código

move server into lesspass directory

pull/2/head
Guillaume Vincent hace 9 años
padre
commit
5ee95ac28b
Se han modificado 21 ficheros con 74 adiciones y 51 borrados
  1. +2
    -2
      .gitignore
  2. +0
    -0
      lesspass/__init__.py
  3. +0
    -0
      lesspass/api/__init__.py
  4. +0
    -0
      lesspass/api/admin.py
  5. +5
    -0
      lesspass/api/apps.py
  6. +7
    -3
      lesspass/api/migrations/0001_initial.py
  7. +0
    -0
      lesspass/api/migrations/__init__.py
  8. +0
    -0
      lesspass/api/models.py
  9. +2
    -1
      lesspass/api/serializers.py
  10. +0
    -0
      lesspass/api/tests.py
  11. +11
    -0
      lesspass/api/urls.py
  12. +4
    -3
      lesspass/api/views.py
  13. +0
    -0
      lesspass/lesspass/__init__.py
  14. +26
    -11
      lesspass/lesspass/settings.py
  15. +7
    -0
      lesspass/lesspass/urls.py
  16. +7
    -0
      lesspass/lesspass/wsgi.py
  17. +0
    -0
      lesspass/manage.py
  18. +3
    -0
      lesspass/requirements.txt
  19. +0
    -12
      server/lesspass/urls.py
  20. +0
    -16
      server/lesspass/wsgi.py
  21. +0
    -3
      server/requirements.txt

+ 2
- 2
.gitignore Ver fichero

@@ -85,5 +85,5 @@ docs/_build/

# PyBuilder
target/
/server/config
/server/db.sqlite3
/lesspass/config
/lesspass/db.sqlite3

server/api/__init__.py → lesspass/__init__.py Ver fichero


server/api/migrations/__init__.py → lesspass/api/__init__.py Ver fichero


server/api/admin.py → lesspass/api/admin.py Ver fichero


+ 5
- 0
lesspass/api/apps.py Ver fichero

@@ -0,0 +1,5 @@
from django.apps import AppConfig


class ApiConfig(AppConfig):
name = 'api'

server/api/migrations/0001_initial.py → lesspass/api/migrations/0001_initial.py Ver fichero

@@ -1,12 +1,16 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-18 09:18
from __future__ import unicode_literals

from django.db import migrations, models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
@@ -15,14 +19,14 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Site',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True, verbose_name='created')),
('modified', models.DateTimeField(auto_now=True, verbose_name='modified')),
('name', models.CharField(max_length=255)),
('password_length', models.IntegerField()),
('password_type', models.CharField(max_length=255)),
('counter', models.IntegerField(default=1)),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,

server/lesspass/__init__.py → lesspass/api/migrations/__init__.py Ver fichero


server/api/models.py → lesspass/api/models.py Ver fichero


server/api/serializers.py → lesspass/api/serializers.py Ver fichero

@@ -1,6 +1,7 @@
from api.models import Site
from rest_framework import serializers

from api.models import Site


class SiteSerializer(serializers.ModelSerializer):
class Meta:

server/api/tests.py → lesspass/api/tests.py Ver fichero


+ 11
- 0
lesspass/api/urls.py Ver fichero

@@ -0,0 +1,11 @@
from django.conf.urls import include, url
from rest_framework import routers

from api import views

router = routers.DefaultRouter()
router.register(r'sites', views.SiteViewSet)

urlpatterns = [
url(r'^', include(router.urls)),
]

server/api/views.py → lesspass/api/views.py Ver fichero

@@ -1,8 +1,9 @@
from api.models import Site
from api.serializers import SiteSerializer
from rest_framework import viewsets

from api import models
from api.serializers import SiteSerializer


class SiteViewSet(viewsets.ModelViewSet):
queryset = Site.objects.all()
queryset = models.Site.objects.all()
serializer_class = SiteSerializer

+ 0
- 0
lesspass/lesspass/__init__.py Ver fichero


server/lesspass/settings.py → lesspass/lesspass/settings.py Ver fichero

@@ -1,9 +1,10 @@
import os

from smartconfigparser import Config

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

from smartconfigparser import Config

CONFIG_PATH = os.path.join(BASE_DIR, 'config')
if not os.path.exists(CONFIG_PATH):
os.makedirs(CONFIG_PATH)
@@ -29,18 +30,19 @@ DEBUG = config.getboolean('DJANGO', 'DEBUG', False)

ALLOWED_HOSTS = config.getlist('DJANGO', 'ALLOWED_HOSTS', ['localhost', '127.0.0.1', '*.oslab.fr'])

INSTALLED_APPS = (
INSTALLED_APPS = [
'api.apps.ApiConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'api',
'rest_framework',
)
'rest_framework'
]

MIDDLEWARE_CLASSES = (
MIDDLEWARE_CLASSES = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
@@ -48,8 +50,7 @@ MIDDLEWARE_CLASSES = (
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
)
]

ROOT_URLCONF = 'lesspass.urls'

@@ -71,7 +72,6 @@ TEMPLATES = [

WSGI_APPLICATION = 'lesspass.wsgi.application'


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
@@ -79,6 +79,21 @@ DATABASES = {
}
}

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'
@@ -94,4 +109,4 @@ STATIC_URL = '/static/'
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAdminUser',),
'PAGE_SIZE': 10
}
}

+ 7
- 0
lesspass/lesspass/urls.py Ver fichero

@@ -0,0 +1,7 @@
from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^api/', include('api.urls')),
]

+ 7
- 0
lesspass/lesspass/wsgi.py Ver fichero

@@ -0,0 +1,7 @@
import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lesspass.settings")

application = get_wsgi_application()

server/manage.py → lesspass/manage.py Ver fichero


+ 3
- 0
lesspass/requirements.txt Ver fichero

@@ -0,0 +1,3 @@
Django==1.9
djangorestframework==3.3.2
smartconfigparser==0.1.1

+ 0
- 12
server/lesspass/urls.py Ver fichero

@@ -1,12 +0,0 @@
from api import views
from django.conf.urls import include, url
from django.contrib import admin
from rest_framework import routers

router = routers.DefaultRouter()
router.register(r'users', views.SiteViewSet)

urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^api/', include('rest_framework.urls', namespace='rest_framework'))
]

+ 0
- 16
server/lesspass/wsgi.py Ver fichero

@@ -1,16 +0,0 @@
"""
WSGI config for lesspass project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lesspass.settings")

application = get_wsgi_application()

+ 0
- 3
server/requirements.txt Ver fichero

@@ -1,3 +0,0 @@
Django==1.8.7
djangorestframework==3.3.2
smartconfigparser==0.1.1

Cargando…
Cancelar
Guardar