About 472,000 results
# settings.py
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
STATIC_URL = '/static/'
# urls.py
if DEBUG:
urlpatterns += static(MEDIA_URL, document_root=MEDIA_ROOT)
location /admin {
auth_basic "closed site";
auth_basic_user_file conf/htpasswd;
}
Каков процент попадания писем в спам?тут больше зависит от рассылки - на первых порах тебе не дадут рассылать много писем
# urls.py
url(r"^/show-all/(?P<pk>\d+)/", some_view, name='show_all' ),
url(r"^/rozdil/(?P<pk>\d+)/", some_view1, name='rozdil' ),
url(r"^/name-part/(?P<pk>\d+)/", some_view2, name='name_part'),
# models.py
class NamePart(models.Model):
title = models.CharField(max_length=255,verbose_name=" .")
def get_absolute_url(self):
# используй
# https://docs.djangoproject.com/en/1.8/topics/http/urls/#reverse-resolution-of-urls
return reverse('name_part', self.id)
def __unicode__(self):
return u'%s' % (self.title)
class Rozdil(models.Model):
title = models.CharField(max_length=255,verbose_name="Налу")
part_of = models.ForeignKey(NamePart,verbose_name="н")
is_main = models.BooleanField(default=1,verbose_name="Гоний ?")
def get_absolute_url(self):
return reverse('rozdil', self.id)
def __unicode__(self):
return u'%s' % (self.title)
#views.py
def some_view(request):
foo = []
for name_part in NamePart.objects.all():
foo.append({
'name_part': name_part,
'rozdils': Rozdil.objects.filter(part_of=name_part.pk)
})
return render(request, 'template_show_all.html', {'foo': foo})
# template_show_all.html
{% for buzz in foo %}
<h1>{{ buzz. name_part.title}}
{% for bar in buzz.rozdils %}
<h2>{{ bar.title }}
{% endfor %}
{% endfor %}
# models.py
class Article(models.Model):
title = models.CharField(max_length=255)
content = models.TextField()
img = models.ImageField(upload_to='/article',
height_field=100, width_field=100)
#urls.py
url(r'^article/(?P<pk>[0-9]+)/$', DetailView.as_view(
context_object_name="article",
model=Article,
template_name="article.html"
), name='article-detail'),
#article.html
<h1>{{ article.title }}
<img src="{{ article.img.url }}">
<content>{{ article.context }}
NetRange: 172.16.0.0 - 172.31.255.255
CIDR: 172.16.0.0/12
NetName: PRIVATE-ADDRESS-BBLK-RFC1918-IANA-RESERVED
<input type="text"
class="form-control"
value="{{ APP_INVITATION_STRING_IN_FORM }}"
id="fio"
autocomplete="on"
placeholder="{{ APP_INVITATION_STRING_IN_FORM }}"
<!--
ВТФ!???
onfocus="if(this.value=='{{ APP_INVITATION_STRING_IN_FORM }}'){
this.value='';
this.style.color='#000';
}"
onblur= "if(this.value==''){this.value='{{ APP_INVITATION_STRING_IN_FORM }}';
this.style.color='#777';
}" -->
>
$.fn.select2.locales['en']
this.liveRegion = $('.select2-hidden-accessible');