Dijango Framework
Hi guys,
how shall i start dijango framework in python. And also how shall i connect with git interface.
Thanks!
Ramprasad.P
how shall i start dijango framework in python. And also how shall i connect with git interface.
Thanks!
Ramprasad.P
Replies
-
ultimatechangeBest FrameworkOne of the best framework for this is Django framework .This is indeed a wonderful framework with lots of build in support to python and web development .
This provides built in admin panel, support DRY(Don't Repeat Your code) methodology of Python, easy to understand, lots of Django libraries to help you any time you stuck .
There is no info about configuring Apache with mod_python to work with Django. I am assuming you will use the inbuilt development server to test your source, so skip the Apache part in the first step if you like.
1) Install Apache with mod_python module and download Django Web Framework.
- Download Django | Django
- Download - The Apache HTTP Server Project
- #-Link-Snipped-#
- #-Link-Snipped-#
use the Django installer. There is a problem when using the installer from a second level directory e.g.
â¦error: package directory â\djangoâ does not exist Fix that by changing line 24 in setup.py file from
package = dirpath[len_root_dir:].lstrip(â/').replace(â/', â.â) to
package = dirpath[len_root_dir:].lstrip(â\\â).replace(â\\â, â.â)Read more about it here :
Dont know where Python is installed? Use this command to find the â/site-packagesâ folder:
python -c
>>>from distutils.sysconfig import get_python_lib
>>>print get_python_lib()
4) Add the Python directory and the âdjango-admin.pyâ file to your classpath e.g.
- Python: set path=%path%;D:\Kosmal\Web\Python
- django-admin.py: set path=%path%;D:\Kosmal\Web\Python\Lib\site-packages\django\bin
5) Check the Django installation by invoking the Python interpreter using the command line. From a shell type âpythonâ and from prompt type âimport djangoâ. If there is no error message, Django was correctly installed.
6) Creating a test project.
Switch to the directory in where you want your test project to be deployed and run the command âdjango-admin.py startproject mysiteâ. This creates a folder in the current directory called âmysiteâ.
Created files in âmysiteâ folder:
- __init__.py: An empty file that tells Python that this directory
should be considered a Python package. (Read `more about packages`_ in the official Python docs if youâre a Python beginner.) - manage.py: A command-line utility that lets you interact with this Django project in various ways.
- settings.py: Settings/configuration for this Django project.
- urls.py: The URL declarations for this Django project; a âtable ofcontentsâ of your Django-powered site.
- Validating modelsâ¦
0 errors found.
Django version 0.95, using settings âmysite.settingsâ
Development server is running at #-Link-Snipped-#
Quit the server with CONTROL-C (Unix) or CTRL-BREAK (Windows).
By default, the ârunserverâ command starts the development server on port 8000. If you want to change the serverâs port, pass it as a command â line argument. For instance, this command starts the server on port 8080:
âpython manage.py runserver 8080â
8) Database setup (assuming there is already a database installed, I used PostgreSQL ).
Open the file âsettings.pyâ and edit the database settings with database connection details like engine, database name, user, password etc.
Make sure the database exists before going on to the next step.
Django comes with installed default applications which require at last one table in the
database. Scroll down the âsettings.pyâ to see which applications there are.
Run the command âpython manage.py syncdbâ which will create the essential tables in the database. When running on a windows machine and using PostgreSQL make sure to install the psycopg python-postgresql database interface windows port which you can download here:
- #-Link-Snipped-#
âpython manage.py dbsyncâ command:
â¦Value Error : invalid literal for int() with base 10: â3,â at line 57 of base.py
you have to replace that line of code with the following line:
postgres_version = [int(val.strip(',')) for val in cursor.fetchone()[0].split()[1].split(â.')]
Read more about this here:
Now Django is properly setup and can connect to the database. -
meetramprasad#-Link-Snipped-#
Thanks a lot for your nice description. Can tou please post some tutorial to start my dijango. 😀
You are reading an archived discussion.
Related Posts
IS IT NECESSASORY TO USE A NEUTRAL LINK IN A CIRCUIT? WHY ITS VERY ESSENTIAL?
i have prepared my project report and i have to submit it by 31st for funding. but still i have some queries and want clarifications can you guide me?
My quest for the best router in the market never ceases to end. I'm looking for the recommendations on what we'd typically call "the best long range wireless router". I'd...
Patent Infringement against Samsung seems to be firm shot at Android.
Using iOS & Android in smartphone, you will find almost everything similar. Same feelings you get while using Apple...
hello.
i need to take feedback from a servo motor. it is not too large, (as big as my thumb). i want its information about its position and speed.
if...