예제 #1
0
파일: views.py 프로젝트: a740122/pcp
def refresh_wsgi(request):
    if not request.is_ajax():
        return HttpResponseForbidden('non ajax not allowed')

    wsgis = get_user_wsgis(request.session.get('switched_user', request.user), False)

    return JsonResponse('OK', wsgis)
예제 #2
0
    def __init__(self, *args, **kwargs):
        super(FormWsgi, self).__init__(*args, **kwargs)

        self.fields['static'].help_text = _(
            u"<br />Format <strong>/url/ /path/to/media/</strong>, separated by space.<br /><ul><li>/path/to/media/ is path without your home directory</li><li>one directory per one line</li><li>wrong lines will be ignored</li></ul>.")
        self.fields['python_path'].help_text = _(
            u"<br /><strong>~/&lt;your_path&gt;</strong> - One directory per line. Format <strong>/there/is/my/app</strong>. Path is without your home directory")
        self.fields['virtualenv'].help_text = _(
            u"<br />Python virtual environment. You can find yours in '<strong>~/virtualenvs/&lt;selected_virtualenv&gt;</strong>'. Feel free create new one.")
        self.fields['allow_ips'].help_text = _(
            u"<br />One IP per line. If it is blank, no limitation will be applied.")
        self.fields['processes'].help_text = _(
            u"<br />There could be extra fee for additional processes")

        self.fields['processes'].widget.choices = [(one, str(one)) for one in
                                                                   range(1, 5)]

        wsgis = get_user_wsgis(self.user)
        wsgis_choices = [("", _("Not selected"))] + [(x, x) for x in wsgis]
        self.fields['script'].widget.choices = wsgis_choices

        virtualenvs = get_user_venvs(self.user)
        virtualenvs_choices = [("", _("Not selected"))] + [(one, one) for one in
                                                                      virtualenvs]
        self.fields["virtualenv"].widget.choices = virtualenvs_choices
예제 #3
0
def refresh_wsgi(request):
    if not request.is_ajax():
        return HttpResponseForbidden('non ajax not allowed')

    wsgis = get_user_wsgis(request.session.get('switched_user', request.user),
                           False)

    return JsonResponse('OK', wsgis)