开发者

Django questions: setting the port number and the using an existing database

I have a mini project that I'd like to start on port 2000. How do I do this?

开发者_如何学运维

Also, how would I set up the project with an existing database?

What Django books did you find helpful?


When you're in the directory you want to be in...

python ./manager.py runserver 2000

You can sync a given database by adding the name to DATABASE_NAME in settings.py, as well as doing a python manager.py syncdb in the terminal.

Also, a quick google would have led you to the Django Book. I don't understand how you haven't come across this yet?


Use ./manage.py inspectdb to create a draft of your models.py file to use with the DB. You will have to separate it out into the appropriate apps, and update field types and relationships as necessary.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜