justify"> wmv raquo ;, . mpeg raquo ;, . mpg raquo ;, . avi raquo ;, . rm ],
audio raquo ;: [ .mp3 raquo ;, .mp4 raquo ;, . wav raquo ;, . aiff raquo ;, . midi raquo ;, .m4p ]
} _ SELECT_FORMATS={
file raquo ;: [ Folder raquo ;, Image raquo ;, Document raquo ;, video raquo ;, audio ],
image raquo ;: [ Image ],
document raquo ;: [ Document ],
media raquo ;: [ video raquo ;, audio ],
}
Файл diplom/urls.py (містить всі url налаштувань і ссликой на urls.py інших додатків):
from django.conf.urls import patterns, include, urldjango.conf import settingsdjango.contrib import adminfilebrowser.sites import site.forms import RegistrationFormProfileprofile.views import ProfileSettingView, UploadViewregistrationos.autodiscover ()=patterns ( laquo ; ,
(r ^ accounts/ raquo ;, include ( registration.urls )), (r ^ grappelli / raquo ;, include ( grappelli.urls )),
(r ^ accounts/ raquo ;, include ( registration.urls )),
(r ^ accounts/profile/$ raquo ;, profile.views.profile_return ),
(r ^ accounts/edit/profile/$ raquo ;, ProfileSettingView.as_view ()), (r ^ admin / filebrowser / raquo ;, include (site.urls)), (r ^ admin / raquo ;, include (admin.site.urls )), (r ^ media/(? P lt; path gt;. *) $ raquo ;, django.views.static.serve raquo ;, { document_root raquo ;: settings.MEDIA_ROOT}), (r ^ < u align="justify"> admin /doc/ raquo ;, include ( django.contrib.admindocs.urls )),
(r ^ upload_file/$ raquo ;, UploadView.as_view ()), (r ^ profile/ raquo ;, include ( profile.urls )), (r ^ message/ raquo ;, include ( messages.urls )), (r ^ blog / raquo ;, include ( blog.urls )),
)
Додаток PROFILE:
Файл profile/urls.py (містить всі url-и додатки profile): django.conf.urls import patterns, include, urlviews import ProfileView=patterns ( , (r ^ $ raquo ;, ProfileView.as_view (), name=«profile»), (r ^ friend/(? P lt; pk gt; d +)/$ raquo ;, ProfileView.as_view (), name=«profile_friend»), (r ^ friends/all/$ raquo ;, profile.views.search_person ), (r ^ friends/add/(? P lt; id gt; [^/] +)/$ raquo ;, profile.views.add_person ), (r ^ friends/ del /(? P lt; id gt; [^ /] + )/$ raquo ;, profile.views.del_person ), (r ^ friends/accept/(? P lt; objid gt; [^ /] +)/ $ raquo ;, profile.views.accept_friend ), (r ^ friends/reject/(? P lt; objid gt; [^ /] +)/$ raquo ;, profile.views.reject_friend ),
)
Файл profile/models.py (містить моделі Profile і FileProfile додатки profile):
# - * - coding: utf -8 - * - django.db import modelsdjango.contrib.auth.models import Userdiplom.settings import * filebrowser.fields import FileBrowseFielddjango.core.urlresolvers import reversedatetime
Profile (models. Model):=models. ForeignKey (User, related_name= profile raquo ;, verbose_name=( User ), blank=True, null=True)=FileBrowseField (u « Іконка », max_length= 200, directory= uploads/ raquo ;, format= image raquo ;, null=True, blank=True)=models. TextField (u Додаткові відомості raquo ;, blank=True)=models. CharField (u Логін raquo ;, max_length=150, blank=True, null=True) _name=models. CharField (u Прізвище raquo ;, max_length=150, blank=True) _name=models. CharField (u Ім'я raquo ;, max_length=150, blank=True) _name=models. CharField (u По батькові raquo ;, max_length=150, blank=True)
=models. ManyToManyField («self», blank=True, null=True, symmetrical=False, related_name= friends_targets ) _ requests=models. ManyToManyField («self», blank=True, null=True, symmetrical=False, related_name= friend_requests_targets )
icq=models. CharField (u ICQ raquo ;, max_length=150, blank=True)=models. CharField (u Skype raquo ;, max_length=150, blank=True)=models. CharField (u Телефон raquo ;...