These are chat archives for django/django

11th
Jan 2018
Jayaram Prabhu Durairaj
@bicepjai
Jan 11 2018 02:19
any tutorials to set up django and cassandra, i see only outdated ones ?
Devin Mork
@Demo318
Jan 11 2018 05:03
Anybody home? I'm having an issue with django-admin.py
Ran into it while doing the welcome to django tutorial. I think something on my system might be configured wrong, but since it's my first time, I thinK I need a second opinion.
:]
@elcolie
Jan 11 2018 05:05
@axelblaze15 https://stackoverflow.com/questions/1202839/get-request-data-in-django-form
Since you are asking in django/django I assume you are using Form
@Demo318 Show me your repo or error in the terminal
Devin Mork
@Demo318
Jan 11 2018 05:09
@elcolie Here's my output from the terminal:
(ENV) Devin@Devins-MacBook-Pro:~/Coding_Projects/Django/try_django/mysite$ django-admin.py shell
Traceback (most recent call last):
  File "/Users/Devin/Coding_Projects/Django/try_django/ENV/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/Users/Devin/Coding_Projects/Django/try_django/ENV/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/Users/Devin/Coding_Projects/Django/try_django/ENV/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/Devin/Coding_Projects/Django/try_django/ENV/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/Devin/Coding_Projects/Django/try_django/ENV/lib/python3.6/site-packages/django/core/management/base.py", line 327, in execute
    saved_locale = translation.get_language()
  File "/Users/Devin/Coding_Projects/Django/try_django/ENV/lib/python3.6/site-packages/django/utils/translation/__init__.py", line 187, in get_language
    return _trans.get_language()
  File "/Users/Devin/Coding_Projects/Django/try_django/ENV/lib/python3.6/site-packages/django/utils/translation/__init__.py", line 55, in __getattr__
    if settings.USE_I18N:
  File "/Users/Devin/Coding_Projects/Django/try_django/ENV/lib/python3.6/site-packages/django/conf/__init__.py", line 56, in __getattr__
    self._setup(name)
  File "/Users/Devin/Coding_Projects/Django/try_django/ENV/lib/python3.6/site-packages/django/conf/__init__.py", line 41, in _setup
    % (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
just trying to launch django-admin.py shell
:]
@elcolie
Jan 11 2018 05:10
@Demo318 Last line is very obvious.
Devin Mork
@Demo318
Jan 11 2018 05:10
To you! Teach me, plz
@elcolie I've poked around online to try to find a solution, but all roads have led me back here. Any help is super appreciated.
:]
@elcolie
Jan 11 2018 05:13
I am on it. Possible you are running on a wrong directory home. Let me prove my hypothesis a moment please.
Your settings.py seems correct
Raphael
@Raphael7788
Jan 11 2018 05:13
@elcolie Hi can I ask help?
How are you?
:]
@elcolie
Jan 11 2018 05:14
@vin7788 I normally reinstall all the packages. Since it does not affect to the website content.
Sorry for late reply
Raphael
@Raphael7788
Jan 11 2018 05:14
@elcolie can we chat privately?
:]
@elcolie
Jan 11 2018 05:14
Sure
Devin Mork
@Demo318
Jan 11 2018 05:19
@elcolie I wonder could it be something on my system? I started a different project, made its own virtualenv, and django-admin.py shell returns the same error
:]
@elcolie
Jan 11 2018 05:21
What is your Django version?
I don't see any requirements.in. I strongly recommend you to use pip-tools
In order to keep track your dependencies correctly
Devin Mork
@Demo318
Jan 11 2018 05:23
@elcolie here's pip show django output:
$ pip show django
Name: Django
Version: 2.0.1
Summary: A high-level Python Web framework that encourages rapid development and clean, pragmatic design.
Home-page: https://www.djangoproject.com/
Author: Django Software Foundation
Author-email: foundation@djangoproject.com
License: BSD
Location: /Users/Devin/Coding_Projects/Django/try_django/ENV/lib/python3.6/site-packages
Requires: pytz
@elcolie I'll certainly manage dependencies better. For this, though, I expected to be able to follow the django website's tutorial step-by-step. This whole error popped up the first time i ran django-admin after the initial django-admin startproject
:]
@elcolie
Jan 11 2018 05:26
@Demo318
I don't see any problem
(tutorial) rifle:mysite sarit$ python manage.py showmigrations
admin
 [X] 0001_initial
 [X] 0002_logentry_remove_auto_add
auth
 [X] 0001_initial
 [X] 0002_alter_permission_name_max_length
 [X] 0003_alter_user_email_max_length
 [X] 0004_alter_user_username_opts
 [X] 0005_alter_user_last_login_null
 [X] 0006_require_contenttypes_0002
 [X] 0007_alter_validators_add_error_messages
 [X] 0008_alter_user_username_max_length
 [X] 0009_alter_user_last_name_max_length
contenttypes
 [X] 0001_initial
 [X] 0002_remove_content_type_name
polls
 [X] 0001_initial
sessions
 [X] 0001_initial
Devin Mork
@Demo318
Jan 11 2018 05:27
can you activate django-admin shell?
that's when I get my error
:]
@elcolie
Jan 11 2018 05:27
(tutorial) rifle:mysite sarit$ python manage.py shell
Python 3.6.3 (default, Nov  4 2017, 19:19:32)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>
Do you use Python3?
Recommend pyenv is the stable one
The problem I guess. You are using python2
Devin Mork
@Demo318
Jan 11 2018 05:29

I was executing django-admin.py shell per this: https://docs.djangoproject.com/en/2.0/ref/django-admin/#django-admin-shell

Looks like you're entering python manage.py shell

I'm guessing there's a difference.

Let me try it through manage.py
:]
@elcolie
Jan 11 2018 05:30
Do you use `Python3`?
Devin Mork
@Demo318
Jan 11 2018 05:30
oh look, it works!
yes
3.6
:]
@elcolie
Jan 11 2018 05:30
Good
Devin Mork
@Demo318
Jan 11 2018 05:30
So, do we need to update the django admin shell in the docs?
:]
@elcolie
Jan 11 2018 05:31
I've never use django-admin command line.
I always stick with manage.py
Trypython manage.py Then you will see the full list
Devin Mork
@Demo318
Jan 11 2018 05:33
yup. it looks like a lot of commands that I guess used to live in django-admin now work out of manage.py?

nevermind. If I scroll back to the top of that documentation, it says:

django-admin is Django’s command-line utility for administrative tasks. This document outlines all it can do.

In addition, manage.py is automatically created in each Django project. manage.py does the same thing as django-admin but takes care of a few things for you:

It puts your project’s package on sys.path.
It sets the DJANGO_SETTINGS_MODULE environment variable so that it points to your project’s settings.py file.

So, i will be using manage.py for the foreseeable future :-)
Thanks, @elcolie!!
Jayaram Prabhu Durairaj
@bicepjai
Jan 11 2018 07:18
django cassandra tutorials ?
Prateek Dabas
@dprateek11
Jan 11 2018 07:32
hello everyone....i have an interview in about 2 weeks for django developer
earlier i worked only on html css
i was reading the documentation of django....i find it difficult to understand
now i am learning from a tutorial on youtube by max goodridge
https://www.youtube.com/watch?v=Fc2O3_2kax8&list=PLw02n0FEB3E3VSHjyYMcFadtQORvl1Ssj
i find it really helpful for me
but my question is "will this be enough?? and what all other resources that i can learn from in order to clear that interview???"
also i am familiar with python and i learn it from lynda.com videos
Roel
@roelzkie15
Jan 11 2018 07:48
@dprateek11 you can do it as long as you can do CRUD feature app with django :smile:
Prateek Dabas
@dprateek11
Jan 11 2018 07:53
@badcoder28 thank you
@badcoder28 this tutorial include crud
app
Roel
@roelzkie15
Jan 11 2018 07:58
@dprateek11 oh i learned a lot of django from justin mitchel tutorials the video were great
@dprateek11 you can also share your interview experience here if you like
Prateek Dabas
@dprateek11
Jan 11 2018 08:09
@badcoder28 for sure i will
@badcoder28 these two tutorials will be enough ??
Roel
@roelzkie15
Jan 11 2018 08:40
@dprateek11 depending to the position but finishing django polls app tutorial can get you going and 2 weeks of learning/familiarizing django it will only cover most of the basic like modeling, views, template engines, url's regex, request/response and deployments.
Prateek Dabas
@dprateek11
Jan 11 2018 08:58
@badcoder28 ok will try to cover as much a i can
@badcoder28 thank you for guiding me
Anish Shrestha
@annshress
Jan 11 2018 13:57
I NEED RESOURCES (YOU GUYS FIND GOOD) TO LEARN GRAPHENE-DJANGO OR GRAPHQL
ANY HELP IS APPRECIATED. please mention me though