Wednesday, September 30, 2015

Re: Corrupted Migration?

On 1/10/2015 1:36 PM, Daniel Chen wrote:
> I have tried that (by the way, the offending migration didn't show up in
> the django_migrations table because the migration failed).
>
> I think we might be talking past each other. Sorry if I'm being unclear.
> Here's an example of what's going on:

You haven't mentioned the Python/Django version. Does ticket
https://code.djangoproject.com/ticket/23226 apply?

>
> 1. Before migration, my database is at state X, and my migrations files
> reflect that.
> 2. I change my model file, updating the state (let's call it state Y).
> Then, I run make migrations, generating a new migration file that
> corresponds to state Y.
> 3. I run the migrate command to get my database to state Y. It fails,
> so now my database is back at state X. There is nothing in the
> database to delete (not even from the django_migrations table)
> because the transaction was rolled back.
> 4. I delete the migration file that corresponds to state Y. My database
> is back in state X, and my migration files again reflect that.
> 5. I run the migrate command again, and it fails (same problem). The
> error is django.db.models.fields.FieldDoesNotExist: [Model] has no
> field named [field].
> 6. [field] corresponds to a new field in state Y, not in an existing
> field in state X. I'm confused - why is it looking for a field that
> doesn't exist in the pre-migrated state (state X)?
> 7. So, I assume that the model state somehow is de-synced from the
> database/migration state. I hop into the Django shell and check the
> model metadata. The fields exactly match state Y. My database is
> still in state X.
>
> Does that make sense?
>
> On Wednesday, September 30, 2015 at 4:10:18 PM UTC-7, Mike Dewhirst wrote:
>
> On 1/10/2015 6:51 AM, Daniel Chen wrote:
> > Thanks for the reply. I should have mentioned that I tried all of
> that:
> > the problem is the model state is ahead of the database state, not
> > behind it. It seems that the database migration was atomic, so
> > everything was rolled back as that transaction failed, but the same
> > thing didn't happen at the model level. So, now I'm stuck with a
> model
> > state that the previous migrations don't capture.
>
> The model is the master. It is outside the transaction and will
> never be
> touched by migrations.
>
> Your task is to identify which previous migration matches the current
> database structure and delete all migrations after that point. That
> means deleting the migration files after the one you identified AND
> deleting the migration records in django_migrations in the database.
>
> Thereafter, the next migration will pick up all the changes in the
> model
> and bring the database back into alignment.
>
> This is all much the same as I said last time so if this doesn't
> work it
> means I haven't understood your problem.
>
> >
> > On Wednesday, September 30, 2015 at 5:08:22 AM UTC-7, Mike
> Dewhirst wrote:
> >
> > Â Â On 30/09/2015 4:16 PM, Daniel Chen wrote:
> > Â Â Â > Hi all,
> > Â Â Â >
> > Â Â Â > A migration I was running (manage.py migrate) died in
> the middle. I
> > Â Â Â > deleted the migration file, fixed the problem (wrong
> default value),
> > Â Â Â > recreated the migration, and re-ran it. But now, I'm
> getting an
> > Â Â Â > inconsistent state (error message: [Model] has no field
> named
> > Â Â [field]).
> > Â Â Â > When I check the database, all the old fields are
> there. However,
> > Â Â when I
> > Â Â Â > hop into a Django shell (manage.py shell) and check the
> model fields
> > Â Â Â > ([Model]._meta.fields), they reflect the new,
> post-migration
> > Â Â state. What
> > Â Â Â > is going on, and how do I fix this?
> >
> > Â Â Do it again. Delete the migration. Take note of the last valid
> > Â Â migration. Open the django_migrations table and delete the
> migration
> > Â Â record(s) after the last valid migration.
> >
> > Â Â makemigrations again and then migrate again to bring the
> database into
> > Â Â line with your models.
> >
> > Â Â BTW, the shell is looking at the model not the database.
> >
> > Â Â Mike
> >
> > Â Â Â >
> > Â Â Â > Thanks!
> > Â Â Â >
> > Â Â Â > --
> > Â Â Â > You received this message because you are subscribed to
> the Google
> > Â Â Â > Groups "Django users" group.
> > Â Â Â > To unsubscribe from this group and stop receiving
> emails from it,
> > Â Â send
> > Â Â Â > an email to django-users...@googlegroups.com <javascript:>
> > Â Â Â > <mailto:django-users+unsubscribe@googlegroups.com
> <javascript:> <javascript:>>.
> > Â Â Â > To post to this group, send email to
> django...@googlegroups.com
> > Â Â <javascript:>
> > Â Â Â > <mailto:django...@googlegroups.com <javascript:>>.
> > Â Â Â > Visit this group at
> http://groups.google.com/group/django-users
> <http://groups.google.com/group/django-users>
> > Â Â <http://groups.google.com/group/django-users
> <http://groups.google.com/group/django-users>>.
> > Â Â Â > To view this discussion on the web visit
> > Â Â Â >
> > Â Â
> https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com>
>
> > Â Â
> <https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com>>
>
> >
> > Â Â Â >
> > Â Â
> <https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com?utm_medium=email&utm_source=footer>
>
> > Â Â
> <https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com?utm_medium=email&utm_source=footer>>>.
>
> >
> > Â Â Â > For more options, visit
> https://groups.google.com/d/optout <https://groups.google.com/d/optout>
> > Â Â <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>>.
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to django-users...@googlegroups.com <javascript:>
> > <mailto:django-users+unsubscribe@googlegroups.com <javascript:>>.
> > To post to this group, send email to django...@googlegroups.com
> <javascript:>
> > <mailto:django...@googlegroups.com <javascript:>>.
> > Visit this group at http://groups.google.com/group/django-users
> <http://groups.google.com/group/django-users>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/559fd3eb-36e4-4ace-a270-3caf1e7fd874%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/559fd3eb-36e4-4ace-a270-3caf1e7fd874%40googlegroups.com>
>
> >
> <https://groups.google.com/d/msgid/django-users/559fd3eb-36e4-4ace-a270-3caf1e7fd874%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/django-users/559fd3eb-36e4-4ace-a270-3caf1e7fd874%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscribe@googlegroups.com
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0ac300f7-0354-4716-bd9b-5552940ae26a%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/0ac300f7-0354-4716-bd9b-5552940ae26a%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/560CAF14.2040802%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

Re: Corrupted Migration?

I have tried that (by the way, the offending migration didn't show up in the django_migrations table because the migration failed).

I think we might be talking past each other. Sorry if I'm being unclear. Here's an example of what's going on:
  1. Before migration, my database is at state X, and my migrations files reflect that.
  2. I change my model file, updating the state (let's call it state Y). Then, I run make migrations, generating a new migration file that corresponds to state Y.
  3. I run the migrate command to get my database to state Y. It fails, so now my database is back at state X. There is nothing in the database to delete (not even from the django_migrations table) because the transaction was rolled back.
  4. I delete the migration file that corresponds to state Y. My database is back in state X, and my migration files again reflect that.
  5. I run the migrate command again, and it fails (same problem). The error is django.db.models.fields.FieldDoesNotExist: [Model] has no field named [field].
  6. [field] corresponds to a new field in state Y, not in an existing field in state X. I'm confused - why is it looking for a field that doesn't exist in the pre-migrated state (state X)?
  7. So, I assume that the model state somehow is de-synced from the database/migration state. I hop into the Django shell and check the model metadata. The fields exactly match state Y. My database is still in state X.
Does that make sense?

On Wednesday, September 30, 2015 at 4:10:18 PM UTC-7, Mike Dewhirst wrote:
On 1/10/2015 6:51 AM, Daniel Chen wrote:
> Thanks for the reply. I should have mentioned that I tried all of that:
> the problem is the model state is ahead of the database state, not
> behind it. It seems that the database migration was atomic, so
> everything was rolled back as that transaction failed, but the same
> thing didn't happen at the model level. So, now I'm stuck with a model
> state that the previous migrations don't capture.

The model is the master. It is outside the transaction and will never be
touched by migrations.

Your task is to identify which previous migration matches the current
database structure and delete all migrations after that point. That
means deleting the migration files after the one you identified AND
deleting the migration records in django_migrations in the database.

Thereafter, the next migration will pick up all the changes in the model
and bring the database back into alignment.

This is all much the same as I said last time so if this doesn't work it
means I haven't understood your problem.

>
> On Wednesday, September 30, 2015 at 5:08:22 AM UTC-7, Mike Dewhirst wrote:
>
>     On 30/09/2015 4:16 PM, Daniel Chen wrote:
>      > Hi all,
>      >
>      > A migration I was running (manage.py migrate) died in the middle. I
>      > deleted the migration file, fixed the problem (wrong default value),
>      > recreated the migration, and re-ran it. But now, I'm getting an
>      > inconsistent state (error message: [Model] has no field named
>     [field]).
>      > When I check the database, all the old fields are there. However,
>     when I
>      > hop into a Django shell (manage.py shell) and check the model fields
>      > ([Model]._meta.fields), they reflect the new, post-migration
>     state. What
>      > is going on, and how do I fix this?
>
>     Do it again. Delete the migration. Take note of the last valid
>     migration. Open the django_migrations table and delete the migration
>     record(s) after the last valid migration.
>
>     makemigrations again and then migrate again to bring the database into
>     line with your models.
>
>     BTW, the shell is looking at the model not the database.
>
>     Mike
>
>      >
>      > Thanks!
>      >
>      > --
>      > You received this message because you are subscribed to the Google
>      > Groups "Django users" group.
>      > To unsubscribe from this group and stop receiving emails from it,
>     send
>      > an email to django-users...@googlegroups.com <javascript:>
>      > <mailto:django-users+unsubscribe@googlegroups.com <javascript:>>.
>      > To post to this group, send email to django...@googlegroups.com
>     <javascript:>
>      > <mailto:django...@googlegroups.com <javascript:>>.
>      > Visit this group at http://groups.google.com/group/django-users
>     <http://groups.google.com/group/django-users>.
>      > To view this discussion on the web visit
>      >
>     https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com
>     <https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com>
>
>      >
>     <https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com?utm_medium=email&utm_source=footer
>     <https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>      > For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/559fd3eb-36e4-4ace-a270-3caf1e7fd874%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/559fd3eb-36e4-4ace-a270-3caf1e7fd874%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0ac300f7-0354-4716-bd9b-5552940ae26a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Corrupted Migration?

On 1/10/2015 6:51 AM, Daniel Chen wrote:
> Thanks for the reply. I should have mentioned that I tried all of that:
> the problem is the model state is ahead of the database state, not
> behind it. It seems that the database migration was atomic, so
> everything was rolled back as that transaction failed, but the same
> thing didn't happen at the model level. So, now I'm stuck with a model
> state that the previous migrations don't capture.

The model is the master. It is outside the transaction and will never be
touched by migrations.

Your task is to identify which previous migration matches the current
database structure and delete all migrations after that point. That
means deleting the migration files after the one you identified AND
deleting the migration records in django_migrations in the database.

Thereafter, the next migration will pick up all the changes in the model
and bring the database back into alignment.

This is all much the same as I said last time so if this doesn't work it
means I haven't understood your problem.

>
> On Wednesday, September 30, 2015 at 5:08:22 AM UTC-7, Mike Dewhirst wrote:
>
> On 30/09/2015 4:16 PM, Daniel Chen wrote:
> > Hi all,
> >
> > A migration I was running (manage.py migrate) died in the middle. I
> > deleted the migration file, fixed the problem (wrong default value),
> > recreated the migration, and re-ran it. But now, I'm getting an
> > inconsistent state (error message: [Model] has no field named
> [field]).
> > When I check the database, all the old fields are there. However,
> when I
> > hop into a Django shell (manage.py shell) and check the model fields
> > ([Model]._meta.fields), they reflect the new, post-migration
> state. What
> > is going on, and how do I fix this?
>
> Do it again. Delete the migration. Take note of the last valid
> migration. Open the django_migrations table and delete the migration
> record(s) after the last valid migration.
>
> makemigrations again and then migrate again to bring the database into
> line with your models.
>
> BTW, the shell is looking at the model not the database.
>
> Mike
>
> >
> > Thanks!
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to django-users...@googlegroups.com <javascript:>
> > <mailto:django-users+unsubscribe@googlegroups.com <javascript:>>.
> > To post to this group, send email to django...@googlegroups.com
> <javascript:>
> > <mailto:django...@googlegroups.com <javascript:>>.
> > Visit this group at http://groups.google.com/group/django-users
> <http://groups.google.com/group/django-users>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com>
>
> >
> <https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscribe@googlegroups.com
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/559fd3eb-36e4-4ace-a270-3caf1e7fd874%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/559fd3eb-36e4-4ace-a270-3caf1e7fd874%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/560C6B9A.9050009%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

Re: can't find static file

Also, your error indicates that your URL request is using the 'image' directory, not 'images', which doesn't match your directory structure.

-James

On Sep 30, 2015 2:15 PM, "José Javier Castro Matamoros" <el4tomo@gmail.com> wrote:
Hi Gary. Did you read the section Serving static files during development. If you don't maybe this happen because you didn't add this code in the project/urls.py.
rom django.conf import settings  from django.conf.urls.static import static    urlpatterns = patterns('',      # ... the rest of your URLconf goes here ...  ) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
I hope this help you.

On Wed, Sep 30, 2015 at 3:02 PM, Gary Roach <gary719_list1@verizon.net> wrote:
Hi all;

Stats:
Debian Linux 8 (jessie)
python = 2.7.9
Django 1.7 (To match tutorial)
sqlite data base
Using virtualenv

I'm working my way through the Tango With Rango tutorial and have hit a snag. I added the static/images directory and put in a jpg photo for data. The system can't find the file. I've tried the usual python manage.py runserver and then used /127.0.0.1:8000/static/images/P1000153.JPG which produces:

        Request Method:         GET
        Request URL:    http://127.0.0.1:8000/static/image/P1000153.JPG

        'image/P1000153.JPG' could not be found

I tried the python manage.py findstatic. Same results. Below are my project tree and my settings.py file. Probably a stupid error but I can't find it.

├── db.sqlite3
├── __init__.py
├── manage.py
├── rango
│   ├── admin.py
│   ├── admin.pyc
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── migrations
│   │   ├── __init__.py
│   │   └── __init__.pyc
│   ├── models.py
│   ├── models.pyc
│   ├── tests.py
│   ├── urls.py
│   ├── urls.pyc
│   ├── views.py
│   └── views.pyc
├── static
│   ├── images
│   │   ├── __init__.py
│   │   └── P1000153.JPG
│   └── __init__.py
├── templates
│   ├── __init__.py
│   └── rango
│       ├── index.html
│       └── __init__.py
├── twr_project
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── settings.py
│   ├── settings.pyc
│   ├── urls.py
│   ├── urls.pyc
│   ├── wsgi.py
│   └── wsgi.pyc
└── twr_project.nja

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

BASE_DIR = os.path.dirname(os.path.dirname(__file__))
TEMPLATE_PATH = os.path.join(BASE_DIR, 'templates')

# 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 = 'u^y3v@)p)9m#z^1z194r$r$g%*(@v)@+@72uu#bu8&b2=!mpv$'

# 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',
    'rango',
)

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 = 'twr_project.urls'

WSGI_APPLICATION = 'twr_project.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 = 'America/Los_Angeles'

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_PATH = os.path.join(BASE_DIR, 'static/')

STATIC_URL = '/static/'

SATATICFILES_DIRS = (
    STATIC_PATH,
    )
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or
    # "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    TEMPLATE_PATH,
)




Thanks in advance

Gary R.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/560C4DCA.20205%40verizon.net.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKO0OsbUvmd%2BoDXJCtq-hcCJOzae8W_VtGhC%3DAidvSaz9a07Lw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciUje3%2B9u9ii-Ao2oar543uycuadZuB2WhA70%3DnGXY5gXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: can't find static file

Hi Gary. Did you read the section Serving static files during development. If you don't maybe this happen because you didn't add this code in the project/urls.py.
rom django.conf import settings  from django.conf.urls.static import static    urlpatterns = patterns('',      # ... the rest of your URLconf goes here ...  ) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
I hope this help you.

On Wed, Sep 30, 2015 at 3:02 PM, Gary Roach <gary719_list1@verizon.net> wrote:
Hi all;

Stats:
Debian Linux 8 (jessie)
python = 2.7.9
Django 1.7 (To match tutorial)
sqlite data base
Using virtualenv

I'm working my way through the Tango With Rango tutorial and have hit a snag. I added the static/images directory and put in a jpg photo for data. The system can't find the file. I've tried the usual python manage.py runserver and then used /127.0.0.1:8000/static/images/P1000153.JPG which produces:

        Request Method:         GET
        Request URL:    http://127.0.0.1:8000/static/image/P1000153.JPG

        'image/P1000153.JPG' could not be found

I tried the python manage.py findstatic. Same results. Below are my project tree and my settings.py file. Probably a stupid error but I can't find it.

├── db.sqlite3
├── __init__.py
├── manage.py
├── rango
│   ├── admin.py
│   ├── admin.pyc
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── migrations
│   │   ├── __init__.py
│   │   └── __init__.pyc
│   ├── models.py
│   ├── models.pyc
│   ├── tests.py
│   ├── urls.py
│   ├── urls.pyc
│   ├── views.py
│   └── views.pyc
├── static
│   ├── images
│   │   ├── __init__.py
│   │   └── P1000153.JPG
│   └── __init__.py
├── templates
│   ├── __init__.py
│   └── rango
│       ├── index.html
│       └── __init__.py
├── twr_project
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── settings.py
│   ├── settings.pyc
│   ├── urls.py
│   ├── urls.pyc
│   ├── wsgi.py
│   └── wsgi.pyc
└── twr_project.nja

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

BASE_DIR = os.path.dirname(os.path.dirname(__file__))
TEMPLATE_PATH = os.path.join(BASE_DIR, 'templates')

# 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 = 'u^y3v@)p)9m#z^1z194r$r$g%*(@v)@+@72uu#bu8&b2=!mpv$'

# 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',
    'rango',
)

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 = 'twr_project.urls'

WSGI_APPLICATION = 'twr_project.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 = 'America/Los_Angeles'

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_PATH = os.path.join(BASE_DIR, 'static/')

STATIC_URL = '/static/'

SATATICFILES_DIRS = (
    STATIC_PATH,
    )
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or
    # "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    TEMPLATE_PATH,
)




Thanks in advance

Gary R.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/560C4DCA.20205%40verizon.net.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKO0OsbUvmd%2BoDXJCtq-hcCJOzae8W_VtGhC%3DAidvSaz9a07Lw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

can't find static file

Hi all;

Stats:
Debian Linux 8 (jessie)
python = 2.7.9
Django 1.7 (To match tutorial)
sqlite data base
Using virtualenv

I'm working my way through the Tango With Rango tutorial and have hit a
snag. I added the static/images directory and put in a jpg photo for
data. The system can't find the file. I've tried the usual python
manage.py runserver and then used
/127.0.0.1:8000/static/images/P1000153.JPG which produces:

Request Method: GET
Request URL: http://127.0.0.1:8000/static/image/P1000153.JPG

'image/P1000153.JPG' could not be found

I tried the python manage.py findstatic. Same results. Below are my
project tree and my settings.py file. Probably a stupid error but I
can't find it.

├── db.sqlite3
├── __init__.py
├── manage.py
├── rango
│ ├── admin.py
│ ├── admin.pyc
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── migrations
│ │ ├── __init__.py
│ │ └── __init__.pyc
│ ├── models.py
│ ├── models.pyc
│ ├── tests.py
│ ├── urls.py
│ ├── urls.pyc
│ ├── views.py
│ └── views.pyc
├── static
│ ├── images
│ │ ├── __init__.py
│ │ └── P1000153.JPG
│ └── __init__.py
├── templates
│ ├── __init__.py
│ └── rango
│ ├── index.html
│ └── __init__.py
├── twr_project
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── settings.py
│ ├── settings.pyc
│ ├── urls.py
│ ├── urls.pyc
│ ├── wsgi.py
│ └── wsgi.pyc
└── twr_project.nja

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

BASE_DIR = os.path.dirname(os.path.dirname(__file__))
TEMPLATE_PATH = os.path.join(BASE_DIR, 'templates')

# 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 = 'u^y3v@)p)9m#z^1z194r$r$g%*(@v)@+@72uu#bu8&b2=!mpv$'

# 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',
'rango',
)

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 = 'twr_project.urls'

WSGI_APPLICATION = 'twr_project.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 = 'America/Los_Angeles'

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_PATH = os.path.join(BASE_DIR, 'static/')

STATIC_URL = '/static/'

SATATICFILES_DIRS = (
STATIC_PATH,
)
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or
# "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
TEMPLATE_PATH,
)




Thanks in advance

Gary R.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/560C4DCA.20205%40verizon.net.
For more options, visit https://groups.google.com/d/optout.

Re: upload zip or rar files


FYI,
it works if the zip or the rar files were generated in windows,

not if they come from Linux =(...




On Tuesday, September 29, 2015 at 1:41:27 PM UTC-5, dk wrote:
I set up a form to upload files,  and every thing works fine,   the only problem is when I am in the webpage and I click the button to choose the file I want to upload doesn't show or zips, or rars.  I try playing with the input tag accept, from all the type of zips,  to leave it open to upload what ever file.

I try it in Firefox, chrome and IE,   I am missing something?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9a74257b-36b1-47dc-a7d1-47532373960e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Corrupted Migration?

Thanks for the reply. I should have mentioned that I tried all of that: the problem is the model state is ahead of the database state, not behind it. It seems that the database migration was atomic, so everything was rolled back as that transaction failed, but the same thing didn't happen at the model level. So, now I'm stuck with a model state that the previous migrations don't capture.

On Wednesday, September 30, 2015 at 5:08:22 AM UTC-7, Mike Dewhirst wrote:
On 30/09/2015 4:16 PM, Daniel Chen wrote:
> Hi all,
>
> A migration I was running (manage.py migrate) died in the middle. I
> deleted the migration file, fixed the problem (wrong default value),
> recreated the migration, and re-ran it. But now, I'm getting an
> inconsistent state (error message: [Model] has no field named [field]).
> When I check the database, all the old fields are there. However, when I
> hop into a Django shell (manage.py shell) and check the model fields
> ([Model]._meta.fields), they reflect the new, post-migration state. What
> is going on, and how do I fix this?

Do it again. Delete the migration. Take note of the last valid
migration. Open the django_migrations table and delete the migration
record(s) after the last valid migration.

makemigrations again and then migrate again to bring the database into
line with your models.

BTW, the shell is looking at the model not the database.

Mike

>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/95f33338-c53b-497d-8dcd-a4c1e444b5c4%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/559fd3eb-36e4-4ace-a270-3caf1e7fd874%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: csrf token


On Wed, Sep 30, 2015 at 5:18 PM, Larry Martell <larry.martell@gmail.com> wrote:
On Wed, Sep 30, 2015 at 4:15 PM, Bhanu Kathuria
<001kathuriabhanu@gmail.com> wrote:
> What is the use of csrf token in forms?

http://lmgtfy.com/?q=CSRF

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACwCsY6bxPs%3DkNa3N-uybpmbzKt-apQbpuy2bf-dSywg9b4aLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Ezequiel Bertti
E-Mail: ebertti@gmail.com
Cel: (21) 99188-4860

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACrQMYqZVheS03_yPh%2BO7hQrk8nifbYnz_R4iNd_bCkRAGpfOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: csrf token

On Wed, Sep 30, 2015 at 4:15 PM, Bhanu Kathuria
<001kathuriabhanu@gmail.com> wrote:
> What is the use of csrf token in forms?

http://lmgtfy.com/?q=CSRF

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACwCsY6bxPs%3DkNa3N-uybpmbzKt-apQbpuy2bf-dSywg9b4aLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

csrf token

What is the use of csrf token in forms?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/81d7ed39-15a7-46a9-b649-772ca66dd45c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Admin: Unknown fields

Hello Florian Schweikert,

Thank you. The  commas (',')   were the problem. Consider this user-issue closed.
Great place to learn

Thanks to  all.
Rjae


On Monday, September 28, 2015 at 6:56:42 PM UTC-4, Rolston Jeremiah wrote:
Hello,

I am new to Python and Django so please bear with me.

I have  created a model(below) and would now like to access 
from the admin interface. As per instructions  I found on the 
django site (Part 2 tutorial version 1.8.4) 


model
///////////////////////////////////////////////////////////////////////////////////////////////////////

class Genus(models.Model):
genus_id = models.AutoField(primary_key=True),
scientific_genus = models.CharField(max_length=32),
common_name = models.CharField(max_length=32),
common_examples = models.TextField(),
genus_choices = (
('Member Banana...','Musa'),
('Mango...','Magnifera'),
('Avocado...','Persea Americana'),
('Soursop, Custard, Sugar Apple...','Annona Reticulata'),
('Ginger, Tumeric ...','Zingiber Officinale Roscoe'),
('Persimmon....','Diospyros'),
('Breadfruit...','Artocarpus Altilis'),
('Cherry ...','Prunus'),
('Grapes ...','Vitis'), 
('Tomato ...','Lycopersicon'), 
('EggPlant ...','????????'), 
('Onion, Garlic ...','Allium'),
('Cashew ...','Anacardium'),
('Rice ...','Oryza'),
('Pepper ...','Capsicum'),
('Orange,Lemon, Lime ....','Citrus')
),
image_url = models.CharField(max_length=128),
genus = models.CharField(max_length=32,choices=genus_choices),
description = models.TextField()


I edit  "admin.py"  so that it now looks like


admin.py
//////////////////////////////////////////////////////////////////////////////////////////////////

from django.contrib import admin
from cfxBase.models import Genus
# Register your models here.


class GenusAdmin(admin.ModelAdmin):
    fields = [
               'genus',
               'scientific_genus',
               'common_name',
               'description',
               'common_examples',
               'image_url'
    ]
    
admin.site.register(Genus, GenusAdmin)


////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Now when I attempt the admin page add entry  for Genus I am getting this 
error:


FieldError at /admin/cfxBase/genus/add/

Unknown field(s) (scientific_genus, genus, common_name, common_examples, 
                  description, image_url) specified for Genus. 

Check fields/fieldsets/exclude attributes of class GenusAdmi


Your help will be  greatly appreciated









--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a3633dcb-2bf9-4bce-afa2-596058e16932%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: E-commerce

Thanks Ezequiel!  I'll check it out.



Paul




On Sun, Sep 27, 2015 at 12:44 PM, Ezequiel Bertti <ebertti@gmail.com> wrote:

On Fri, Sep 25, 2015 at 8:59 PM, Paul Savignano <paul.savignano@gmail.com> wrote:
Thanks luisza14 !

On Thursday, September 24, 2015 at 1:30:46 PM UTC-7, luisza14 wrote:

2015-09-24 13:42 GMT-06:00 Paul Savignano <paul.savignano@gmail.com>:
Hi Django-users,
I am somewhat new to Django and have a client interested in an online store/e-commerce for their foodservice operation. 
Are there any tutorials you can recommend on this subject?

Thanks in advance for any help you may offer!


Paul



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMbaZQ0fRXCH71vr2YdcUeAHqb%3DKrNgB4cUPwc7Mb0_Ej%2BJ0aQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
"La utopía sirve para caminar" Fernando Birri


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bb8f0be7-a929-4b96-bfae-9908dd6cc0cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Ezequiel Bertti
E-Mail: ebertti@gmail.com
Cel: (21) 99188-4860

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/bllfmz3U4I4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACrQMYp%2BwnCy6P59vBT9ksQitvC2FJFNvvs%2BBL2C3LYpjCVTkQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMbaZQ22uZK85yuNk_h%2BUE-Z5oC6JVOVTJ%2B1V50A%3DUhAJLb-0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Foriegn key error--> no such column: eduplus_choice.question_id

Thank you . I found the solution to my problem.I didn't use syncdb command before applying foriegn key.

On Wed, Sep 30, 2015 at 9:43 PM, Gergely Polonkai <gergely@polonkai.eu> wrote:

Did you run your migrations?

On 30 Sep 2015 15:35, "Bhanu Kathuria" <001kathuriabhanu@gmail.com> wrote:
Settings,admin and model file are attached.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c0e69bbe-9e7c-4642-ac2f-5092e7bd0d70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/9ewmQ-5ef0k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACczBULQfHohtzLJKp-N%2B%3D%3DKv4f6V7whUPuBOgKXYbrfNBdGAw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BOBCFW0GPYrb348Uck_RR93vjd%3DCg0ZEdv7SQpLy9HG%2BLccRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Foriegn key error--> no such column: eduplus_choice.question_id

Did you run your migrations?

On 30 Sep 2015 15:35, "Bhanu Kathuria" <001kathuriabhanu@gmail.com> wrote:
Settings,admin and model file are attached.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c0e69bbe-9e7c-4642-ac2f-5092e7bd0d70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACczBULQfHohtzLJKp-N%2B%3D%3DKv4f6V7whUPuBOgKXYbrfNBdGAw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Foreign key in sqlite3

Assuming you are using Django and it's ORM, the same way as in any other database:

fieldname = models.ForeignKey(AnotherModel)

On 30 Sep 2015 15:18, "Bhanu Kathuria" <001kathuriabhanu@gmail.com> wrote:
    I am using sqlite3 database.
How can I add foreign key between two tables.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/56c957c9-6b03-4c19-9566-9a63cdbf8319%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACczBUKyATKexddYKEMhKyg4SpywuyZ7uMxDK5HMXxadQV7vLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.