Jump to content

simbairk

Members
  • Posts

    5
  • Joined

  • Last visited

About simbairk

  • Birthday 02/09/1987

Contact Methods

  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Gender
    Male
  • Location
    Russia/Irkutsk
  • Interests
    {programing:[1C(as work),Python (as hobby), Java (as study)], music:Linkin Park, Ария, Эпидемия, Алиса, Lumen, etc rock/ punk-rock}

simbairk's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. perhaps this is too much in sys.path must be the way to django, I did not know, and uploaded their
  2. I was able to run my django project: create /home/simbairk/.python_egg_cache (chmod 775) /home/simbairk/public_html/.htaccess (chmod 644) AddHandler wsgi-script .wsgi RewriteEngine On RewriteBase / RewriteRule ^(dispatch\.wsgi/.*)$ - [L] RewriteRule ^(.*)$ dispatch.wsgi/$1 [QSA,PT,L] I'm using django 1.1 and uploaded it to the public_html /home/simbairk/public_html/dispatch.wsgi (chmod 755) import os, sys sys.path.append("/home/simbairk/public_html/") sys.path.append("/home/simbairk/public_html/django") os.environ['DJANGO_SETTINGS_MODULE'] = 'phonebook.settings' #my project name phonebook os.environ['PYTHON_EGG_CACHE'] = '/home/simbairk/.python_egg_cache' #right 775 import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() to create a database and user, I used the following script /home/simbairk/public_html/phonebook/scripts.py #-*-coding:utf-8-*- from django.template.loader import get_template from django.template import Context from django.http import HttpResponse from django.contrib.auth.models import User from django.core.management import call_command import os def init_db(request): call_command('syncdb', interactive=False) t = get_template('index.html') html = t.render(Context({'content':u'База инициализирована'})) return HttpResponse(html) def create_su(request): call_command("createsuperuser", interactive=False, username="simba", email="haha@bugoga.yes") u = User.objects.get(username__exact='simba') u.set_password('simba') u.save() t = get_template('index.html') html = t.render(Context({'content':u'su создан'})) return HttpResponse(html) do not forget to add in url.py anchor in plane: make /adminmake /admin/syncdbblock up the access /initdb /create_su
  3. I found my mistake my view.index not use database but login use... I need to do syncdb
  4. the same problem, need help (host = vcards.heliohost.org) (un = simbairk) set up on this article read forum, tried different boards best of what has made it view.index at http://vcards.heliohost.org/dispatch.wsgi. Links give an error 404 http://vcards.heliohost.org/dispatch.wsgi/500.shtml my public_html/dispatch.wsgi (right 755) import os, sys sys.path.append("/home/simbairk/public_html/") os.environ['DJANGO_SETTINGS_MODULE'] = 'phonebook.settings' os.environ['PYTHON_EGG_CACHE'] = '/home/simbairk/.python_egg_cache' #right 775 import django.core.handlers.wsgi _application = django.core.handlers.wsgi.WSGIHandler() def application(environ, start_response): environ['PATH_INFO'] = environ['SCRIPT_NAME'] + environ['PATH_INFO'] return _application(environ, start_response) my public_html/.htaccess (right 644) RewriteEngine On RewriteBase / RewriteRule ^(dispatch\.wsgi/.*)$ - [L] RewriteRule ^(.*)$ dispatch.wsgi/$1 [QSA,PT,L]
×
×
  • Create New...