Sto cercando di eseguire questo modulo pythonPython nome 'os' non è definito
from settings import PROJECT_ROOT
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME' : os.path.join(BASE_DIR, 'db_name.sqlite3'),
}
}
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'sdfgtardyure34654356435'
# Python dotted path to the WSGI application used by Django's runserver; added in v1.4
WSGI_APPLICATION = 'wsgi.application'
############### PYSEC specific variables
# assumes this directory exists
DATA_DIR = "%s/pysec/data/" % PROJECT_ROOT
ma ogni volta che provo a farlo funzionare da F5
ho questa
Traceback (most recent call last):
File "C:\Python27\pysec-master\local_settings-example.py", line 11, in <module>
'NAME' : os.path.join(BASE_DIR, 'db_name.sqlite3'),
NameError: name 'os' is not defined
Le vite dei moduli nella C:\Python27\pysec-master
e ho ottenuto pysec per here
Sai cosa devo fare per eseguire il modulo con successo?
Avete importato? E '# Rendi questo unico, e non condividerlo con nessuno. ?! – jonrsharpe
Ho scritto 'import os' nella parte superiore del modulo. – ExoticBirdsMerchant
+1 Non so perché ma @jonsharpe deve aver detto qualcosa di veramente buono! – ExoticBirdsMerchant