Skip to content

Instantly share code, notes, and snippets.

@mbylstra
Last active December 3, 2015 13:38
Show Gist options
  • Save mbylstra/385fa8cbf22e58b3aa62 to your computer and use it in GitHub Desktop.
Save mbylstra/385fa8cbf22e58b3aa62 to your computer and use it in GitHub Desktop.
django 1.7+ standalone script
import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myapp.settings")
django.setup()
################################################################################
@wpgeek922
Copy link

I like to keep my standalone scripts out of myapp, but when i try to access script in web browser it gives page not found error. How can i fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment