admin login in edx-platform

8,369 views
Skip to first unread message

Виктор Цедрик

unread,
Oct 9, 2013, 7:07:46 AM10/9/13
to edx-...@googlegroups.com
Hi all!
Today I install edx-platform with help of https://github.com/edx/configuration/wiki#installing-edx-on-a-single-ubuntu-1204-precise-server.
All is ok, but I do not understand how can I change language of cms and lms from english to russian and when I go to http://my-ip/admin what must I enter there?
What default admin login and password for page http://my-ip/admin ???
Please help me. Sorry for my bad English
With best regards

Chris Dodge

unread,
Oct 9, 2013, 10:48:28 AM10/9/13
to edx-...@googlegroups.com
Hi,

Can you look at: https://github.com/edx/edx-platform/wiki/Internationalization-and-localization and see if that answers your questions?
Message has been deleted

Виктор Цедрик

unread,
Oct 9, 2013, 10:59:56 AM10/9/13
to edx-...@googlegroups.com
I can not do this because I have not file lms/env/environment.py
3. Configure it in your lms/env/environment.py, for instance create one called dev_es.py with the following: 

from .dev import *

USE_I18N = True
LANGUAGES = ( ('es_419', 'Spanish'), )
TIME_ZONE = 'America/Guayaquil'
LANGUAGE_CODE = 'es_419'

please help

Chris Dodge

unread,
Oct 9, 2013, 11:43:19 AM10/9/13
to edx-...@googlegroups.com
I think environment.py is really meant to be a variable where you substitute your particular environment .py file.

You should be able to add it to /lms/env/common.py, but I haven't tried that.

Виктор Цедрик

unread,
Oct 9, 2013, 2:34:33 PM10/9/13
to edx-...@googlegroups.com
Thank you very much! My edx-platform is on Russian now.
Please help me with my second question - What default admin login and password for page http://my-ip/admin ???
Thank you. Please help

Chris Dodge

unread,
Oct 9, 2013, 3:52:02 PM10/9/13
to edx-...@googlegroups.com
Congrats. Sorry, I don't know the answer to your second question. Anyone else?

Where you prompted to create an account when you ran the installation scripts?

One other guess is that you need to set the "is_staff" bit on the auth_user database record. We have a django-admin command line for this:

django-admin.py set_staff <email> --settings=lms.envs.cms.dev --pythonpath=.

(run from the root of the edx-platform directory)

Good luck....

John Jarvis

unread,
Oct 9, 2013, 4:15:37 PM10/9/13
to Chris Dodge, edx-...@googlegroups.com
Please help me with my second question - What default admin login and password for page http://my-ip/admin ???

We don't create a default admin login as part of the platform installation (it's probably something we should do, feel free to submit a feature request on the configuration repo).
You will need to create a user manually either using the django shell or the set_staff manage.py command.
-John


Виктор Цедрик

unread,
Oct 10, 2013, 2:38:00 AM10/10/13
to edx-...@googlegroups.com

Thank you for answer.
I have a lot of files with name django-admin.py. Which must I use?
root@edx:/opt/wwc/edx-platform# find /|grep django-admin
/usr/share/man/man1/django-admin.1.gz
/usr/share/pyshared/django/bin/django-admin.py
/usr/bin/django-admin
/usr/lib/python2.7/dist-packages/django/bin/django-admin.py
/usr/lib/python2.7/dist-packages/django/bin/django-admin.pyc
/var/crash/_usr_bin_django-admin.0.crash
/opt/xqueue/virtualenvs/xqueue/bin/django-admin.py
/opt/xqueue/virtualenvs/xqueue/lib/python2.7/site-packages/django/bin/django-admin.py
/opt/xqueue/virtualenvs/xqueue/lib/python2.7/site-packages/django/bin/django-admin.pyc
/opt/edx/bin/django-admin.py
/opt/edx/lib/python2.7/site-packages/django/bin/django-admin.py
/opt/edx/lib/python2.7/site-packages/django/bin/django-admin.pyc
/opt/edx-ora/virtualenvs/edx-ora/bin/django-admin.py
/opt/edx-ora/virtualenvs/edx-ora/lib/python2.7/site-packages/django/bin/django-admin.py
/opt/edx-ora/virtualenvs/edx-ora/lib/python2.7/site-packages/django/bin/django-admin.pyc


If I make command, for example
/opt/edx/bin/django-admin.py createsuperuser
I receive error


root@edx:/opt/wwc/edx-platform# /opt/edx/bin/django-admin.py createsuperuser
Unknown command: 'createsuperuser'
Type 'django-admin.py help' for usage.


Please help

Yarko Tymciurak

unread,
Oct 10, 2013, 4:04:05 AM10/10/13
to Виктор Цедрик, edx-...@googlegroups.com
Hello Viktor -

I do not think you want to use django-admin for this (?).  I think the command you should want is from manage.py - but I'm not sure what the environment has to be (do you run it with rake?  with python?)

You can confirm this in a development VM, where you'd do:

   python manage.py cms help

and see that's where you find "creatsuperuser" as an option, and so you would run "python manage.py cms createsuperuser".

I'm not sure what you need to do on a deployed instance to accomplish the same.
Maybe someone with more familiarity with a deployed system can chime in.


Regards,
- Yarko

Виктор Цедрик

unread,
Oct 10, 2013, 5:09:46 AM10/10/13
to edx-...@googlegroups.com
Thank all for your help!
I simply installed my edx-platform with manual https://github.com/edx/configuration/wiki#installing-edx-on-a-single-ubuntu-1204-precise-server.
In this manual all steps is automatic. After installation I have working system (cms & lms) but I do not understand at all what must I do for login as superuser (admin). After this installation I have a lot of directories with many-many files. There are a lot of files have name manage.py Here is my files with this name -
/usr/local/lib/python2.7/dist-packages/boto/manage/test_manage.pyc
/usr/local/lib/python2.7/dist-packages/boto/manage/test_manage.py
/usr/share/pyshared/django/conf/project_template/manage.py
/usr/share/pyshared/boto/manage/test_manage.py
/usr/share/doc/gunicorn/examples/frameworks/djangotest/manage.py
/usr/lib/python2.7/dist-packages/django/conf/project_template/manage.py
/usr/lib/python2.7/dist-packages/django/conf/project_template/manage.pyc
/usr/lib/python2.7/dist-packages/boto/manage/test_manage.pyc
/usr/lib/python2.7/dist-packages/boto/manage/test_manage.py
/opt/xqueue/virtualenvs/xqueue/lib/python2.7/site-packages/django/conf/project_template/manage.py
/opt/xqueue/virtualenvs/xqueue/lib/python2.7/site-packages/boto/manage/test_manage.pyc
/opt/xqueue/virtualenvs/xqueue/lib/python2.7/site-packages/boto/manage/test_manage.py
/opt/edx/lib/python2.7/site-packages/example/manage.py
/opt/edx/lib/python2.7/site-packages/example/manage.pyc
/opt/edx/lib/python2.7/site-packages/django/conf/project_template/manage.py
/opt/edx/lib/python2.7/site-packages/keyedcache/test_app/manage.py
/opt/edx/lib/python2.7/site-packages/keyedcache/test_app/manage.pyc
/opt/edx/lib/python2.7/site-packages/boto/manage/test_manage.pyc
/opt/edx/lib/python2.7/site-packages/boto/manage/test_manage.py
/opt/edx/src/django-wiki/testproject/manage.py
/opt/edx/src/django-wiki/testproject/vmanage.py
/opt/edx/src/xblock/manage.py
/opt/wwc/xqueue/manage.py
/opt/wwc/edx-platform/manage.py
/opt/wwc/edx-platform/cms/pydev_manage.py
/opt/wwc/edx-ora/manage.py
/opt/edx-ora/virtualenvs/edx-ora/lib/python2.7/site-packages/django/conf/project_template/manage.py
/opt/edx-ora/virtualenvs/edx-ora/lib/python2.7/site-packages/boto/manage/test_manage.pyc
/opt/edx-ora/virtualenvs/edx-ora/lib/python2.7/site-packages/boto/manage/test_manage.py


Which from this files must I execute for command python manage.py cms createsuperuser ? For example I think that this file is /opt/wwc/edx-platform/manage.py. I executed it and received

root@edx:/opt/wwc/edx-platform# /opt/wwc/edx-platform/manage.py -h
usage: manage.py [-h] {lms,cms} ...

optional arguments:
  -h, --help  show this help message and exit

system:
  edX service to run

  {lms,cms}
    lms       Learning Management System
    cms       Studio

I understood that I must write cms or lms. My next step is

root@edx:/opt/wwc/edx-platform# /opt/wwc/edx-platform/manage.py cms
Traceback (most recent call last):
  File "/opt/wwc/edx-platform/manage.py", line 90, in <module>
    startup = importlib.import_module(edx_args.startup)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/opt/wwc/edx-platform/cms/startup.py", line 8, in <module>
    settings.INSTALLED_APPS  # pylint: disable=W0104
  File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 276, in __getattr__
    self._setup()
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 89, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'cms.envs.dev' (Is it on sys.path?): No module named xblock.fields
root@edx:/opt/wwc/edx-platform# /opt/wwc/edx-platform/manage.py lms
Traceback (most recent call last):
  File "/opt/wwc/edx-platform/manage.py", line 90, in <module>
    startup = importlib.import_module(edx_args.startup)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/opt/wwc/edx-platform/lms/startup.py", line 9, in <module>
    settings.INSTALLED_APPS  # pylint: disable=W0104
  File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 276, in __getattr__
    self._setup()
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 89, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'lms.envs.dev' (Is it on sys.path?): No module named xblock.fields


Please help me with it. As I understand - if this manual was written (https://github.com/edx/configuration/wiki#installing-edx-on-a-single-ubuntu-1204-precise-server.) in it must be some words about admin profile. Thank you and please help.

Виктор Цедрик

unread,
Oct 10, 2013, 7:48:57 AM10/10/13
to edx-...@googlegroups.com
I decided all my problem


My command for making superuser is

sudo -u www-data SERVICE_VARIANT=lms /opt/edx/bin/django-admin.py createsuperuser --settings=lms.envs.aws --pythonpath=/opt/wwc/edx-platform

Thanks for all very much. Theme is closed.

Puntxo

unread,
Oct 10, 2013, 8:17:33 AM10/10/13
to edx-...@googlegroups.com
Thank you very much! I also wanted to access the admin site and asked people in the group with no luck. Finally it works with your help.

Could you also tell us how you have activated the russian language? I've also installed edx following the instructions for Ubuntu 12.04 in the configuration section but when trying to add a new language I get an error in the "rake i18n:generate" command, and only a few strings are translated.

Chris Dodge

unread,
Oct 10, 2013, 9:40:30 AM10/10/13
to edx-...@googlegroups.com
Can I recommend someone writing this up on the Wiki pages on the edX repo. It's good to capture this knowledge so that others don't have to struggle with this particular issue:

John Jarvis

unread,
Oct 10, 2013, 10:02:40 AM10/10/13
to Chris Dodge, edx-...@googlegroups.com
If you are using our vagrant image the command will be something like this:

sudo -u www-data /opt/edx/bin/python /opt/wwc/edx-platform/manage.py lms --settings=aws --service-variant lms createsuperuser --username <user>

Or if you are in a different environment modify the paths to your needs.  
I've updated https://github.com/edx/edx-platform/wiki/Shell-commands with info on how to run manage.py.
-John



David Norwood

unread,
Oct 10, 2013, 10:12:45 PM10/10/13
to edx-...@googlegroups.com
Folks -- does this mean that there *is* an admin "site"? Like, at ../admin?

TIA

John Jarvis

unread,
Oct 11, 2013, 1:09:59 PM10/11/13
to David Norwood, edx-...@googlegroups.com
Yes, by default nothing is done to disable the admin site. You will just need to create a superuser to log into it.

Pedro Rodriguez

unread,
Oct 24, 2013, 12:46:09 PM10/24/13
to edx-...@googlegroups.com, Chris Dodge
I tried this command
sudo -u www-data /opt/edx/bin/python /opt/wwc/edx-platform/manage.py lms --settings=aws --service-variant lms createsuperuser --username <user>
On an Ubuntu Precise installation, everything is working normally (lms and cms are running well), but I get the following error

Traceback (most recent call last):
  File "/opt/wwc/edx-platform/manage.py", line 90, in <module>
    startup = importlib.import_module(edx_args.startup)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/opt/wwc/edx-platform/lms/startup.py", line 9, in <module>
    settings.INSTALLED_APPS  # pylint: disable=W0104
  File "/opt/edx/local/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
    self._setup()
  File "/opt/edx/local/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/opt/edx/local/lib/python2.7/site-packages/django/conf/__init__.py", line 135, in __init__
    logging_config_func(self.LOGGING)
  File "/usr/lib/python2.7/logging/config.py", line 777, in dictConfig
    dictConfigClass(config).configure()
  File "/usr/lib/python2.7/logging/config.py", line 575, in configure
    '%r: %s' % (name, e))
ValueError: Unable to configure handler 'local': [Errno 111] Connection refused

Pedro Rodriguez

unread,
Oct 24, 2013, 12:58:53 PM10/24/13
to edx-...@googlegroups.com, Chris Dodge
Adding to this, when I run python manage.py lms help from /edx-platform I get this:

Traceback (most recent call last):
  File "manage.py", line 90, in <module>
    startup = importlib.import_module(edx_args.startup)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/opt/wwc/edx-platform/lms/startup.py", line 6, in <module>
    from django.conf import settings
ImportError: No module named django.conf

Pedro Rodriguez

unread,
Oct 24, 2013, 1:15:29 PM10/24/13
to edx-...@googlegroups.com, Chris Dodge
Figured out Iw as running the wrong python so that fixed that error, but I think my base error is this by running
/opt/edx/bin/python manage.py lms syncdb

2013-10-24 06:09:43,794 DEBUG 12540 [nose.plugins.manager] manager.py:385 - DefaultPluginManager load plugin NOSETESTS_PLUGINS = rednose:RedNose
2013-10-24 06:09:43,812 DEBUG 12540 [nose.plugins.manager] manager.py:385 - DefaultPluginManager load plugin nose_ignoredoc = nose_ignoredoc:IgnoreDocstrings
2013-10-24 06:09:43,813 DEBUG 12540 [nose.plugins.manager] manager.py:385 - DefaultPluginManager load plugin xcover = nosexcover:XCoverage
2013-10-24 06:09:43,820 DEBUG 12540 [nose.plugins.manager] manager.py:385 - DefaultPluginManager load plugin nose_exclude = nose_exclude:NoseExclude
2013-10-24 06:09:43,905 INFO 12540 [dd.dogapi] dog_stats_api.py:66 - Initializing dog api to use statsd: localhost, 8125
Syncing...
Traceback (most recent call last):
  File "manage.py", line 95, in <module>
    execute_from_command_line([sys.argv[0]] + django_args)
  File "/opt/edx/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/opt/edx/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/edx/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/opt/edx/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/opt/edx/local/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/opt/edx/local/lib/python2.7/site-packages/south/management/commands/syncdb.py", line 90, in handle_noargs
    syncdb.Command().execute(**options)
  File "/opt/edx/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/opt/edx/local/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/opt/edx/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 57, in handle_noargs
    cursor = connection.cursor()
  File "/opt/edx/local/lib/python2.7/site-packages/django/db/backends/__init__.py", line 317, in cursor
    cursor = self.make_debug_cursor(self._cursor())
  File "/opt/edx/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 288, in _cursor
    self._sqlite_create_connection()
  File "/opt/edx/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 278, in _sqlite_create_connection
    self.connection = Database.connect(**kwargs)
sqlite3.OperationalError: unable to open database file

Ovnicraft

unread,
Oct 28, 2013, 10:36:16 AM10/28/13
to Pedro Rodriguez, edx-...@googlegroups.com, Chris Dodge
Here your error is about open mitx.db sqlite file, you must follow the commands in wiki to get works.
When you work with vagrant you dont need to specify path to run python.

Regards, 



--
Cristian Salamea
@ovnicraft

Pedro Rodriguez

unread,
Oct 31, 2013, 3:55:58 PM10/31/13
to edx-...@googlegroups.com, Pedro Rodriguez, Chris Dodge
Could you post a link to which part you mean. I have been over most of the wiki again looking for mention of that sqlite file but didn't find anything

규동김

unread,
Mar 14, 2014, 5:44:37 PM3/14/14
to edx-...@googlegroups.com
Congratulation for solving prob
 
could you kindly help me with below problem pls?
 
User/superuser creation seems to be the problem at current stage.
I can not create both even though I correctly follow the shell commnand written down in  edX Managing the Production Stack guide
 
here is the error capture shot when following the chell commnand written down in  edX Managing the Production Stack guide(https://github.com/edx/configuration/wiki/edX-Managing-the-Production-Stack)
 
1. list all manage.py commands - OK
  • 2. create a new user --error.  pls see attached picture
  • 3. launch the django shell --error pls see attached picture
4. createsuperuser -error pls see attached picture
 

 
 
 
 
 
 
 
 
 
 
if U see attached oic, you may see [importError>no module named djangfo.conf].
is this not the serious problem? pls let me know how to fix this>
 
thank you so much, May God blesss you !
 
 
 
 
2013년 10월 10일 목요일 오후 8시 48분 57초 UTC+9, Виктор Цедрик 님의 말:

Eman Samir

unread,
Apr 16, 2014, 7:14:45 AM4/16/14
to edx-...@googlegroups.com
how can I import users from a file ?
Reply all
Reply to author
Forward
Message has been deleted
0 new messages