From c866a90a3fc0a0ad9eb595f00b91beb6cd0d0220 Mon Sep 17 00:00:00 2001 From: Mike Crute Date: Thu, 27 May 2010 23:17:55 -0400 Subject: Relocating default settings and templates into the djangopypi package --- chishop/__init__.py | 2 - chishop/conf/__init__.py | 0 chishop/conf/default.py | 111 -------------------- chishop/manage.py | 11 -- chishop/media/__init__.py | 0 chishop/media/dists/__init__.py | 0 chishop/media/style/djangopypi.css | 4 - chishop/production_example.py | 18 ---- chishop/settings.py | 2 +- chishop/templates/404.html | 12 --- chishop/templates/500.html | 12 --- chishop/templates/admin/base_site.html | 10 -- chishop/templates/base.html | 77 -------------- chishop/templates/base_site.html | 14 --- chishop/templates/djangopypi/pypi.html | 16 --- chishop/templates/djangopypi/pypi_show_links.html | 40 -------- chishop/templates/djangopypi/search.html | 4 - chishop/templates/djangopypi/search_results.html | 31 ------ chishop/templates/djangopypi/show_channel.html | 7 -- chishop/templates/djangopypi/show_links.html | 7 -- chishop/templates/djangopypi/show_version.html | 5 - chishop/templates/djangopypi/simple.html | 5 - chishop/templates/registration/activate.html | 8 -- .../registration/activation_complete.html | 9 -- .../templates/registration/activation_email.txt | 6 -- .../registration/activation_email_subject.txt | 1 - chishop/templates/registration/login.html | 8 -- chishop/templates/registration/logout.html | 7 -- .../registration/registration_closed.html | 8 -- .../registration/registration_complete.html | 8 -- .../templates/registration/registration_form.html | 8 -- chishop/urls.py | 26 ----- djangopypi/htdocs/media/__init__.py | 0 djangopypi/htdocs/media/dists/__init__.py | 0 djangopypi/htdocs/media/style/djangopypi.css | 4 + djangopypi/manage.py | 11 ++ djangopypi/settings.py | 112 +++++++++++++++++++++ djangopypi/templates/404.html | 12 +++ djangopypi/templates/500.html | 12 +++ djangopypi/templates/admin/base_site.html | 10 ++ djangopypi/templates/base.html | 77 ++++++++++++++ djangopypi/templates/base_site.html | 14 +++ djangopypi/templates/djangopypi/pypi.html | 16 +++ .../templates/djangopypi/pypi_show_links.html | 40 ++++++++ djangopypi/templates/djangopypi/search.html | 4 + .../templates/djangopypi/search_results.html | 31 ++++++ djangopypi/templates/djangopypi/show_channel.html | 7 ++ djangopypi/templates/djangopypi/show_links.html | 7 ++ djangopypi/templates/djangopypi/show_version.html | 5 + djangopypi/templates/djangopypi/simple.html | 5 + djangopypi/templates/registration/activate.html | 8 ++ .../registration/activation_complete.html | 9 ++ .../templates/registration/activation_email.txt | 6 ++ .../registration/activation_email_subject.txt | 1 + djangopypi/templates/registration/login.html | 8 ++ djangopypi/templates/registration/logout.html | 7 ++ .../registration/registration_closed.html | 8 ++ .../registration/registration_complete.html | 8 ++ .../templates/registration/registration_form.html | 8 ++ djangopypi/urls/__init__.py | 25 ++++- setup.py | 1 + 61 files changed, 454 insertions(+), 479 deletions(-) delete mode 100644 chishop/conf/__init__.py delete mode 100644 chishop/conf/default.py delete mode 100644 chishop/manage.py delete mode 100644 chishop/media/__init__.py delete mode 100644 chishop/media/dists/__init__.py delete mode 100644 chishop/media/style/djangopypi.css delete mode 100644 chishop/production_example.py delete mode 100644 chishop/templates/404.html delete mode 100644 chishop/templates/500.html delete mode 100644 chishop/templates/admin/base_site.html delete mode 100644 chishop/templates/base.html delete mode 100644 chishop/templates/base_site.html delete mode 100644 chishop/templates/djangopypi/pypi.html delete mode 100644 chishop/templates/djangopypi/pypi_show_links.html delete mode 100644 chishop/templates/djangopypi/search.html delete mode 100644 chishop/templates/djangopypi/search_results.html delete mode 100644 chishop/templates/djangopypi/show_channel.html delete mode 100644 chishop/templates/djangopypi/show_links.html delete mode 100644 chishop/templates/djangopypi/show_version.html delete mode 100644 chishop/templates/djangopypi/simple.html delete mode 100644 chishop/templates/registration/activate.html delete mode 100644 chishop/templates/registration/activation_complete.html delete mode 100644 chishop/templates/registration/activation_email.txt delete mode 100644 chishop/templates/registration/activation_email_subject.txt delete mode 100644 chishop/templates/registration/login.html delete mode 100644 chishop/templates/registration/logout.html delete mode 100644 chishop/templates/registration/registration_closed.html delete mode 100644 chishop/templates/registration/registration_complete.html delete mode 100644 chishop/templates/registration/registration_form.html delete mode 100644 chishop/urls.py create mode 100644 djangopypi/htdocs/media/__init__.py create mode 100644 djangopypi/htdocs/media/dists/__init__.py create mode 100644 djangopypi/htdocs/media/style/djangopypi.css create mode 100644 djangopypi/manage.py create mode 100644 djangopypi/settings.py create mode 100644 djangopypi/templates/404.html create mode 100644 djangopypi/templates/500.html create mode 100644 djangopypi/templates/admin/base_site.html create mode 100644 djangopypi/templates/base.html create mode 100644 djangopypi/templates/base_site.html create mode 100644 djangopypi/templates/djangopypi/pypi.html create mode 100644 djangopypi/templates/djangopypi/pypi_show_links.html create mode 100644 djangopypi/templates/djangopypi/search.html create mode 100644 djangopypi/templates/djangopypi/search_results.html create mode 100644 djangopypi/templates/djangopypi/show_channel.html create mode 100644 djangopypi/templates/djangopypi/show_links.html create mode 100644 djangopypi/templates/djangopypi/show_version.html create mode 100644 djangopypi/templates/djangopypi/simple.html create mode 100644 djangopypi/templates/registration/activate.html create mode 100644 djangopypi/templates/registration/activation_complete.html create mode 100644 djangopypi/templates/registration/activation_email.txt create mode 100644 djangopypi/templates/registration/activation_email_subject.txt create mode 100644 djangopypi/templates/registration/login.html create mode 100644 djangopypi/templates/registration/logout.html create mode 100644 djangopypi/templates/registration/registration_closed.html create mode 100644 djangopypi/templates/registration/registration_complete.html create mode 100644 djangopypi/templates/registration/registration_form.html diff --git a/chishop/__init__.py b/chishop/__init__.py index b56a51c..e69de29 100644 --- a/chishop/__init__.py +++ b/chishop/__init__.py @@ -1,2 +0,0 @@ -VERSION = (0, 1, 1) -__version__ = ".".join(map(str, VERSION)) diff --git a/chishop/conf/__init__.py b/chishop/conf/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/chishop/conf/default.py b/chishop/conf/default.py deleted file mode 100644 index 97002b6..0000000 --- a/chishop/conf/default.py +++ /dev/null @@ -1,111 +0,0 @@ -# Django settings for djangopypi project. -import os - -ADMINS = ( - # ('Your Name', 'your_email@domain.com'), -) - -# Allow uploading a new distribution file for a project version -# if a file of that type already exists. -# -# The default on PyPI is to not allow this, but it can be real handy -# if you're sloppy. -DJANGOPYPI_ALLOW_VERSION_OVERWRITE = False -DJANGOPYPI_RELEASE_UPLOAD_TO = 'dists' - -# change to False if you do not want Django's default server to serve static pages -LOCAL_DEVELOPMENT = True - -REGISTRATION_OPEN = True -ACCOUNT_ACTIVATION_DAYS = 7 -LOGIN_REDIRECT_URL = "/" - -EMAIL_HOST = '' -DEFAULT_FROM_EMAIL = '' -SERVER_EMAIL = DEFAULT_FROM_EMAIL - -MANAGERS = ADMINS - -DATABASE_ENGINE = '' -DATABASE_NAME = '' -DATABASE_USER = '' -DATABASE_PASSWORD = '' -DATABASE_HOST = '' -DATABASE_PORT = '' - -# 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 = 'America/Chicago' - -# Language code for this installation. All choices can be found here: -# http://www.i18nguy.com/unicode/language-identifiers.html -LANGUAGE_CODE = 'en-us' - -SITE_ID = 1 - -# If you set this to False, Django will make some optimizations so as not -# to load the internationalization machinery. -USE_I18N = True - -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" -here = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) -MEDIA_ROOT = os.path.join(here, 'media') - -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash if there is a path component (optional in other cases). -# Examples: "http://media.lawrence.com", "http://example.com/media/" -MEDIA_URL = '/media/' - -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = '/admin-media/' - -# Make this unique, and don't share it with anybody. -SECRET_KEY = 'w_#0r2hh)=!zbynb*gg&969@)sy#^-^ia3m*+sd4@lst$zyaxu' - -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.load_template_source', - 'django.template.loaders.app_directories.load_template_source', -# 'django.template.loaders.eggs.load_template_source', -) - -MIDDLEWARE_CLASSES = ( - 'django.middleware.common.CommonMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', -) - -ROOT_URLCONF = 'urls' - -TEMPLATE_CONTEXT_PROCESSORS = ( - "django.core.context_processors.auth", - "django.core.context_processors.debug", - "django.core.context_processors.i18n", - "django.core.context_processors.media", - "django.core.context_processors.request", -) - -TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. - os.path.join(os.path.dirname(os.path.dirname(__file__)), "templates"), -) - -INSTALLED_APPS = ( - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.admin', - 'django.contrib.markup', - 'django.contrib.admindocs', - 'registration', - 'djangopypi', -) diff --git a/chishop/manage.py b/chishop/manage.py deleted file mode 100644 index 5e78ea9..0000000 --- a/chishop/manage.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python -from django.core.management import execute_manager -try: - import settings # Assumed to be in the same directory. -except ImportError: - import sys - sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) - sys.exit(1) - -if __name__ == "__main__": - execute_manager(settings) diff --git a/chishop/media/__init__.py b/chishop/media/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/chishop/media/dists/__init__.py b/chishop/media/dists/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/chishop/media/style/djangopypi.css b/chishop/media/style/djangopypi.css deleted file mode 100644 index e6fbfd9..0000000 --- a/chishop/media/style/djangopypi.css +++ /dev/null @@ -1,4 +0,0 @@ -.search { - text-align:right; - margin-right: 10px; -} \ No newline at end of file diff --git a/chishop/production_example.py b/chishop/production_example.py deleted file mode 100644 index b64623e..0000000 --- a/chishop/production_example.py +++ /dev/null @@ -1,18 +0,0 @@ -from conf.default import * -import os - -DEBUG = False -TEMPLATE_DEBUG = DEBUG - -ADMINS = ( - ('chishop', 'example@example.org'), -) - -MANAGERS = ADMINS - -DATABASE_ENGINE = 'postgresql_psycopg2' -DATABASE_NAME = 'chishop' -DATABASE_USER = 'chishop' -DATABASE_PASSWORD = 'chishop' -DATABASE_HOST = '' -DATABASE_PORT = '' diff --git a/chishop/settings.py b/chishop/settings.py index e68a4e5..90ee842 100644 --- a/chishop/settings.py +++ b/chishop/settings.py @@ -1,5 +1,5 @@ -from conf.default import * import os +from djangopypi.settings import * DEBUG = True TEMPLATE_DEBUG = DEBUG diff --git a/chishop/templates/404.html b/chishop/templates/404.html deleted file mode 100644 index 9bf4293..0000000 --- a/chishop/templates/404.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "admin/base_site.html" %} -{% load i18n %} - -{% block title %}{% trans 'Page not found' %}{% endblock %} - -{% block content %} - -

{% trans 'Page not found' %}

- -

{% trans "We're sorry, but the requested page could not be found." %}

- -{% endblock %} diff --git a/chishop/templates/500.html b/chishop/templates/500.html deleted file mode 100644 index b30e431..0000000 --- a/chishop/templates/500.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "admin/base_site.html" %} -{% load i18n %} - -{% block breadcrumbs %}{% endblock %} - -{% block title %}{% trans 'Server error (500)' %}{% endblock %} - -{% block content %} -

{% trans 'Server Error (500)' %}

-

{% trans "There's been an error. It's been reported to the site administrators via e-mail and should be fixed shortly. Thanks for your patience." %}

- -{% endblock %} diff --git a/chishop/templates/admin/base_site.html b/chishop/templates/admin/base_site.html deleted file mode 100644 index 9443eb2..0000000 --- a/chishop/templates/admin/base_site.html +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "admin/base.html" %} -{% load i18n %} - -{% block title %}{{ title }} | {% trans 'Chishop site admin' %}{% endblock %} - -{% block branding %} -

{% trans 'Chishop' %}

-{% endblock %} - -{% block nav-global %}{% endblock %} diff --git a/chishop/templates/base.html b/chishop/templates/base.html deleted file mode 100644 index dd797e7..0000000 --- a/chishop/templates/base.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - -{% block extrastyle %}{% endblock %} - -{% block title %}{% endblock %} - -{% block site_extrahead %}{% endblock %} -{% block extrahead %}{% endblock %} - - - - -
- - - - - - - {% block messagelist %} - {% if messages %} - - {% endif %} - {% endblock %} - - -
- {% block pretitle %}{% endblock %} -

{% block content_title %}{% endblock %}

-
- {% block objecttools %}{% endblock %} - {% block sidebar %}{% endblock %} - {% block content %}{{ content }}{% endblock %} -
-
-
- - - - - -
- - - - diff --git a/chishop/templates/base_site.html b/chishop/templates/base_site.html deleted file mode 100644 index 5257255..0000000 --- a/chishop/templates/base_site.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "base.html" %} - -{% block title %}{{ title }} | Chishop{% endblock %} - -{% block bread_crumbs_1 %} -› {{ title }} -{% endblock %} -{% block site_name_header %} -Chishop -{% endblock %} - -{% block content_title %}{{ title }}{% endblock %} - -{% block nav-global %}{% endblock %} diff --git a/chishop/templates/djangopypi/pypi.html b/chishop/templates/djangopypi/pypi.html deleted file mode 100644 index f98cf44..0000000 --- a/chishop/templates/djangopypi/pypi.html +++ /dev/null @@ -1,16 +0,0 @@ -{% extends "base_site.html" %} - -{% block bread_crumbs_1 %}{% endblock %} - -{% block content %} - - -{% for dist in dists %} - - - - -{% endfor %} -
UpdatedPackageSummary
{{ dist.updated|date:"d/m/y" }} - {{ dist.name }}{{ dist.summary|truncatewords:10 }}
-{% endblock %} diff --git a/chishop/templates/djangopypi/pypi_show_links.html b/chishop/templates/djangopypi/pypi_show_links.html deleted file mode 100644 index 13fc2e5..0000000 --- a/chishop/templates/djangopypi/pypi_show_links.html +++ /dev/null @@ -1,40 +0,0 @@ -{% extends "base_site.html" %} - -{% block content %} -

-{{ project.summary }} -

-{% load safemarkup %} -{{ project.description|saferst }} - -
- - - {% for release in releases %} - - - - - - - - - - {% endfor %} -
FilenamePlatformTypeVersionUploaded OnSizeChannel
{{ release.filename }}{{ release.platform }}{{ release.type }}{{ release.version }}{{ release.upload_time }}{{ release.distribution.size|filesizeformat }}{{ release.channel }}
-
- -{% endblock %} - diff --git a/chishop/templates/djangopypi/search.html b/chishop/templates/djangopypi/search.html deleted file mode 100644 index 8269508..0000000 --- a/chishop/templates/djangopypi/search.html +++ /dev/null @@ -1,4 +0,0 @@ -
- - -
\ No newline at end of file diff --git a/chishop/templates/djangopypi/search_results.html b/chishop/templates/djangopypi/search_results.html deleted file mode 100644 index dccf61f..0000000 --- a/chishop/templates/djangopypi/search_results.html +++ /dev/null @@ -1,31 +0,0 @@ -{% extends "base_site.html" %} - -{% block bread_crumbs_1 %}›Search{% endblock %} - -{% block content %} - {% ifnotequal search_term ''%} -

Index of Packages Matching '{{ search_term }}'

- {% else %} -

You need to supply a search term.

- {% endifnotequal %} - {% if dists %} - - - - - - - - {% for dist in dists %} - - - - - {% endfor %} - -
UpdatedPackageSummary
{{ dist.updated|date:"d/m/y" }} - {{ dist.name }}{{ dist.summary|truncatewords:10 }}
- {% else %} - There were no matches. - {% endif %} -{% endblock content %} \ No newline at end of file diff --git a/chishop/templates/djangopypi/show_channel.html b/chishop/templates/djangopypi/show_channel.html deleted file mode 100644 index 86d312c..0000000 --- a/chishop/templates/djangopypi/show_channel.html +++ /dev/null @@ -1,7 +0,0 @@ -Links for {{ channel.name }} -

Links for {{ channel.name }}

- -{% for project in projects %} -{{ project.name }}
-{% endfor %} - diff --git a/chishop/templates/djangopypi/show_links.html b/chishop/templates/djangopypi/show_links.html deleted file mode 100644 index 57a1268..0000000 --- a/chishop/templates/djangopypi/show_links.html +++ /dev/null @@ -1,7 +0,0 @@ -Links for {{ dist_name }} -

Links for {{ dist_name }}

- -{% for release in releases %} -{{ release.filename }}
-{% endfor %} - diff --git a/chishop/templates/djangopypi/show_version.html b/chishop/templates/djangopypi/show_version.html deleted file mode 100644 index d3b393a..0000000 --- a/chishop/templates/djangopypi/show_version.html +++ /dev/null @@ -1,5 +0,0 @@ -Links for {{ dist_name }} {{ version }} -

Links for {{ dist_name }} {{ version }}

- -{{ release.filename }}
- diff --git a/chishop/templates/djangopypi/simple.html b/chishop/templates/djangopypi/simple.html deleted file mode 100644 index 6a21d5c..0000000 --- a/chishop/templates/djangopypi/simple.html +++ /dev/null @@ -1,5 +0,0 @@ -Simple Index -{% for dist in dists %} -{{ dist.name }}
-{% endfor %} - diff --git a/chishop/templates/registration/activate.html b/chishop/templates/registration/activate.html deleted file mode 100644 index bc67771..0000000 --- a/chishop/templates/registration/activate.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base_site.html" %} - -{% block content %} -

Activation Failed

-

- Activation with key {{activation_key}} failed. -

-{% endblock %} diff --git a/chishop/templates/registration/activation_complete.html b/chishop/templates/registration/activation_complete.html deleted file mode 100644 index c8e8aca..0000000 --- a/chishop/templates/registration/activation_complete.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "base_site.html" %} - -{% block content %} -

Activation complete.

-

- Hello {{user}}, you are registered. - Go here to get back to the main page. -

-{% endblock %} diff --git a/chishop/templates/registration/activation_email.txt b/chishop/templates/registration/activation_email.txt deleted file mode 100644 index 0a25329..0000000 --- a/chishop/templates/registration/activation_email.txt +++ /dev/null @@ -1,6 +0,0 @@ -Welcome to Chishop. - -Please click here to activate your account: -http://{{site}}/accounts/activate/{{activation_key}}/ - -Account has to be activated within {{expiration_days}} days. diff --git a/chishop/templates/registration/activation_email_subject.txt b/chishop/templates/registration/activation_email_subject.txt deleted file mode 100644 index 93618cc..0000000 --- a/chishop/templates/registration/activation_email_subject.txt +++ /dev/null @@ -1 +0,0 @@ -Account Activation - {{ site }} diff --git a/chishop/templates/registration/login.html b/chishop/templates/registration/login.html deleted file mode 100644 index 6c7f799..0000000 --- a/chishop/templates/registration/login.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base_site.html" %} - -{% block content %} -
- {{form.as_p}} - -
-{% endblock %} diff --git a/chishop/templates/registration/logout.html b/chishop/templates/registration/logout.html deleted file mode 100644 index 06483a8..0000000 --- a/chishop/templates/registration/logout.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends "base_site.html" %} - -{% block main_content %} -

- {%trans "Logged out."%} -

-{% endblock %} diff --git a/chishop/templates/registration/registration_closed.html b/chishop/templates/registration/registration_closed.html deleted file mode 100644 index c92e80b..0000000 --- a/chishop/templates/registration/registration_closed.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base_site.html" %} - -{% block content %} -

Registration Closed

-

- Registration is disabled. -

-{% endblock %} diff --git a/chishop/templates/registration/registration_complete.html b/chishop/templates/registration/registration_complete.html deleted file mode 100644 index d9a19cf..0000000 --- a/chishop/templates/registration/registration_complete.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base_site.html" %} - -{% block content %} -

Registration complete

-

- An activation mail has been sent to you. -

-{% endblock %} diff --git a/chishop/templates/registration/registration_form.html b/chishop/templates/registration/registration_form.html deleted file mode 100644 index 719a875..0000000 --- a/chishop/templates/registration/registration_form.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base_site.html" %} - -{% block content %} -

Register

-
- {{form.as_p}} - -{% endblock %} diff --git a/chishop/urls.py b/chishop/urls.py deleted file mode 100644 index 5a5dd77..0000000 --- a/chishop/urls.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -from django.conf.urls.defaults import patterns, url, include, handler404, handler500 -from django.conf import settings -from django.contrib import admin - -admin.autodiscover() - -urlpatterns = patterns('') - -# Serve static pages. -if settings.LOCAL_DEVELOPMENT: - urlpatterns += patterns("django.views", - url(r"^%s(?P.*)$" % settings.MEDIA_URL[1:], "static.serve", { - "document_root": settings.MEDIA_ROOT})) - -urlpatterns += patterns("", - # Admin interface - url(r'^admin/doc/', include("django.contrib.admindocs.urls")), - url(r'^admin/(.*)', admin.site.root), - - # Registration - url(r'^accounts/', include('registration.backends.default.urls')), - - # The Chishop - url(r'', include("djangopypi.urls")) -) diff --git a/djangopypi/htdocs/media/__init__.py b/djangopypi/htdocs/media/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/djangopypi/htdocs/media/dists/__init__.py b/djangopypi/htdocs/media/dists/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/djangopypi/htdocs/media/style/djangopypi.css b/djangopypi/htdocs/media/style/djangopypi.css new file mode 100644 index 0000000..e6fbfd9 --- /dev/null +++ b/djangopypi/htdocs/media/style/djangopypi.css @@ -0,0 +1,4 @@ +.search { + text-align:right; + margin-right: 10px; +} \ No newline at end of file diff --git a/djangopypi/manage.py b/djangopypi/manage.py new file mode 100644 index 0000000..5e78ea9 --- /dev/null +++ b/djangopypi/manage.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +from django.core.management import execute_manager +try: + import settings # Assumed to be in the same directory. +except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.exit(1) + +if __name__ == "__main__": + execute_manager(settings) diff --git a/djangopypi/settings.py b/djangopypi/settings.py new file mode 100644 index 0000000..0fb8716 --- /dev/null +++ b/djangopypi/settings.py @@ -0,0 +1,112 @@ +# Django settings for djangopypi project. +import os + +ADMINS = ( + # ('Your Name', 'your_email@domain.com'), +) + +# Allow uploading a new distribution file for a project version +# if a file of that type already exists. +# +# The default on PyPI is to not allow this, but it can be real handy +# if you're sloppy. +DJANGOPYPI_ALLOW_VERSION_OVERWRITE = False +DJANGOPYPI_RELEASE_UPLOAD_TO = 'dists' + +# change to False if you do not want Django's default server to serve static pages +LOCAL_DEVELOPMENT = True + +REGISTRATION_OPEN = True +ACCOUNT_ACTIVATION_DAYS = 7 +LOGIN_REDIRECT_URL = "/" + +EMAIL_HOST = '' +DEFAULT_FROM_EMAIL = '' +SERVER_EMAIL = DEFAULT_FROM_EMAIL + +MANAGERS = ADMINS + +DATABASE_ENGINE = '' +DATABASE_NAME = '' +DATABASE_USER = '' +DATABASE_PASSWORD = '' +DATABASE_HOST = '' +DATABASE_PORT = '' + +# 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 = 'America/Chicago' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +here = os.path.abspath(os.path.dirname(__file__)) +MEDIA_ROOT = os.path.join(here, 'htdocs', 'media') + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash if there is a path component (optional in other cases). +# Examples: "http://media.lawrence.com", "http://example.com/media/" +MEDIA_URL = '/htdocs/media/' + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = '/admin-media/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = 'w_#0r2hh)=!zbynb*gg&969@)sy#^-^ia3m*+sd4@lst$zyaxu' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.load_template_source', + 'django.template.loaders.app_directories.load_template_source', +# 'django.template.loaders.eggs.load_template_source', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.csrf.middleware.CsrfMiddleware', +) + +ROOT_URLCONF = 'djangopypi.urls' + +TEMPLATE_CONTEXT_PROCESSORS = ( + "django.core.context_processors.auth", + "django.core.context_processors.debug", + "django.core.context_processors.i18n", + "django.core.context_processors.media", + "django.core.context_processors.request", +) + +TEMPLATE_DIRS = ( + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + os.path.join(os.path.dirname(os.path.dirname(__file__)), "templates"), +) + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.admin', + 'django.contrib.markup', + 'django.contrib.admindocs', + 'registration', + 'djangopypi', +) diff --git a/djangopypi/templates/404.html b/djangopypi/templates/404.html new file mode 100644 index 0000000..9bf4293 --- /dev/null +++ b/djangopypi/templates/404.html @@ -0,0 +1,12 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} + +{% block title %}{% trans 'Page not found' %}{% endblock %} + +{% block content %} + +

{% trans 'Page not found' %}

+ +

{% trans "We're sorry, but the requested page could not be found." %}

+ +{% endblock %} diff --git a/djangopypi/templates/500.html b/djangopypi/templates/500.html new file mode 100644 index 0000000..b30e431 --- /dev/null +++ b/djangopypi/templates/500.html @@ -0,0 +1,12 @@ +{% extends "admin/base_site.html" %} +{% load i18n %} + +{% block breadcrumbs %}{% endblock %} + +{% block title %}{% trans 'Server error (500)' %}{% endblock %} + +{% block content %} +

{% trans 'Server Error (500)' %}

+

{% trans "There's been an error. It's been reported to the site administrators via e-mail and should be fixed shortly. Thanks for your patience." %}

+ +{% endblock %} diff --git a/djangopypi/templates/admin/base_site.html b/djangopypi/templates/admin/base_site.html new file mode 100644 index 0000000..9443eb2 --- /dev/null +++ b/djangopypi/templates/admin/base_site.html @@ -0,0 +1,10 @@ +{% extends "admin/base.html" %} +{% load i18n %} + +{% block title %}{{ title }} | {% trans 'Chishop site admin' %}{% endblock %} + +{% block branding %} +

{% trans 'Chishop' %}

+{% endblock %} + +{% block nav-global %}{% endblock %} diff --git a/djangopypi/templates/base.html b/djangopypi/templates/base.html new file mode 100644 index 0000000..dd797e7 --- /dev/null +++ b/djangopypi/templates/base.html @@ -0,0 +1,77 @@ + + + + + +{% block extrastyle %}{% endblock %} + +{% block title %}{% endblock %} + +{% block site_extrahead %}{% endblock %} +{% block extrahead %}{% endblock %} + + + + +
+ + + + + + + {% block messagelist %} + {% if messages %} +
    + {% for message in messages %} +
  • {{ message }}
  • + {% endfor %} +
+ {% endif %} + {% endblock %} + + +
+ {% block pretitle %}{% endblock %} +

{% block content_title %}{% endblock %}

+
+ {% block objecttools %}{% endblock %} + {% block sidebar %}{% endblock %} + {% block content %}{{ content }}{% endblock %} +
+
+
+ + + + + +
+ + + + diff --git a/djangopypi/templates/base_site.html b/djangopypi/templates/base_site.html new file mode 100644 index 0000000..5257255 --- /dev/null +++ b/djangopypi/templates/base_site.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block title %}{{ title }} | Chishop{% endblock %} + +{% block bread_crumbs_1 %} +› {{ title }} +{% endblock %} +{% block site_name_header %} +Chishop +{% endblock %} + +{% block content_title %}{{ title }}{% endblock %} + +{% block nav-global %}{% endblock %} diff --git a/djangopypi/templates/djangopypi/pypi.html b/djangopypi/templates/djangopypi/pypi.html new file mode 100644 index 0000000..f98cf44 --- /dev/null +++ b/djangopypi/templates/djangopypi/pypi.html @@ -0,0 +1,16 @@ +{% extends "base_site.html" %} + +{% block bread_crumbs_1 %}{% endblock %} + +{% block content %} + + +{% for dist in dists %} + + + + +{% endfor %} +
UpdatedPackageSummary
{{ dist.updated|date:"d/m/y" }} + {{ dist.name }}{{ dist.summary|truncatewords:10 }}
+{% endblock %} diff --git a/djangopypi/templates/djangopypi/pypi_show_links.html b/djangopypi/templates/djangopypi/pypi_show_links.html new file mode 100644 index 0000000..13fc2e5 --- /dev/null +++ b/djangopypi/templates/djangopypi/pypi_show_links.html @@ -0,0 +1,40 @@ +{% extends "base_site.html" %} + +{% block content %} +

+{{ project.summary }} +

+{% load safemarkup %} +{{ project.description|saferst }} + +
+ + + {% for release in releases %} + + + + + + + + + + {% endfor %} +
FilenamePlatformTypeVersionUploaded OnSizeChannel
{{ release.filename }}{{ release.platform }}{{ release.type }}{{ release.version }}{{ release.upload_time }}{{ release.distribution.size|filesizeformat }}{{ release.channel }}
+
+ +{% endblock %} + diff --git a/djangopypi/templates/djangopypi/search.html b/djangopypi/templates/djangopypi/search.html new file mode 100644 index 0000000..8269508 --- /dev/null +++ b/djangopypi/templates/djangopypi/search.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/djangopypi/templates/djangopypi/search_results.html b/djangopypi/templates/djangopypi/search_results.html new file mode 100644 index 0000000..dccf61f --- /dev/null +++ b/djangopypi/templates/djangopypi/search_results.html @@ -0,0 +1,31 @@ +{% extends "base_site.html" %} + +{% block bread_crumbs_1 %}›Search{% endblock %} + +{% block content %} + {% ifnotequal search_term ''%} +

Index of Packages Matching '{{ search_term }}'

+ {% else %} +

You need to supply a search term.

+ {% endifnotequal %} + {% if dists %} + + + + + + + + {% for dist in dists %} + + + + + {% endfor %} + +
UpdatedPackageSummary
{{ dist.updated|date:"d/m/y" }} + {{ dist.name }}{{ dist.summary|truncatewords:10 }}
+ {% else %} + There were no matches. + {% endif %} +{% endblock content %} \ No newline at end of file diff --git a/djangopypi/templates/djangopypi/show_channel.html b/djangopypi/templates/djangopypi/show_channel.html new file mode 100644 index 0000000..86d312c --- /dev/null +++ b/djangopypi/templates/djangopypi/show_channel.html @@ -0,0 +1,7 @@ +Links for {{ channel.name }} +

Links for {{ channel.name }}

+ +{% for project in projects %} +{{ project.name }}
+{% endfor %} + diff --git a/djangopypi/templates/djangopypi/show_links.html b/djangopypi/templates/djangopypi/show_links.html new file mode 100644 index 0000000..57a1268 --- /dev/null +++ b/djangopypi/templates/djangopypi/show_links.html @@ -0,0 +1,7 @@ +Links for {{ dist_name }} +

Links for {{ dist_name }}

+ +{% for release in releases %} +{{ release.filename }}
+{% endfor %} + diff --git a/djangopypi/templates/djangopypi/show_version.html b/djangopypi/templates/djangopypi/show_version.html new file mode 100644 index 0000000..d3b393a --- /dev/null +++ b/djangopypi/templates/djangopypi/show_version.html @@ -0,0 +1,5 @@ +Links for {{ dist_name }} {{ version }} +

Links for {{ dist_name }} {{ version }}

+ +{{ release.filename }}
+ diff --git a/djangopypi/templates/djangopypi/simple.html b/djangopypi/templates/djangopypi/simple.html new file mode 100644 index 0000000..6a21d5c --- /dev/null +++ b/djangopypi/templates/djangopypi/simple.html @@ -0,0 +1,5 @@ +Simple Index +{% for dist in dists %} +{{ dist.name }}
+{% endfor %} + diff --git a/djangopypi/templates/registration/activate.html b/djangopypi/templates/registration/activate.html new file mode 100644 index 0000000..bc67771 --- /dev/null +++ b/djangopypi/templates/registration/activate.html @@ -0,0 +1,8 @@ +{% extends "base_site.html" %} + +{% block content %} +

Activation Failed

+

+ Activation with key {{activation_key}} failed. +

+{% endblock %} diff --git a/djangopypi/templates/registration/activation_complete.html b/djangopypi/templates/registration/activation_complete.html new file mode 100644 index 0000000..c8e8aca --- /dev/null +++ b/djangopypi/templates/registration/activation_complete.html @@ -0,0 +1,9 @@ +{% extends "base_site.html" %} + +{% block content %} +

Activation complete.

+

+ Hello {{user}}, you are registered. + Go here to get back to the main page. +

+{% endblock %} diff --git a/djangopypi/templates/registration/activation_email.txt b/djangopypi/templates/registration/activation_email.txt new file mode 100644 index 0000000..0a25329 --- /dev/null +++ b/djangopypi/templates/registration/activation_email.txt @@ -0,0 +1,6 @@ +Welcome to Chishop. + +Please click here to activate your account: +http://{{site}}/accounts/activate/{{activation_key}}/ + +Account has to be activated within {{expiration_days}} days. diff --git a/djangopypi/templates/registration/activation_email_subject.txt b/djangopypi/templates/registration/activation_email_subject.txt new file mode 100644 index 0000000..93618cc --- /dev/null +++ b/djangopypi/templates/registration/activation_email_subject.txt @@ -0,0 +1 @@ +Account Activation - {{ site }} diff --git a/djangopypi/templates/registration/login.html b/djangopypi/templates/registration/login.html new file mode 100644 index 0000000..6c7f799 --- /dev/null +++ b/djangopypi/templates/registration/login.html @@ -0,0 +1,8 @@ +{% extends "base_site.html" %} + +{% block content %} +
+ {{form.as_p}} + +
+{% endblock %} diff --git a/djangopypi/templates/registration/logout.html b/djangopypi/templates/registration/logout.html new file mode 100644 index 0000000..06483a8 --- /dev/null +++ b/djangopypi/templates/registration/logout.html @@ -0,0 +1,7 @@ +{% extends "base_site.html" %} + +{% block main_content %} +

+ {%trans "Logged out."%} +

+{% endblock %} diff --git a/djangopypi/templates/registration/registration_closed.html b/djangopypi/templates/registration/registration_closed.html new file mode 100644 index 0000000..c92e80b --- /dev/null +++ b/djangopypi/templates/registration/registration_closed.html @@ -0,0 +1,8 @@ +{% extends "base_site.html" %} + +{% block content %} +

Registration Closed

+

+ Registration is disabled. +

+{% endblock %} diff --git a/djangopypi/templates/registration/registration_complete.html b/djangopypi/templates/registration/registration_complete.html new file mode 100644 index 0000000..d9a19cf --- /dev/null +++ b/djangopypi/templates/registration/registration_complete.html @@ -0,0 +1,8 @@ +{% extends "base_site.html" %} + +{% block content %} +

Registration complete

+

+ An activation mail has been sent to you. +

+{% endblock %} diff --git a/djangopypi/templates/registration/registration_form.html b/djangopypi/templates/registration/registration_form.html new file mode 100644 index 0000000..719a875 --- /dev/null +++ b/djangopypi/templates/registration/registration_form.html @@ -0,0 +1,8 @@ +{% extends "base_site.html" %} + +{% block content %} +

Register

+
+ {{form.as_p}} + +{% endblock %} diff --git a/djangopypi/urls/__init__.py b/djangopypi/urls/__init__.py index 50fd02b..72ff41d 100644 --- a/djangopypi/urls/__init__.py +++ b/djangopypi/urls/__init__.py @@ -1,16 +1,35 @@ # -*- coding: utf-8 -*- +from django.conf import settings +from django.contrib import admin from django.conf.urls.defaults import patterns, include + +admin.autodiscover() + + urlpatterns = patterns('djangopypi.views', + (r'^admin/doc/', include('django.contrib.admindocs.urls')), + (r'^admin/(.*)', admin.site.root), + + (r'^accounts/', include('registration.backends.default.urls')), + (r'^simple/', include('djangopypi.urls.simple')), (r'^channel/', include('djangopypi.urls.channel')), - (r'^$', 'simple', {'template_name': 'djangopypi/pypi.html'}, - 'djangopypi-pypi'), - (r'^(?P[\w\d_\.\-]+)/$', 'show_links', {'template_name': 'djangopypi/pypi_show_links.html'}, 'djangopypi-pypi_show_links'), (r'^search', 'search', {}, 'djangopypi-search'), + + (r'^$', 'simple', {'template_name': 'djangopypi/pypi.html'}, + 'djangopypi-pypi'), ) + + +# Serve static pages. +if settings.LOCAL_DEVELOPMENT: + urlpatterns += patterns('django.views', + (r'^%s(?P.*)$' % settings.MEDIA_URL[1:], 'static.serve', + {'document_root': settings.MEDIA_ROOT}) + ) diff --git a/setup.py b/setup.py index d85e423..055ed75 100755 --- a/setup.py +++ b/setup.py @@ -44,6 +44,7 @@ setup( 'django>=1.0', 'docutils', 'django-registration==0.8-alpha-1', + 'django-tagging>=0.3', ], dependency_links=[ 'http://bitbucket.org/ubernostrum/django-registration/downloads', -- cgit v1.2.3