Opened 11 years ago
Closed 11 years ago
#20576 closed Uncategorized (invalid)
Adding a script to django view
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Generic views | Version: | 1.4 |
Severity: | Normal | Keywords: | django, raspberrypi, rpi.gpio |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
While trying to find a workaround for my this issue I want to know if you're aware of this.
The steps that I've proceed were:
- Installed django 1.4.5
- Created a project
- Created an app
- Specified an class which uses RPi.GPIO - https://dpaste.de/qWLad/
- Trying to use it in django gives me this error - https://dpaste.de/BvmyF/ and http://severo.ro/RaspberryPi/ModuleNotImportedCorrectly.png
Note: Views.py file - https://dpaste.de/eGKZ4/ and https://dpaste.de/ezeof/ - urls.py
Thank you!
Note:
See TracTickets
for help on using tickets.
Hi,
The error does not seem to be coming from django (see the last two lines of the traceback you posted), so I'm marking this as
invalid
.Also note that the file you posted (the one called
alarm.py
I think) looks very wrong.For one, putting
print
statements andwhile
loops in a class declaration is technically correct but it's not going to do what you want.I humbly suggest that you get more familiar with the python language.
The official tutorial [1] is a good introduction and should help you get a better grasp on how python works.
If you need more help with python, check the help page on the official site [2].
[1] http://docs.python.org/2/tutorial/index.html
[2] http://python.org/about/help/