generate new tokens on demand
[mygpo.git] / mygpo / manage.py
blobdbbf7c8f7b7b644ea67201d5d7ca5394375eb7d7
1 #!/usr/bin/python
3 # This file is part of my.gpodder.org.
5 # my.gpodder.org is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or (at your
8 # option) any later version.
10 # my.gpodder.org is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
13 # License for more details.
15 # You should have received a copy of the GNU Affero General Public License
16 # along with my.gpodder.org. If not, see <http://www.gnu.org/licenses/>.
19 import sys
20 import os
22 # Add library directory to Python search path
23 dirname = os.path.dirname(__file__)
24 updir = os.path.abspath(os.path.join(dirname, '..', 'lib'))
25 sys.path.insert(0, updir)
28 from django.core.management import execute_manager
29 try:
30 import settings # Assumed to be in the same directory.
31 except ImportError:
32 sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
33 sys.exit(1)
35 if __name__ == "__main__":
36 execute_manager(settings)