These are chat archives for django/django

15th
Apr 2016
samkurma
@samkurma
Apr 15 2016 03:50
I am getting this error while sending email: "GET /static/shared/mixins HTTP/1.1" 404
could u please give me any idea
Puneet Aggarwal
@puneetagg
Apr 15 2016 16:01
@samkurma No idea. Try posting on SO.
Hi everyone..
I need some help getting around this issue.. omab/python-social-auth#617
Shakib Hossain
@shakib609
Apr 15 2016 16:30
Decorators are really confusing me.
Any suggestions or resources?
:worried:
Michal Haták
@Twista
Apr 15 2016 16:30
practice :D
gmwill92
@gmwill92
Apr 15 2016 16:39
Does anyone know how can I create dynamic several widgets from Models? Like this
Ryan Moore
@xHeliotrope
Apr 15 2016 16:41
is it possible to do a data migration to turn a textfield into a foreign key relationship for a table that already exists?
gmwill92
@gmwill92
Apr 15 2016 16:47
btcs.jpg
Filip Figiel
@megapctr
Apr 15 2016 17:35
@gmwill92 you have to be much more specific
@ryanho you have to do two migrations - first for the schema, second for the data
Puneet Aggarwal
@puneetagg
Apr 15 2016 17:38
@megapctr Please have a look at my issue above. Stuck with it from couple of days.
Filip Figiel
@megapctr
Apr 15 2016 17:40
Have you tried installing this library?
Since this is a problem with a Django app, and not django itself, I figured you'd get support from other sources
Puneet Aggarwal
@puneetagg
Apr 15 2016 17:41
Yes, I have installed it.
Yes, I know that. I tried raising issue on github and posted same on SO. But, got not much response. So thought may be anyone here can help.
Filip Figiel
@megapctr
Apr 15 2016 17:43
requests>=2.5.1
O you have that installed? Check the output of pip freeze
Puneet Aggarwal
@puneetagg
Apr 15 2016 17:43
requests==2.9.1
Filip Figiel
@megapctr
Apr 15 2016 17:43
*do (sorry, I'm on a phone)
Puneet Aggarwal
@puneetagg
Apr 15 2016 17:43
this if from freeze ouput
*output
Filip Figiel
@megapctr
Apr 15 2016 17:44
What about the version of this django app? Is it up to date?
Puneet Aggarwal
@puneetagg
Apr 15 2016 17:45
This message was deleted
This message was deleted
This message was deleted
let me check..
yes its...2.9.1
Filip Figiel
@megapctr
Apr 15 2016 17:47
Low battery, I'll be back later
Puneet Aggarwal
@puneetagg
Apr 15 2016 17:48
Its okay.. Thanks
Kiran Kumar Chaudhary
@chaudharykiran
Apr 15 2016 18:28
I want to use django-braces to check LoginRequiredMixin. How to use this?
Filip Figiel
@megapctr
Apr 15 2016 18:29
@puneetagg sorry i have no idea then
you can provide a shim package which will contain the required modules
@Kiran2020 what is django-braces? did you read its manual?
Puneet Aggarwal
@puneetagg
Apr 15 2016 18:30
@megapctr shim?
Filip Figiel
@megapctr
Apr 15 2016 18:30
what was the ImportError you were getting again?
Kiran Kumar Chaudhary
@chaudharykiran
Apr 15 2016 18:31
@megapctr django-braces is django-app. you can visit https://django-braces.readthedocs.org/en/latest/access.html#loginrequiredmixin
Filip Figiel
@megapctr
Apr 15 2016 18:32
@Kiran2020 so what's the problem you're having? is it beyond reading the docs?
Kiran Kumar Chaudhary
@chaudharykiran
Apr 15 2016 18:34
I want to check whether is user is logged in or not. If not logged in, I want to redirect him/her to signup page.
@megapctr '''# Create your views here.
class IndexView(LoginRequiredMixin, View):
template_name = "home/index.html"
# optional
login_url = "/signup/"


def get(self, request, *args, **kwargs):
    return render(request, self.template_name, {})
'''
@megapctr ' # Create your views here.
class IndexView(LoginRequiredMixin, View):
template_name = "home/index.html"
# optional
login_url = "/signup/"


def get(self, request, *args, **kwargs):
    return render(request, self.template_name, {}) '
Puneet Aggarwal
@puneetagg
Apr 15 2016 19:17
@megapctr
from requests.packages.urllib3.poolmanager import PoolManager
ImportError: No module named packages.urllib3.poolmanager
this is the import error..
Jesse Pavlis
@jessepavlis
Apr 15 2016 19:38
@puneetagg Do you have a file named requests.py in the same directory where you are running the import statement from requests.packages.urllib3.poolmanager import PoolManager
Puneet Aggarwal
@puneetagg
Apr 15 2016 19:44
@jessepavlis As I checked, it's not in the same place. But I am using popular django-rest-framework-social-oauth2 in which python-social-auth is causing problem. Here is the complete stack trace:
Traceback (most recent call last):
  File "/home/vaio/git_kiti/kiti/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/vaio/git_kiti/kiti/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/home/vaio/git_kiti/kiti/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 312, in execute
    django.setup()
  File "/home/vaio/git_kiti/kiti/env/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/vaio/git_kiti/kiti/env/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/home/vaio/git_kiti/kiti/env/lib/python2.7/site-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/vaio/git_kiti/kiti/env/lib/python2.7/site-packages/social/apps/django_app/default/models.py", line 8, in <module>
    from social.utils import setting_name
  File "/home/vaio/git_kiti/kiti/env/lib/python2.7/site-packages/social/utils.py", line 13, in <module>
    from requests.packages.urllib3.poolmanager import PoolManager
ImportError: No module named packages.urllib3.poolmanager
gmwill92
@gmwill92
Apr 15 2016 23:30
Anyone knows of a tutorial of deploying django (production) on Digital ocean with nginx and mysql?