Permalink
Browse files

Merge branch 'master' of git://github.com/ask/chishop

  • Loading branch information...
2 parents 93d46f7 + 1e2fdc9 commit eb834c564045a07e0014c5754231a857f13db663 @bshi bshi committed Dec 23, 2009
View
@@ -5,6 +5,7 @@
*.sqlite-journal
settings_local.py
.*.sw[po]
+*.kpf
dist/
*.egg-info
doc/__build/*
@@ -14,4 +15,4 @@ parts
eggs
bin
developer-eggs
-downloads
+downloads
View
@@ -4,3 +4,6 @@ Russell Sim <russell.sim@gmail.com>
Brian Rosner <brosner@gmail.com>
Hugo Lopes Tavares <hltbra@gmail.com>
Sverre Johansen <sverre.johansen@gmail.com>
+Bo Shi <bs@alum.mit.edu>
+Carl Meyer <carl@dirtcircle.com>
+Vinícius das Chagas Silva <vinimaster@gmail.com>
View
7 README
@@ -27,6 +27,13 @@ Run the PyPI server
Please note that ``chishop/media/dists`` has to be writable by the
user the web-server is running as.
+In production
+-------------
+
+You may want to copy the file ``chishop/production_example.py`` and modify
+for use as your production settings; you will also need to modify
+``bin/django.wsgi`` to refer to your production settings.
+
Using Setuptools
================
View
1 TODO
@@ -11,7 +11,6 @@ PyPI feature replication
I'm not sure what the difference between a co-owner and maintainer is,
maybe it's just a label.
* Package author admin interface (submit, edit, view)
-* Search
* Documentation upload
* Ratings
* Random Monty Python quotes :-)
View
@@ -8,7 +8,7 @@ eggs = pkginfo
[django]
recipe = djangorecipe
version = 1.1.1
-settings = development
+settings = settings
eggs = ${buildout:eggs}
test = djangopypi
project = chishop
View
No changes.
View
@@ -0,0 +1,111 @@
+# 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',
+)
View
@@ -1,23 +0,0 @@
-from settings import *
-import os
-
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
-LOCAL_DEVELOPMENT = True
-
-if LOCAL_DEVELOPMENT:
- import sys
- sys.path.append(os.path.dirname(__file__))
-
-ADMINS = (
- ('chishop', 'example@example.org'),
-)
-
-MANAGERS = ADMINS
-
-DATABASE_ENGINE = 'sqlite3'
-DATABASE_NAME = os.path.join(here, 'devdatabase.db')
-DATABASE_USER = ''
-DATABASE_PASSWORD = ''
-DATABASE_HOST = ''
-DATABASE_PORT = ''
@@ -0,0 +1,4 @@
+.search {
+ text-align:right;
+ margin-right: 10px;
+}
@@ -0,0 +1,18 @@
+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 = ''
View
@@ -1,113 +1,23 @@
-# Django settings for djangopypi project.
+from conf.default import *
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
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
LOCAL_DEVELOPMENT = True
-REGISTRATION_OPEN = True
-ACCOUNT_ACTIVATION_DAYS = 7
-LOGIN_REDIRECT_URL = "/"
+if LOCAL_DEVELOPMENT:
+ import sys
+ sys.path.append(os.path.dirname(__file__))
-EMAIL_HOST = ''
-DEFAULT_FROM_EMAIL = ''
-SERVER_EMAIL = DEFAULT_FROM_EMAIL
+ADMINS = (
+ ('chishop', 'example@example.org'),
+)
MANAGERS = ADMINS
-DATABASE_ENGINE = ''
-DATABASE_NAME = ''
+DATABASE_ENGINE = 'sqlite3'
+DATABASE_NAME = os.path.join(here, 'devdatabase.db')
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, '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/'
-
-MEDIA_PREFIX = "/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(__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',
-)
@@ -2,6 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-au" xml:lang="en-au">
<head>
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base.css{% endblock %}"/>
+<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}style/djangopypi.css"/>
{% block extrastyle %}{% endblock %}
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>{% block title %}{% endblock %}</title>
@@ -20,6 +21,10 @@
{% block site_logo %}{% endblock %}
<h1 id="site-name">{% block site_name_header %}{% endblock %}</h1>
</div>
+
+ <div class="search">
+ {% include "djangopypi/search.html" %}
+ </div>
<div id="user-tools">
{% if user.is_authenticated %}
@@ -0,0 +1,4 @@
+<form action='search' method='post'>
+ <input type="text" name="search_term" id="search_term">
+ <input type='submit' value=' Search '/>
+</form>
@@ -0,0 +1,31 @@
+{% extends "base_site.html" %}
+
+{% block bread_crumbs_1 %}&rsaquo;Search{% endblock %}
+
+{% block content %}
+ {% ifnotequal search_term ''%}
+ <h1>Index of Packages Matching '{{ search_term }}'</h1>
+ {% else %}
+ <h1>You need to supply a search term.</h1>
+ {% endifnotequal %}
+ {% if dists %}
+ <table>
+ <thead>
+ <th>Updated</th>
+ <th>Package</th>
+ <th>Summary</th>
+ </thead>
+ <tbody>
+ {% for dist in dists %}
+ <tr>
+ <td>{{ dist.updated|date:"d/m/y" }}
+ <td><a href="{{ dist.get_pypi_absolute_url }}"/>{{ dist.name }}</a></td>
+ <td>{{ dist.summary|truncatewords:10 }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% else %}
+ There were no matches.
+ {% endif %}
+{% endblock content %}
Oops, something went wrong.

0 comments on commit eb834c5

Please sign in to comment.