Skip to content

Instantly share code, notes, and snippets.

@jluttine
Created November 24, 2017 07:11
Show Gist options
  • Save jluttine/a38e40027ad1f853132eef0bf41dd2a7 to your computer and use it in GitHub Desktop.
Save jluttine/a38e40027ad1f853132eef0bf41dd2a7 to your computer and use it in GitHub Desktop.
failing django nix config
sportsteam = buildPythonPackage rec {
name = "sportsteam-${version}";
version = "0.1.14";
src = /home/jluttine/Workspace/django-sportsteam;
# Couldn't get the tests working. "App's aren't loaded yet"
doCheck = false;
propagatedBuildInputs = with pythonPackages; [
django
icalendar
];
};
directory = "/var/lib/teamname";
settingsFile = pkgs.writeTextFile "settings.py" ''
from sportsteam.settings.prod import *
DEBUG = True
TEAM_NAME = 'FC Teamname'
TEAM_SLUG = 'teamname'
TEAM_TAG = 'Teamname'
ADMINS = (
('Jaakko Luttinen', 'jaakko.luttinen@iki.fi'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '${directory}/teamname.db'
}
}
STATIC_ROOT = '${directory}/static/'
MEDIA_ROOT = '${directory}/media/'
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Europe/Helsinki'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'fi'
SITE_ID = 1
# Make this unique, and don't share it with anybody.
# Use environment variable here..
SECRET_KEY = 'foobar'
ALLOWED_HOSTS = ['*']
'';
setupFile = pkgs.writeTextFile "setup.py" ''
from setuptools import setup
setup(
install_requires = ["sportsteam"],
package_dir = {"teamname": "${settingsFile}"},
py_modules = "settings",
name = "teamname",
)
'';
teamname = buildPythonPackage rec {
name = "teamname";
src = setupFile;
propagatedBuildInputs = with pythonPackages; [
sportsteam
(pkgs.uwsgi.override { plugins = [ "python3" ]; })
];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment