lino-framework/lino

python manage.py initdb_demo not work

kartikdanidhariya opened this issue · 4 comments

my pip freeze is

Babel==1.3
Django==1.7.1
Jinja2==2.7.3
MarkupSafe==0.23
North==0.1.7
PyYAML==3.11
Pygments==2.0.1
Sphinx==1.2.3
Unipath==1.0
appy==0.9.1
argparse==1.2.1
atelier==0.0.3
djangosite==0.1.8
docutils==0.12
lino==1.6.13
odfpy==0.9.6
python-dateutil==2.3
pytidylib==0.2.3
pytz==2014.10
six==1.8.0
wsgiref==0.1.2

i follow tutorial from https://lino.readthedocs.org/en/latest/tutorials/polls/mysite/index.html
in that i am not understand where i put
The main index after i put in templates/index.html
part in my project
Also in "Adding a demo fixture" part this link "Download the file polls/fixtures/demo.py" is return 404
after i search and get following code for demo.py is

from lino import dd

Poll = dd.resolve_model('polls.Poll')
Choice = dd.resolve_model('polls.Choice')

DATA = """
What is your preferred colour? | Blue | Red | Yellow | other
Do you like Django? | Yes | No | Not yet decided
Do you like ExtJS? | Yes | No | Not yet decided
"""

def objects():
for ln in DATA.splitlines():
if ln:
a = ln.split('|')
p = Poll(question=a[0].strip())
yield p
for choice in a[1:]:
yield Choice(choice=choice.strip(),poll=p)

AFter when i am run python manage.py initdb demo (it doc its like "python manange.py initdb demo")so it return
Unknown command: 'initdb'
Type 'manage.py help' for usage.
so how can i solve pls help!!!
Thank in advance!!!!

  1. The documentation at readthedocs.org is not up to date, please read
    it at lino-framework.org:

http://www.lino-framework.org/tutorials/polls/mysite/index.html

  1. I didn't release Lino to PyPI for quite some time now. Please use the
    development version. Start reading tutorials here:

http://www.lino-framework.org/tutorials/index.html

My apologies for the inconveniences (is there anybody here willing to
help me to get the docs build on readthedocs.org?)

Luc

On 03/12/14 13:00, kartikdanidhariya wrote:

my pip freeze is

Babel==1.3
Django==1.7.1
Jinja2==2.7.3
MarkupSafe==0.23
North==0.1.7
PyYAML==3.11
Pygments==2.0.1
Sphinx==1.2.3
Unipath==1.0
appy==0.9.1
argparse==1.2.1
atelier==0.0.3
djangosite==0.1.8
docutils==0.12
lino==1.6.13
odfpy==0.9.6
python-dateutil==2.3
pytidylib==0.2.3
pytz==2014.10
six==1.8.0
wsgiref==0.1.2

i follow tutorial from
https://lino.readthedocs.org/en/latest/tutorials/polls/mysite/index.html
in that i am not understand where i put
The main index
part in my project
Also in "Adding a demo fixture" part this link "Download the file
polls/fixtures/demo.py" is return 404
after i search and get following code for demo.py is

from lino import dd

Poll = dd.resolve_model('polls.Poll')
Choice = dd.resolve_model('polls.Choice')

DATA = """
What is your preferred colour? | Blue | Red | Yellow | other
Do you like Django? | Yes | No | Not yet decided
Do you like ExtJS? | Yes | No | Not yet decided
"""

def objects():
for ln in DATA.splitlines():
if ln:
a = ln.split('|')
p = Poll(question=a[0].strip())
yield p
for choice in a[1:]:
yield Choice(choice=choice.strip(),poll=p)

AFter when i am run python manange.py initdb demo so it return
Unknown command: 'initdb_demo'
Type 'manage.py help' for usage.
so how can i solve pls help!!!
Thank in advance!!!!


Reply to this email directly or view it on GitHub
https://github.com/lsaffre/lino/issues/23.

Thanks for reply

I follow doc instructions but,
when i ckeck for

python manage.py shell

and then enter

from django.conf import settings
settings.INSTALLED_APPS
it shows
('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'polls')

it not shows ('lino.modlib.about', 'lino.modlib.extjs', 'lino.modlib.bootstrap3', 'lino', 'polls', 'north', 'djangosite')

my setting.py is

"""
Django settings for mysite2 project.

For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""

Build paths inside the project like this: os.path.join(BASE_DIR, ...)

import os
from lino.projects.std.settings import *
SITE = Site(globals(), 'polls', title="Cool Polls")

your local settings here

#DEBUG = True
BASE_DIR = os.path.dirname(os.path.dirname(file))

Quick-start development settings - unsuitable for production

See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/

SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = 'f^$fhl4o8g66u2wbh*rrwv6-!-k6pf!ude4_u$g4whmrquew!w'

SECURITY WARNING: don't run with debug turned on in production!

DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = []

Application definition

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'polls',
)

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'mysite2.urls'

WSGI_APPLICATION = 'mysite2.wsgi.application'

Database

https://docs.djangoproject.com/en/1.7/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}

Internationalization

https://docs.djangoproject.com/en/1.7/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

Static files (CSS, JavaScript, Images)

https://docs.djangoproject.com/en/1.7/howto/static-files/

STATIC_URL = '/static/'

ALso it give error in models.py for

File "/home/keyur/lino/mysite2/polls/models.py", line 28, in
from lino import dd, rt
ImportError: cannot import name rt

and also for pub_date = models.DateTimeField('Date published', default=dd.today)
so how can i solve that
pls help!!!

Remove everything from your settings.py file below the line:

SITE = Site(globals(), 'polls', title="Cool Polls")

(except maybe for some settings like DATABASES and DEBUG)

Luc

On 03/12/14 15:11, kartikdanidhariya wrote:

I follow doc instructions but,
when i ckeck for
python manage.py shell
and then enter

        from django.conf import settings
        settings.INSTALLED_APPS
        it shows
        ('django.contrib.admin', 'django.contrib.auth',
        'django.contrib.contenttypes', 'django.contrib.sessions',
        'django.contrib.messages', 'django.contrib.staticfiles',
        'polls')

it not shows ('lino.modlib.about', 'lino.modlib.extjs',
'lino.modlib.bootstrap3', 'lino', 'polls', 'north', 'djangosite')

my setting.py is

"""
Django settings for mysite2 project.

For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""

Build paths inside the project like this: os.path.join(BASE_DIR, ...)

import os
from lino.projects.std.settings import *
SITE = Site(globals(), 'polls', title="Cool Polls")

your local settings here

#DEBUG = True
BASE_DIR = os.path.dirname(os.path.dirname(file))

Quick-start development settings - unsuitable for production

See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/

SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = 'f^$fhl4o8g66u2wbh*rrwv6-!-k6pf!ude4_u$g4whmrquew!w'

SECURITY WARNING: don't run with debug turned on in production!

DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = []

Application definition

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'polls',
)

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'mysite2.urls'

WSGI_APPLICATION = 'mysite2.wsgi.application'

Database

https://docs.djangoproject.com/en/1.7/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}

Internationalization

https://docs.djangoproject.com/en/1.7/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

Static files (CSS, JavaScript, Images)

https://docs.djangoproject.com/en/1.7/howto/static-files/

STATIC_URL = '/static/'

ALso it give error in models.py for

File "/home/keyur/lino/mysite2/polls/models.py", line 28, in
from lino import dd, rt
ImportError: cannot import name rt

and also for pub_date = models.DateTimeField('Date published',
default=dd.today)
so how can i solve that
pls help!!!


Reply to this email directly or view it on GitHub
https://github.com/lsaffre/lino/issues/23#issuecomment-65404305.