Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Origin/restruturacao django #7

Merged
merged 3 commits into from
Nov 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ target/
# Virtualenv
venv/
env/

# cache results from py.test
integration_test/.cache
.cache
57 changes: 54 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,55 @@
# pimpapp-api
===============================
Pre requisitos para rodar o app
===============================

-> Ativar virtualenv

source venv/bin/activate

-> Instalar todos as python libraries

pip install -r requirements.txt

=================
Como rodar o app:
=================

==================================================================================================
Estes dois passos a seguir somente deverao ser executado uma vez ou quando o models.py for alterado
==================================================================================================

-> Realizar makemigrations (se necessario futuramente alterar o models.py) e migrate para criar as databases atraves do django
-> *** Posteriormente, caso necessario visualizar o sql gerado pelo django, basta realizar "python manage.py sqlall carroceiro"

python manage.py migrate

-> Carregar dados iniciais no db atraves do script load_catadores.sh

cd scripts
sh load_catadores.sh

-> Inicializar o server

python manage.py runserver

==================================
Como rodar os testes de integracao:
==================================

py.test integration_tests/tests.py

Obs: Como sao testes de integracao, eh necessario que a database esteja existente e funcional (django migrate stuff)

==================================================================================================================
Como Recriar todas as databases do django (caso necessario algum debug ou destruir as databases por algum motivo):
==================================================================================================================

python manage.py reset_db

-> Posteriormente utilizar

python manage.py migrate

-> Executar novamente o script load_catadores.sh para inicializar data no db.


[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/PimpAPP/pimpapp-api?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
API REST utilizada no pimp
11 changes: 0 additions & 11 deletions app/README.md

This file was deleted.

25 changes: 0 additions & 25 deletions app/__init__.py

This file was deleted.

3 changes: 0 additions & 3 deletions app/app.py

This file was deleted.

4 changes: 0 additions & 4 deletions app/catadores/__init__.py

This file was deleted.

Empty file removed app/catadores/controllers.py
Empty file.
Empty file removed app/catadores/models.py
Empty file.
Empty file removed app/catadores/views.py
Empty file.
87 changes: 0 additions & 87 deletions app/config.py

This file was deleted.

15 changes: 0 additions & 15 deletions app/databases.py

This file was deleted.

31 changes: 0 additions & 31 deletions app/models.py

This file was deleted.

23 changes: 0 additions & 23 deletions app/routes.py

This file was deleted.

Empty file removed app/users/controllers.py
Empty file.
Empty file removed app/users/models.py
Empty file.
Empty file removed app/users/routes.py
Empty file.
Empty file removed app/users/views.py
Empty file.
File renamed without changes.
1 change: 1 addition & 0 deletions app_site/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

File renamed without changes.
105 changes: 105 additions & 0 deletions app_site/app_site/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
"""
Django settings for app_site project.

Generated by 'django-admin startproject' using Django 1.8.5.

For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'yvmahv(pa39%+5fs8%jxg79ejm^ui13m#fma3rf0kd7#r-wc9k'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'django_extensions',
'carroceiro',
)

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
)

ROOT_URLCONF = 'app_site.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'app_site.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/

LANGUAGE_CODE = 'pt-br'

TIME_ZONE = 'America/Sao_Paulo'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/

STATIC_URL = '/static/'
Loading