Open GoogleCodeExporter opened 9 years ago
This is a valid feature request, would you be willing to provide a patch?
Original comment by mattbrow...@gmail.com
on 17 Apr 2009 at 5:36
Here's a patch for runserver. Please let me know if this is acceptable.
svn diff appengine_django/management/commands/runserver.py
Index: appengine_django/management/commands/runserver.py
===================================================================
--- appengine_django/management/commands/runserver.py (revision 100)
+++ appengine_django/management/commands/runserver.py (working copy)
@@ -35,7 +35,7 @@
# hack __main__ so --help in dev_appserver_main works OK.
sys.modules['__main__'] = dev_appserver_main
# Set bind ip/port if specified.
- if len(sys.argv) > 2:
+ if len(sys.argv) > 2 and not sys.argv[2].startswith("--"):
addrport = sys.argv[2]
try:
addr, port = addrport.split(":")
@@ -62,8 +62,18 @@
# Pass the application specific datastore location to the server.
p = get_datastore_paths()
- args.extend(["--datastore_path", p[0], "--history_path", p[1]])
+ datastore_path = p[0]
+ history_path = p[1]
+ if len(sys.argv) > 2:
+ for arg in sys.argv[2:]:
+ if arg.startswith("--datastore_path="):
+ datastore_path=arg[arg.index("=")+1:]
+ elif arg.startswith("--history_path="):
+ history_path = arg[arg.index("=")+1:]
+
+ args.extend(["--datastore_path", datastore_path, "--history_path",
history_path])
+
# Append the current working directory to the arguments.
dev_appserver_main.main([progname] + args + [os.getcwdu()])
Original comment by dherbst
on 2 Jan 2010 at 8:38
At first glance, it looks like this patch is only valid for the runserver.py
command.
But the feature request was for the ability to run this for other manage.py
commands.
I for one could really use this in 'shell' and 'startapp'.
Original comment by AllTheGo...@gmail.com
on 16 Apr 2010 at 10:49
I'll look at shell. Why does startapp need a datastore? I haven't had any
issues
using startapp without my datastore location. What issues are you running into?
Original comment by dherbst
on 16 Apr 2010 at 11:35
You're right, apologies, that was a mistake. I can't see a need for startapp.
Original comment by AllTheGo...@gmail.com
on 16 Apr 2010 at 11:40
I checked my patch for shell in my fork here:
http://code.google.com/p/dherbst-app-engine-django/source/detail?r=3fea1cacf20d1
5601abda7e0c6deee13497a6370
It may not be the most elegant way to do it, but it works for me.
usage: python manage.py shell --datastore_path=/abs/path/to/file.name
Original comment by dherbst
on 20 Apr 2010 at 1:14
Original issue reported on code.google.com by
IanMLe...@gmail.com
on 18 Jan 2009 at 11:08