Go Back   Smogon Community > Contributions & Corrections > Projects
Register FAQ Social Groups Calendar Search Today's Posts Mark Forums Read

Reply
Categories: HTML, Programming, Other
 
Thread Tools
Old May 5th, 2010, 11:47:56 AM   #26
monkfish
what are birds?
is a Forum Moderator Alumnus
 
monkfish's Avatar
 
Join Date: May 2006
Posts: 5,002
we just don't know.
Default

i think this will need updating after chaos is done changing things up?
monkfish is offline   Reply With Quote
Old May 11th, 2010, 9:15:38 PM   #27
Desch
 
Desch's Avatar
 
Join Date: Nov 2009
Posts: 33
Default

I'm curious, why do you guys use Python instead of PHP? (I'm a PHP dev)
__________________
newblet
Desch is offline   Reply With Quote
Old Oct 30th, 2010, 12:53:08 AM   #28
DougJustDoug**
Knows the great enthusiasms
is a member of the Smogon Site Staffis an Artistis a Programmeris a Smogon IRC SOpis an Administratoris a Battle Server Admin Alumnusis a Tiering Contributor Alumnus
 
DougJustDoug's Avatar
 
Administrator
Join Date: Jun 2007
Posts: 2,901
Houston, TX
Default

I have been setting up a new dev laptop, and I had to go back through the pain of getting my Smogon environment working again (I'm on Vista). Ryu's tut still works pretty well, but I have a few additional notes for anyone attempting this these days, since some stuff has changed.

I doubt many people are actually going to use this info. So, I'm posting this more as a reminder to myself, rather than a full-blown how-to guide. Anyway, here's a few things that are different than the steps in the OP:
1) Smogon site code is kept in a Mercurial repository. There are several Windows-compatible clients for HG (thats the cute acronym for all things related to Mercurial. hg, the symbol for mercury, get it?), but the base command line tool works just fine.

The Smogon HG repository is at this URL:

http://monsan.to/hg/smogon


2) I had issues getting MySQLdb for Python to install properly for some reason. I'm not sure why, but ultimately this blog post gave me step-by-step instructions to get it compiled and installed:

http://www.fuyun.org/2009/12/install...on-on-windows/

Super helpful, and it worked perfectly for me.


3) You need Werkzeug nowadays. If you have setuptools installed like the OP says, then installing Werkzeug is a breeze. Just do this at the command prompt:

easy_install Werkzeug


4) Blow off all the lightorm stuff in the OP. The Smogon site isn't using it any more, afaik.


5) In the OP, it refers to making a config.py file in the smogon directory. You still need to do that, but you need more than just the password. Put a user and address in there too. For example, my config.py looks something like this:
Code:
user="jimbo"
password="isFat"
address="localhost"
Change the values for user and password to suit your MySQL installation, or just to be nicer to Jimbo.

If you do all that stuff, then test.py should work just fine, and you will be up and running with a local install of the Smogon environment. You won't have any database data, however. I may see what I can do about that sometime in the future. But, in the meantime, the running code is a decent start.

FWIW, I use PyScripter for all Python stuff on Windows. Although I'm willing to deal with Eclipse-hell for most Java stuff, it was a constant nightmare for me to get PyDev to work right. I'm not real strong with Python anyway, and the Eclipse plugin seemed to just confuse me even more. PyScripter has all the features you expect from an IDE, but isn't the massive bloatware explosion that most IDE's impose on your machine. Give it a try.
__________________
My Art Thread: ArtJustArt - The Art of DougJustDoug

Last edited by DougJustDoug; Oct 30th, 2010 at 11:10:36 AM. Reason: Added config.py stuff
DougJustDoug is offline   Reply With Quote
Old Oct 30th, 2010, 3:49:03 AM   #29
Seven Deadly Sins
:D
is a Tutoris a member of the Smogon Site Staffis a Forum Moderatoris a Contributor to Smogon Mediais a Contributor to Smogonis a Tiering Contributor Alumnusis a Battle Server Moderator Alumnus
 
Seven Deadly Sins's Avatar
 
Moderator
Join Date: May 2008
Posts: 4,175
Default

Thanks a bunch Doug, I'm gonna take a shot at getting the new framework set up. Any info in regards to getting actual database data to mess with would be awesome, though.
__________________
Seven Deadly Sins is offline   Reply With Quote
Old Jan 27th, 2011, 9:45:21 PM   #30
monkfish
what are birds?
is a Forum Moderator Alumnus
 
monkfish's Avatar
 
Join Date: May 2006
Posts: 5,002
we just don't know.
Default

I'm trying to set up a dev env, have followed all the steps mentioned in this thread. However, on running test.py:
Code:
 * Running on http://www.smogon.com:4000/
Traceback (most recent call last):
  File "C:\Programming\smogon\test.py", line 37, in <module>
    run_simple('www.smogon.com', 4000, app, use_debugger=True, use_reloader=True
)
  File "C:\Python27\lib\site-packages\werkzeug-0.6.2-py2.7.egg\werkzeug\serving.
py", line 529, in run_simple
    test_socket.bind((hostname, port))
  File "C:\Python27\lib\socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 10049] The requested address is not valid in its context
The solution is to change line 37 of test.py to subsitute in 'localhost' for 'www.smogon.com' (!)

should be mentioned somewhere that port 4000 is the default for test.py

also it would be nice to get a db dump (or a limited access user account to the live db)

current problem is that i have no content - every page is a 404?
__________________
carpay deum. thats spanish for liv ur life. im out

Last edited by monkfish; Jan 27th, 2011 at 11:53:06 PM.
monkfish is offline   Reply With Quote
Old Apr 8th, 2011, 5:02:36 PM   #31
Dragonitro
 
Dragonitro's Avatar
 
Join Date: Feb 2010
Posts: 12
France
Default

Quote:
Originally Posted by Fat DougJustDoug View Post
The Smogon HG repository is at this URL:

http://monsan.to/hg/smogon

The repository are dead => Error 404
Dragonitro is offline   Reply With Quote
Reply Smogon Community > Contributions & Corrections > Projects

« Previous Thread | Next Thread »
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 6:28:32 AM.