Hello, I have manage to merge mine application to pythonanywhere.com. After I have done all the needed installing, uploading files, collecting static, making migrations to mine django application, I have experienced an OperationError saying:
no such table: django_session
Generally this happens when you don't apply the initial migration. Have you run 'python manage.py migrate' (assuming Django >= 1.7 since you mentioned making migrations) and if you have, what was the output? If you aren't sure, run it again as it shouldn't hurt anything.
Check your database and make sure that the tables actually exist. If not, and there is no production data (assuming not based on the question), drop and recreate the DB to clear out any previously failed migration attempts and apply your migrations again using the command I specified. Capture the entire output of the command and paste it back to this list so that we can help more.
-James
--
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.
To post to this group, send email to 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/01f5c13c-5b7e-40ea-b98b-e37640e477df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
python manage.py sqlflush
python manage.py syncdb python manage.py migrate
Environment:
Request Method: GET
Request URL: http://copser.pythonanywhere.com/
Django Version: 1.7.2
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'profiles',
'crispy_forms',
'django.contrib.sites',
'allauth',
'allauth.account',
'stripe')
Installed Middleware:
('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')
Template error:
In template /home/copser/static/templates/home.html, error at line 40
no such table: django_session
30 :
31 : {% block content %}
32 : <div class="row" style="margin-top: 60px">
33 : <div class="col-md-4">
34 :
35 : </div>
36 : <div class="col-md-4">
37 : {# <a href="#"> <img class="img-responsive img-rounded" src="{% static 'img/07.jpg' %}"/> </a> #}
38 : </div>
39 : <div class="col-md-4">
40 : {% if request.user.is_authenticated %}
41 : <h3>Hello {{ request.user }}</h3>
42 : {% else %}
43 : <form class="login" method="POST" action="{% url 'account_login' %}">
44 : <input type="hidden" name="csrfmiddlewaretoken" value="sczg1f8U4tWQRa8kgNJC1QsSBKAD9Lvw"> {% csrf_token %}
45 : <div id="div_id_login" class="form-group"><label for="id_login" class="control-label requiredField">
46 : Login<span class="asteriskField">*</span></label><div class="controls "><input autofocus="autofocus" class="textinput textInput form-control" id="id_login" name="login" placeholder="Username or e-mail" type="text"> </div></div><div id="div_id_password" class="form-group"><label for="id_password" class="control-label requiredField">
47 : Password<span class="asteriskField">*</span></label><div class="controls "><input class="textinput textInput form-control" id="id_password" name="password" placeholder="Password" type="password"> </div></div><div class="form-group"><div id="div_id_remember" class="checkbox"><label for="id_remember" class=""><input class="checkboxinput checkbox" id="id_remember" name="remember" type="checkbox">
48 : Remember Me
49 : </label>
50 : </div>
Traceback:
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/copser/mineDjango/profiles/views.py" in home
7. return render(request, template, context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/shortcuts.py" in render
48. return HttpResponse(loader.render_to_string(*args, **kwargs),
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
174. return t.render(context_instance)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/base.py" in render
148. return self._render(context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/base.py" in _render
142. return self.nodelist.render(context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/base.py" in render
844. bit = self.render_node(node, context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
80. return node.render(context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
126. return compiled_parent._render(context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/base.py" in _render
142. return self.nodelist.render(context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/base.py" in render
844. bit = self.render_node(node, context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
80. return node.render(context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
65. result = block.nodelist.render(context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/base.py" in render
844. bit = self.render_node(node, context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
80. return node.render(context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/defaulttags.py" in render
305. match = condition.eval(context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/defaulttags.py" in eval
898. return self.value.resolve(context, ignore_failures=True)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/base.py" in resolve
596. obj = self.var.resolve(context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/base.py" in resolve
734. value = self._resolve_lookup(context)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/template/base.py" in _resolve_lookup
764. current = current[bit]
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/utils/functional.py" in inner
224. self._setup()
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/utils/functional.py" in _setup
357. self._wrapped = self._setupfunc()
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/contrib/auth/middleware.py" in <lambda>
22. request.user = SimpleLazyObject(lambda: get_user(request))
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/contrib/auth/middleware.py" in get_user
10. request._cached_user = auth.get_user(request)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py" in get_user
152. user_id = request.session[SESSION_KEY]
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py" in __getitem__
49. return self._session[key]
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py" in _get_session
175. self._session_cache = self.load()
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/contrib/sessions/backends/db.py" in load
21. expire_date__gt=timezone.now()
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/models/manager.py" in manager_method
92. return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/models/query.py" in get
351. num = len(clone)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/models/query.py" in __len__
122. self._fetch_all()
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/models/query.py" in _fetch_all
966. self._result_cache = list(self.iterator())
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/models/query.py" in iterator
265. for row in compiler.results_iter():
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in results_iter
700. for rows in self.execute_sql(MULTI):
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
786. cursor.execute(sql, params)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
81. return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/utils.py" in __exit__
94. six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
65. return self.cursor.execute(sql, params)
File "/home/copser/.virtualenvs/django17/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py" in execute
485. return Database.Cursor.execute(self, query, params)
Exception Type: OperationalError at /
Exception Value: no such table: django_session
Hello James, will do but I am not at mine lap top atm, gona do it as soon as posible, tank you very much.
On Saturday, February 28, 2015, James Schneider <jrschn...@gmail.com> wrote:
> Generally this happens when you don't apply the initial migration. Have you run 'python manage.py migrate' (assuming Django >= 1.7 since you mentioned making migrations) and if you have, what was the output? If you aren't sure, run it again as it shouldn't hurt anything.
>
> Check your database and make sure that the tables actually exist. If not, and there is no production data (assuming not based on the question), drop and recreate the DB to clear out any previously failed migration attempts and apply your migrations again using the command I specified. Capture the entire output of the command and paste it back to this list so that we can help more.
>
> -James
>
> On Feb 27, 2015 10:02 PM, "Petar Pilipovic" <iam...@gmail.com> wrote:
>>
>> Hello, I have manage to merge mine application to pythonanywhere.com. After I have done all the needed installing, uploading files, collecting static, making migrations to mine django application, I have experienced an OperationError saying:
>>
>> no such table: django_session
>> You can find the rest of mine question here on stackoverflow, Can someone help me over come this error, tank you.
>>
>>
>> --
>> 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...@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/01f5c13c-5b7e-40ea-b98b-e37640e477df%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/MOsaEEDNyQg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
>> To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
>> To post to this group, send email to 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/01f5c13c-5b7e-40ea-b98b-e37640e477df%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/MOsaEEDNyQg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c0a5d4c5-73a7-40b5-9d88-ec8d4c8694fe%40googlegroups.com.
Heh, lol, Ok tax Collin I will do that. I was thinking that i need to delete mine migration from the terminal, but I will try that, tnx
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f4d46b92-b5f7-43dc-8be1-db87e3e6ac39%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAG%2B5VyMXrSgjpTQw6uYoUEVimyacQuYKrzUCpiYumUgCRsgGVw%40mail.gmail.com.