mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-01-22 20:44:55 +00:00
web: avoid importing or accessing modules using "web.*"
This commit is contained in:
parent
9a9ddbc23f
commit
d50bb7a66f
@ -1,6 +1,6 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
from web.lib.validation import validate_i2purl
|
from lib.validation import validate_i2purl
|
||||||
|
|
||||||
class ExternalSource(models.Model):
|
class ExternalSource(models.Model):
|
||||||
name = models.CharField(max_length=128, unique=True)
|
name = models.CharField(max_length=128, unique=True)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from django.conf.urls.defaults import *
|
from django.conf.urls.defaults import *
|
||||||
|
|
||||||
urlpatterns = patterns('web.jump.views',
|
urlpatterns = patterns('jump.views',
|
||||||
(r'^([^$/]+)', 'jumper'),
|
(r'^([^$/]+)', 'jumper'),
|
||||||
|
|
||||||
)
|
)
|
||||||
|
@ -3,9 +3,9 @@ import re
|
|||||||
from django.shortcuts import render_to_response
|
from django.shortcuts import render_to_response
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
|
|
||||||
from web.postkey.models import i2phost
|
from postkey.models import i2phost
|
||||||
from web.lib.validation import validate_hostname
|
from lib.validation import validate_hostname
|
||||||
from web import settings
|
import settings
|
||||||
|
|
||||||
def jumper(request, host):
|
def jumper(request, host):
|
||||||
"""Actually do jumps."""
|
"""Actually do jumps."""
|
||||||
|
@ -4,7 +4,7 @@ import re
|
|||||||
|
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
|
|
||||||
from web.postkey.models import i2phost
|
from postkey.models import i2phost
|
||||||
|
|
||||||
|
|
||||||
def validate_hostname(data):
|
def validate_hostname(data):
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from django.shortcuts import render_to_response
|
from django.shortcuts import render_to_response
|
||||||
from web import settings
|
import settings
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
return render_to_response('index.html', {
|
return render_to_response('index.html', {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from django.conf.urls.defaults import *
|
from django.conf.urls.defaults import *
|
||||||
|
|
||||||
urlpatterns = patterns('web.postkey.views',
|
urlpatterns = patterns('postkey.views',
|
||||||
(r'^$', 'addkey'),
|
(r'^$', 'addkey'),
|
||||||
(r'^success/', 'success'),
|
(r'^success/', 'success'),
|
||||||
)
|
)
|
||||||
|
@ -5,11 +5,11 @@ from django.forms import ModelForm
|
|||||||
from django.shortcuts import render_to_response
|
from django.shortcuts import render_to_response
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
|
|
||||||
from web import settings
|
import settings
|
||||||
from web.postkey.models import i2phost
|
from postkey.models import i2phost
|
||||||
from web.lib.utils import get_logger
|
from lib.utils import get_logger
|
||||||
from web.lib.validation import validate_hostname
|
from lib.validation import validate_hostname
|
||||||
from web.lib.validation import validate_b64hash
|
from lib.validation import validate_b64hash
|
||||||
|
|
||||||
class AddForm(ModelForm):
|
class AddForm(ModelForm):
|
||||||
"""
|
"""
|
||||||
|
@ -78,7 +78,7 @@ MIDDLEWARE_CLASSES = (
|
|||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
)
|
)
|
||||||
|
|
||||||
ROOT_URLCONF = 'web.urls'
|
ROOT_URLCONF = 'urls'
|
||||||
|
|
||||||
TEMPLATE_DIRS = (
|
TEMPLATE_DIRS = (
|
||||||
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
|
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
|
||||||
@ -93,8 +93,8 @@ INSTALLED_APPS = (
|
|||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.sites',
|
'django.contrib.sites',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'web.postkey',
|
'postkey',
|
||||||
'web.extsources',
|
'extsources',
|
||||||
# Uncomment the next line to enable the admin:
|
# Uncomment the next line to enable the admin:
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
)
|
)
|
||||||
|
@ -4,14 +4,12 @@ from django.conf.urls.defaults import *
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
admin.autodiscover()
|
admin.autodiscover()
|
||||||
|
|
||||||
from web.other.views import *
|
from other.views import *
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
urlpatterns = patterns('',
|
||||||
url(r'^$', index, name='index'),
|
url(r'^$', index, name='index'),
|
||||||
(r'^postkey/', include('web.postkey.urls')),
|
(r'^postkey/', include('postkey.urls')),
|
||||||
(r'^jump/', include('web.jump.urls')),
|
(r'^jump/', include('jump.urls')),
|
||||||
# Example:
|
|
||||||
# (r'^web/', include('web.foo.urls')),
|
|
||||||
|
|
||||||
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
|
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
|
||||||
# to INSTALLED_APPS to enable admin documentation:
|
# to INSTALLED_APPS to enable admin documentation:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user