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

Proposed modernization and simplification #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 0 additions & 11 deletions .travis.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1 @@
# {{ project_name }}

{{ short description }}

## INSTALL

1. git clone origin:{{ project_name }} {{ project_name }}
2. cd {{ project_name }}
3. mkvirtualenv {{ project_name }}
4. pip install -r requirements.txt
5. python manage.py syncdb
6. python manage.py migrate

## INSTALLED APPS

{{ brief overview }}

### App 1
{{ notes }}

### App 2
{{ notes }}

## AUTHORS

- {{ your name }}
35 changes: 0 additions & 35 deletions fab

This file was deleted.

24 changes: 0 additions & 24 deletions fabfile.py

This file was deleted.

11 changes: 0 additions & 11 deletions manage.py

This file was deleted.

25 changes: 25 additions & 0 deletions manage.py-tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys

import dotenv


def main():
"""Run administrative tasks."""
dotenv.load_dotenv()
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{{ project_name }}.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)


if __name__ == '__main__':
main()
Empty file removed project_name/__init__.py
Empty file.
File renamed without changes.
19 changes: 19 additions & 0 deletions project_name/admin.py-tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from django.contrib import admin
from django.contrib.auth import get_user_model

User = get_user_model()


class ProxyUser(User):
class Meta:
proxy = True
managed = False
app_label = 'auth'
verbose_name = User._meta.verbose_name
verbose_name_plural = User._meta.verbose_name_plural


# Place the User ModelAdmin alongside the models from django.contrib.auth instead of in a separate
# authtools section.
admin.site.unregister(User)
admin.site.register(ProxyUser)
18 changes: 18 additions & 0 deletions project_name/asgi.py-tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
ASGI config for {{ project_name }} project.

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

For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/asgi/
"""

import os

import dotenv
from django.core.asgi import get_asgi_application

dotenv.load_dotenv()
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{{ project_name }}.settings')

application = get_asgi_application()
17 changes: 17 additions & 0 deletions project_name/context_processors.py-tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os

settings_module = os.environ['DJANGO_SETTINGS_MODULE']
if settings_module == '{{ project_name }}.settings_production':
env = 'production'
elif settings_module == '{{ project_name }}.settings_staging':
env = 'staging'
elif settings_module in ('{{ project_name }}.settings_dev', '{{ project_name }}.settings_local'):
env = 'dev'
elif settings_module == '{{ project_name }}.settings_test':
env = 'test'
else:
env = None


def environment(request):
return {'ENVIRONMENT': env}
6 changes: 0 additions & 6 deletions project_name/exception_logging.py

This file was deleted.

Empty file removed project_name/public/.gitkeep
Empty file.
Loading