Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 26080dd

Browse files
committed
first commit
0 parents  commit 26080dd

19 files changed

+368
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
venv
2+
*.pyc
3+
staticfiles
4+
.env
5+
db.sqlite3
6+
getting-started/*

Makefile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
iniciar:
2+
@pipenv install
3+
4+
ejecutar:
5+
@pipenv run python manage.py runserver
6+
7+
ejecutar_worker:
8+
@pipenv run python manage.py rqworker
9+
10+
crear_migraciones:
11+
@pipenv run python manage.py makemigrations
12+
13+
migrar:
14+
@pipenv run python manage.py migrate --noinput
15+
16+
test:
17+
@echo "${G}Ejecutando tests ...${N}"
18+
ifeq ($(filtro),)
19+
pipenv run pytest
20+
else
21+
pipenv run pytest -k $(filtro)
22+
endif
23+
24+
test_live:
25+
ifeq ($(filtro),)
26+
pipenv run ptw
27+
else
28+
pipenv run ptw -- -k $(filtro)
29+
endif
30+
31+
reset:
32+
dropdb --if-exists tca -e; createdb tca
33+
pipenv run python manage.py migrate --noinput
34+
35+
build_requirements:
36+
@pipenv lock -r > requirements.txt
37+
cat requirements.txt
38+
39+
collectstatic:
40+
pipenv run python manage.py collectstatic

Pipfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
flake8 = "*"
8+
9+
[packages]
10+
gunicorn = "*"
11+
django-heroku = "*"
12+
Django = "*"
13+
14+
[requires]
15+
python_version = "3.6"

Pipfile.lock

Lines changed: 128 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: gunicorn backend.wsgi --log-file -

app/__init__.py

Whitespace-only changes.

app/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

app/apps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class AppConfig(AppConfig):
5+
name = 'app'
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Generated by Django 2.2.7 on 2019-12-02 01:27
2+
from django.db import migrations
3+
from django.contrib.auth.models import User
4+
5+
6+
def crear_usuario_administrador(apps, schema_editor):
7+
User.objects.create_superuser(username='admin', password='asdasd123', email='[email protected]')
8+
9+
class Migration(migrations.Migration):
10+
dependencies = []
11+
12+
operations = [
13+
migrations.RunPython(crear_usuario_administrador, migrations.RunPython.noop),
14+
]

app/migrations/__init__.py

Whitespace-only changes.

app/models/__init__.py

Whitespace-only changes.

app/tests/__init__.py

Whitespace-only changes.

backend/__init__.py

Whitespace-only changes.

backend/settings.py

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import os
2+
import django_heroku
3+
4+
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
5+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
6+
7+
# SECURITY WARNING: keep the secret key used in production secret!
8+
SECRET_KEY = '4t&k==lw)o5!l*8*sruuh+wh^$q===vonv^^zf-2cu4b)g)+dm'
9+
10+
# SECURITY WARNING: don't run with debug turned on in production!
11+
DEBUG = True
12+
13+
ALLOWED_HOSTS = []
14+
15+
# Application definition
16+
INSTALLED_APPS = [
17+
'django.contrib.admin',
18+
'django.contrib.auth',
19+
'django.contrib.contenttypes',
20+
'django.contrib.sessions',
21+
'django.contrib.messages',
22+
'django.contrib.staticfiles',
23+
'app',
24+
]
25+
26+
MIDDLEWARE = [
27+
'django.middleware.security.SecurityMiddleware',
28+
'django.contrib.sessions.middleware.SessionMiddleware',
29+
'django.middleware.common.CommonMiddleware',
30+
'django.middleware.csrf.CsrfViewMiddleware',
31+
'django.contrib.auth.middleware.AuthenticationMiddleware',
32+
'django.contrib.messages.middleware.MessageMiddleware',
33+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
34+
]
35+
36+
ROOT_URLCONF = 'backend.urls'
37+
38+
TEMPLATES = [
39+
{
40+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
41+
'DIRS': [],
42+
'APP_DIRS': True,
43+
'OPTIONS': {
44+
'context_processors': [
45+
'django.template.context_processors.debug',
46+
'django.template.context_processors.request',
47+
'django.contrib.auth.context_processors.auth',
48+
'django.contrib.messages.context_processors.messages',
49+
],
50+
},
51+
},
52+
]
53+
54+
WSGI_APPLICATION = 'backend.wsgi.application'
55+
56+
# Database
57+
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
58+
59+
DATABASES = {
60+
'default': {
61+
'ENGINE': 'django.db.backends.sqlite3',
62+
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
63+
}
64+
}
65+
66+
# Password validation
67+
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
68+
69+
AUTH_PASSWORD_VALIDATORS = [
70+
# {
71+
# 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
72+
# },
73+
# {
74+
# 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
75+
# },
76+
# {
77+
# 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
78+
# },
79+
# {
80+
# 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
81+
# },
82+
]
83+
84+
LANGUAGE_CODE = 'es-ar'
85+
TIME_ZONE = 'UTC'
86+
USE_I18N = True
87+
USE_L10N = True
88+
USE_TZ = True
89+
90+
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
91+
STATIC_URL = "/static/"
92+
93+
django_heroku.settings(locals())

backend/urls.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""backend 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
18+
19+
urlpatterns = [
20+
path('admin/', admin.site.urls),
21+
]

backend/wsgi.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for backend 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', 'backend.settings')
15+
16+
application = get_wsgi_application()

manage.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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', 'backend.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()

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-i https://pypi.org/simple
2+
django==2.2.7
3+
pytz==2019.3
4+
sqlparse==0.3.0

runtime.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python-3.6.9

0 commit comments

Comments
 (0)